use of com.cburch.draw.actions.ModelChangeAttributeAction in project logisim-evolution by reds-heig.
the class AttrTableSelectionModel method setValueRequested.
@Override
public void setValueRequested(Attribute<Object> attr, Object value) throws AttrTableSetException {
SelectionAttributes attrs = (SelectionAttributes) getAttributeSet();
Map<AttributeMapKey, Object> oldVals;
oldVals = new HashMap<AttributeMapKey, Object>();
Map<AttributeMapKey, Object> newVals;
newVals = new HashMap<AttributeMapKey, Object>();
for (Map.Entry<AttributeSet, CanvasObject> ent : attrs.entries()) {
AttributeMapKey key = new AttributeMapKey(attr, ent.getValue());
oldVals.put(key, ent.getKey().getValue(attr));
newVals.put(key, value);
}
CanvasModel model = canvas.getModel();
canvas.doAction(new ModelChangeAttributeAction(model, oldVals, newVals));
fireTitleChanged();
}
Aggregations