Package org.freeplane.core.undo

Examples of org.freeplane.core.undo.IActor


    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry registry = AttributeRegistry.getRegistry(map);
    final int iOld = registry.getElements().indexOf(oldName);
    final AttributeRegistryElement oldElement = registry.getElement(iOld);
    final SortedComboBoxModel values = oldElement.getValues();
    final IActor registryActor = new RegistryAttributeActor(newName, oldElement.isManual(), oldElement.isVisible(),
        registry, map);
    Controller.getCurrentModeController().execute(registryActor, map);
    final AttributeRegistryElement newElement = registry.getElement(newName);
    for (int i = 0; i < values.getSize(); i++) {
      final IActor registryValueActor = new RegistryAttributeValueActor(newElement, values.getElementAt(i)
          .toString(), false);
      Controller.getCurrentModeController().execute(registryValueActor, map);
    }
    final IVisitor replacer = new AttributeRenamer(oldName, newName);
    final Iterator iterator = new Iterator(replacer);
    ModeController modeController = Controller.getCurrentModeController();
    final NodeModel root = modeController.getMapController().getRootNode();
    iterator.iterate(root);
    final IActor unregistryActor = new UnregistryAttributeActor(oldName, registry, map);
    Controller.getCurrentModeController().execute(unregistryActor, map);
  }
View Full Code Here


  public void performReplaceAttributeValue(final String name, final String oldValue, final String newValue) {
    Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    ModeController modeController = controller.getModeController();
    final AttributeRegistry registry = AttributeRegistry.getRegistry(map);
    final IActor actor = new ReplaceAttributeValueActor(registry, name, oldValue, newValue);
    Controller.getCurrentModeController().execute(actor, map);
    final IVisitor replacer = new AttributeChanger(name, oldValue, newValue);
    final Iterator iterator = new Iterator(replacer);
    final NodeModel root = modeController.getMapController().getRootNode();
    iterator.iterate(root);
View Full Code Here

  public void performSetColumnWidth(final NodeAttributeTableModel model, final int col, final int width) {
    final int oldWidth = model.getLayout().getColumnWidth(col);
    if (width == oldWidth) {
      return;
    }
    final IActor actor = new SetAttributeColumnWidthActor(col, oldWidth, width, model);
    Controller.getCurrentModeController().execute(actor, model.getNode().getMap());
  }
View Full Code Here

  public void performSetFontSize(final AttributeRegistry registry, final int size) {
    final int oldSize = registry.getFontSize();
    if (size == oldSize) {
      return;
    }
    final IActor actor = new IActor() {
      public void act() {
        final MapModel map = Controller.getCurrentModeController().getController().getMap();
        final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
        attributeRegistry.setFontSize(size);
      }
View Full Code Here

      currentValue = registry.getElement(index).isRestricted();
    }
    if (currentValue == isRestricted) {
      return;
    }
    final IActor actor = new SetAttributeRestrictedActor(registry, index, isRestricted);
    Controller.getCurrentModeController().execute(actor, map);
  }
View Full Code Here

        final String name = o.toString().trim();
        final String oldName = attribute.getName();
        if (oldName.equals(name)) {
          return;
        }
        final IActor nameActor = new SetAttributeNameActor(model, name, oldName, row);
        Controller.getCurrentModeController().execute(nameActor, map);
        try {
          final AttributeRegistryElement element = registry.getElement(name);
          final String value = model.getValueAt(row, 1).toString();
          final int index = element.getValues().getIndexOf(value);
          if (index == -1) {
            final IActor valueActor = new SetAttributeValueActor(model, row, element.getValues().firstElement());
            Controller.getCurrentModeController().execute(valueActor, map);
          }
        }
        catch (final NoSuchElementException ex) {
          final IActor registryActor = new RegistryAttributeActor(name, false, false, registry, map);
          Controller.getCurrentModeController().execute(registryActor, map);
        }
        break;
      }
      case 1: {
        if (attribute.getValue().equals(o)) {
          return;
        }
        final IActor actor = new SetAttributeValueActor(model, row, o);
        Controller.getCurrentModeController().execute(actor, map);
        final String name = model.getValueAt(row, 0).toString();
        final AttributeRegistryElement element = registry.getElement(name);
        final int index = element.getValues().getIndexOf(o);
        if (index == -1) {
          final IActor registryActor = new RegistryAttributeValueActor(element, o, false);
          Controller.getCurrentModeController().execute(registryActor, map);
        }
        break;
      }
    }
View Full Code Here

    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
    if (attributeRegistry.getElement(index).isVisible() == isVisible) {
      return;
    }
    final IActor actor = new SetAttributeVisibleActor(attributeRegistry, index, isVisible);
    Controller.getCurrentModeController().execute(actor, map);
  }
View Full Code Here

    Controller.getCurrentModeController().execute(actor, node.getMap());
  }


  public void setHorizontalShift(NodeModel node, final int horizontalShift){
    final IActor actor = new ChangeShiftXActor(node, horizontalShift);
    Controller.getCurrentModeController().execute(actor, node.getMap());
  }
View Full Code Here

    final IActor actor = new ChangeShiftXActor(node, horizontalShift);
    Controller.getCurrentModeController().execute(actor, node.getMap());
  }

  public void setVerticalShift(NodeModel node, final int verticalShift){
    final IActor actor = new ChangeShiftYActor(node, verticalShift);
    Controller.getCurrentModeController().execute(actor, node.getMap());
  }
View Full Code Here

    final IActor actor = new ChangeShiftYActor(node, verticalShift);
    Controller.getCurrentModeController().execute(actor, node.getMap());
  }

  public void setMinimalDistanceBetweenChildren(NodeModel node, final int minimalDistanceBetweenChildren){
    final IActor actor = new ChangeVGapActor(node, minimalDistanceBetweenChildren);
    Controller.getCurrentModeController().execute(actor, node.getMap());
  }
View Full Code Here

TOP

Related Classes of org.freeplane.core.undo.IActor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.