Пример #1
0
 private void execUndoInformation(boolean undo) {
   UndoInformation undoInfo = undoStack.get(undo);
   if (undoInfo != null) {
     setRectangle(getRectangle().add(undoInfo.getDiffRectangle(getGridSize(), undo)));
     Stickables.applyChanges(undoInfo.getStickableMoves(undo), null);
     // setAdditionalAttributes(undoInfo.getAdditionalAttributes(undo)); //Issue 217: of all
     // OldGridElements only the Relation uses additional attributes and in that case they must not
     // be set because of zooming errors (see Issue 217)
   }
 }
Пример #2
0
 private void moveStickables(
     StickableMap stickables,
     boolean undoable,
     Rectangle oldRect,
     StickingPolygon stickingPolygonBeforeLocationChange,
     String oldAddAttr) {
   Map<Stickable, List<PointChange>> stickableChanges =
       Stickables.moveStickPointsBasedOnPolygonChanges(
           stickingPolygonBeforeLocationChange,
           generateStickingBorder(),
           stickables,
           getGridSize());
   if (undoable) {
     undoStack.add(
         new UndoInformation(
             getRectangle(),
             oldRect,
             stickableChanges,
             getGridSize(),
             oldAddAttr,
             getAdditionalAttributes()));
   }
 }
Пример #3
0
 @Override
 public void mergeUndoDrag() {
   UndoInformation undoInfoA = undoStack.remove();
   UndoInformation undoInfoB = undoStack.remove();
   undoStack.add(undoInfoA.merge(undoInfoB));
 }