Search in sources :

Example 1 with AttrTableSetException

use of com.cburch.logisim.gui.generic.AttrTableSetException in project logisim-evolution by reds-heig.

the class AttrTableCircuitModel method setValueRequested.

@Override
public void setValueRequested(Attribute<Object> attr, Object value) throws AttrTableSetException {
    if (!proj.getLogisimFile().contains(circ)) {
        String msg = Strings.get("cannotModifyCircuitError");
        throw new AttrTableSetException(msg);
    } else {
        CircuitMutation xn = new CircuitMutation(circ);
        xn.setForCircuit(attr, value);
        proj.doAction(xn.toAction(Strings.getter("changeCircuitAttrAction")));
    }
}
Also used : CircuitMutation(com.cburch.logisim.circuit.CircuitMutation) AttrTableSetException(com.cburch.logisim.gui.generic.AttrTableSetException)

Example 2 with AttrTableSetException

use of com.cburch.logisim.gui.generic.AttrTableSetException in project logisim-evolution by reds-heig.

the class AttrTableComponentModel method setValueRequested.

@Override
public void setValueRequested(Attribute<Object> attr, Object value) throws AttrTableSetException {
    if (!proj.getLogisimFile().contains(circ)) {
        String msg = Strings.get("cannotModifyCircuitError");
        throw new AttrTableSetException(msg);
    } else {
        SetAttributeAction act = new SetAttributeAction(circ, Strings.getter("changeAttributeAction"));
        act.set(comp, attr, value);
        proj.doAction(act);
    }
}
Also used : AttrTableSetException(com.cburch.logisim.gui.generic.AttrTableSetException) SetAttributeAction(com.cburch.logisim.tools.SetAttributeAction)

Aggregations

AttrTableSetException (com.cburch.logisim.gui.generic.AttrTableSetException)2 CircuitMutation (com.cburch.logisim.circuit.CircuitMutation)1 SetAttributeAction (com.cburch.logisim.tools.SetAttributeAction)1