use of com.willwinder.ugs.nbp.designer.actions.MoveAction in project Universal-G-Code-Sender by winder.
the class MoveControl method addUndoAction.
private void addUndoAction(Point2D deltaMovement, Entity target) {
UndoManager undoManager = CentralLookup.getDefault().lookup(UndoManager.class);
if (undoManager != null) {
List<Entity> entityList = new ArrayList<>();
if (target instanceof SelectionManager) {
entityList.addAll(((SelectionManager) target).getSelection());
} else {
entityList.add(target);
}
undoManager.addAction(new MoveAction(entityList, deltaMovement));
}
}
Aggregations