Package org.freeplane.features.map

Examples of org.freeplane.features.map.MapModel


  @Override
  public void performRegistryAttribute(final String name) {
    if (name.equals("")) {
      return;
    }
    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
    try {
      attributeRegistry.getElement(name);
    }
    catch (final NoSuchElementException ex) {
View Full Code Here


  @Override
  public void performRegistryAttributeValue(final String name, final String value, boolean manual) {
    if (name.equals("")) {
      return;
    }
    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
    try {
      final AttributeRegistryElement element = attributeRegistry.getElement(name);
      if (element.getValues().contains(value)) {
        return;
View Full Code Here

    final IVisitor remover = new AttributeRemover(name);
    final Iterator iterator = new Iterator(remover);
    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

    final IVisitor remover = new AttributeValueRemover(name, value);
    final Iterator iterator = new Iterator(remover);
    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

  public void actionPerformed(final ActionEvent e) {
    if(UITools.isEditingText())
      return;
    final Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
    final MapController mapController = Controller.getCurrentModeController().getMapController();
    mapController.addNodeChangeListener(this);
    try{
    undoHandler.getRedoAction().actionPerformed(e);
    if(lastChangedNode != null){
View Full Code Here

  @Override
  public void performReplaceAtributeName(final String oldName, final String newName) {
    if (oldName.equals("") || newName.equals("") || oldName.equals(newName)) {
      return;
    }
    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(),
View Full Code Here

    }

  }

  public void reset() {
    final MapModel map = Controller.getCurrentController().getMap();
    final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
    undoHandler.resetRedo();
    setEnabled(false);
  }
View Full Code Here

  }

  @Override
  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);
View Full Code Here

    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);
      }

      public String getDescription() {
        return "SetAttributeFontSizeActor";
      }

      public void undo() {
        final MapModel map = Controller.getCurrentModeController().getController().getMap();
        final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
        attributeRegistry.setFontSize(oldSize);
      }
    };
    Controller.getCurrentModeController().execute(actor, Controller.getCurrentModeController().getController().getMap());
View Full Code Here

  }

  @Override
  public void performSetRestriction(final int index, final boolean isRestricted) {
    boolean currentValue;
    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry registry = AttributeRegistry.getRegistry(map);
    if (index == AttributeRegistry.GLOBAL) {
      currentValue = registry.isRestricted();
    }
    else {
View Full Code Here

TOP

Related Classes of org.freeplane.features.map.MapModel

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.