use of com.cburch.draw.model.HandleGesture in project logisim-evolution by reds-heig.
the class Selection method modelChanged.
void modelChanged(CanvasModelEvent event) {
int action = event.getAction();
switch(action) {
case CanvasModelEvent.ACTION_REMOVED:
Collection<? extends CanvasObject> affected = event.getAffected();
if (affected != null) {
selected.removeAll(affected);
suppressed.keySet().removeAll(affected);
Handle h = selectedHandle;
if (h != null && affected.contains(h.getObject())) {
setHandleSelected(null);
}
}
break;
case CanvasModelEvent.ACTION_HANDLE_DELETED:
if (event.getHandle().equals(selectedHandle)) {
setHandleSelected(null);
}
break;
case CanvasModelEvent.ACTION_HANDLE_MOVED:
HandleGesture gesture = event.getHandleGesture();
if (gesture.getHandle().equals(selectedHandle)) {
setHandleSelected(gesture.getResultingHandle());
}
break;
default:
break;
}
}
use of com.cburch.draw.model.HandleGesture in project logisim-evolution by reds-heig.
the class Selection method setHandleGesture.
public void setHandleGesture(HandleGesture gesture) {
HandleGesture g = curHandleGesture;
if (g != null)
suppressed.remove(g.getHandle().getObject());
Handle h = gesture.getHandle();
suppressed.put(h.getObject(), MOVING_HANDLE);
curHandleGesture = gesture;
}
Aggregations