Package org.freeplane.core.undo

Examples of org.freeplane.core.undo.IActor


    try {
      final AttributeRegistryElement element = attributeRegistry.getElement(name);
      if (element.getValues().contains(value)) {
        return;
      }
      final IActor actor = new RegistryAttributeValueActor(element, value, manual);
      Controller.getCurrentModeController().execute(actor, map);
      return;
    }
    catch (final NoSuchElementException ex) {
      final IActor nameActor = new RegistryAttributeActor(name, true, false, attributeRegistry, map);
      Controller.getCurrentModeController().execute(nameActor, map);
      final AttributeRegistryElement element = attributeRegistry.getElement(name);
      final IActor valueActor = new RegistryAttributeValueActor(element, value, false);
      Controller.getCurrentModeController().execute(valueActor, map);
    }
  }
View Full Code Here


      copyExtensions(key, from, to);
      return;
    }
    final NodeModel backup = new NodeModel(null);
    copyExtensions(key, to, backup);
    final IActor actor = new IActor() {
      public void undo() {
        removeExtensions(key, to);
        copyExtensions(key, backup, to);
        getMapController().nodeChanged(to);
      }
View Full Code Here

      removeExtensions(key, from, which);
      return;
    }
    final NodeModel backup = new NodeModel(null);
    copyExtensions(key, from, backup);
    final IActor actor = new IActor() {
      public void undo() {
        copyExtensions(key, backup, from);
        getMapController().nodeChanged(from);
      }
View Full Code Here

    ModeController modeController = Controller.getCurrentModeController();
    final NodeModel root = modeController.getMapController().getRootNode();
    iterator.iterate(root);
    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
    final IActor actor = new UnregistryAttributeActor(name, attributeRegistry, map);
    Controller.getCurrentModeController().execute(actor, map);
  }
View Full Code Here

      resolveParentExtensions(key, to);
      return;
    }
    final NodeModel backup = new NodeModel(null);
    copyExtensions(key, to, backup);
    final IActor actor = new IActor() {
      public void undo() {
        copyExtensions(key, backup, to);
        getMapController().nodeChanged(to);
      }
View Full Code Here

    ModeController modeController = Controller.getCurrentModeController();
    final NodeModel root = modeController.getMapController().getRootNode();
    iterator.iterate(root);
    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
    final IActor unregistryActor = new UnregistryAttributeValueActor(attributeRegistry.getElement(name), value);
    Controller.getCurrentModeController().execute(unregistryActor, map);
  }
View Full Code Here

  @Override
  public Attribute performRemoveRow(final NodeAttributeTableModel model, final int row) {
    final Vector<Attribute> attributes = model.getAttributes();
    final Object o = attributes.elementAt(row);
    final IActor actor = new RemoveAttributeActor(model, row);
    Controller.getCurrentModeController().execute(actor, model.getNode().getMap());
    return (Attribute) o;
  }
View Full Code Here

      }
    });
  }

  public void addIcon(final NodeModel node, final MindIcon icon) {
    final IActor actor = new IActor() {
      public void act() {
        node.addIcon(icon);
        Controller.getCurrentModeController().getMapController().nodeChanged(node, NodeModel.NODE_ICON, null, icon);
      }
View Full Code Here

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

  public void addIcon(final NodeModel node, final MindIcon icon, final int position) {
    final IActor actor = new IActor() {
      public void act() {
        node.addIcon(icon, position);
        Controller.getCurrentModeController().getMapController().nodeChanged(node, NodeModel.NODE_ICON, null, icon);
      }
View Full Code Here

    final int size = node.getIcons().size();
    final int index = position >= 0 ? position : size + position;
    if (size == 0 || size <= index) {
      return size;
    }
    final IActor actor = new IActor() {
      private final MindIcon icon = node.getIcon(index);

      public void act() {
        node.removeIcon(index);
        Controller.getCurrentModeController().getMapController().nodeChanged(node, NodeModel.NODE_ICON, icon, null);
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.