@Override public boolean isValid() { for (ViewDragableInterface v : viewReprezentations) { if (!v.validNewPosition(dx, dy)) return false; } return true; }
@Override public void undo() { for (ViewDragableInterface v : viewReprezentations) { v.setLocation(new Point(v.getX() - dx, v.getY() - dy)); v.update(); } Session.getSelectedSheet().repaint(Session.getSelectedSheet().getVisibleRect()); }
public boolean execute() { if (!isValid()) { Session.st_postErrorMessage(Strings.RELOCATE_ERROR); return false; } for (ViewDragableInterface v : viewReprezentations) { v.setLocation(new Point(v.getX() + dx, v.getY() + dy)); v.update(); } Session.getSelectedSheet().repaint(Session.getSelectedSheet().getVisibleRect()); return true; }