Package org.freeplane.features.map

Examples of org.freeplane.features.map.NodeModel


        mapController.moveNodeAsChild(movedNode, parentNode, movedNode.isLeft(), parentNode.isLeft() != movedNode.isLeft());
  }

  // Node: R/W
  public void moveTo(final Proxy.Node parentNodeProxy, final int position) {
        final NodeModel parentNode = ((NodeProxy) parentNodeProxy).getDelegate();
        final NodeModel movedNode = getDelegate();
    final MMapController mapController = (MMapController) getModeController().getMapController();
    ((FreeNode)Controller.getCurrentModeController().getExtension(FreeNode.class)).undoableDeactivateHook(movedNode);
    mapController.moveNode(movedNode, parentNode, position, getDelegate().isLeft(), parentNode.isLeft() != movedNode.isLeft());
  }
View Full Code Here


  }

  // NodeRO: R
  @Deprecated
  public List<Node> find(final ICondition condition) {
    final NodeModel delegate = getDelegate();
    if (getScriptContext() != null)
      getScriptContext().accessBranch(delegate);
    return ProxyUtils.find(condition, delegate, getScriptContext());
  }
View Full Code Here

    return ProxyUtils.find(condition, delegate, getScriptContext());
  }

  // NodeRO: R
  public List<Node> find(final Closure<Boolean> closure) {
    final NodeModel delegate = getDelegate();
    if (getScriptContext() != null)
      getScriptContext().accessBranch(delegate);
    return ProxyUtils.find(closure, delegate, getScriptContext());
  }
View Full Code Here

    return ProxyUtils.find(closure, delegate, getScriptContext());
  }

  // NodeRO: R
  public List<Node> findAll() {
    final NodeModel delegate = getDelegate();
    if (getScriptContext() != null)
      getScriptContext().accessBranch(delegate);
    return ProxyUtils.findAll(delegate, getScriptContext(), true);
    }
View Full Code Here

      public void nodeChanged(final NodeChangeEvent event) {
        final IMapSelection selection = controller.getSelection();
        if (selection == null) {
          return;
        }
        final NodeModel node = event.getNode();
        if (selection.getSelected().equals(node)) {
          setStyle(node);
        }
      }
    });
    mapController.addMapChangeListener(new AMapChangeListenerAdapter() {

      @Override
            public void mapChanged(MapChangeEvent event) {
        if(! MapStyle.MAP_STYLES.equals(event.getProperty()))
          return;
        final IMapSelection selection = controller.getSelection();
        if (selection == null) {
          return;
        }
        final NodeModel node = selection.getSelected();
        setStyle(node);
            }
     
    });
    final IMapViewManager mapViewManager = controller.getMapViewManager();
View Full Code Here

    return ProxyUtils.findAll(delegate, getScriptContext(), true);
    }

  // NodeRO: R
  public List<Node> findAllDepthFirst() {
    final NodeModel delegate = getDelegate();
    if (getScriptContext() != null)
      getScriptContext().accessBranch(delegate);
    return ProxyUtils.findAll(delegate, getScriptContext(), false);
    }
View Full Code Here

  public void actionPerformed(final ActionEvent e) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    if (selection == null) {
      return;
    }
    final NodeModel start = selection.getSelected();
    if (editor == null) {
      editor = new FilterConditionEditor(FilterController.getCurrentFilterController());
      editor.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5, 0, 5, 0)));

    }
    else {
      editor.mapChanged(start.getMap());
    }
    editor.addAncestorListener(new AncestorListener() {
      public void ancestorAdded(final AncestorEvent event) {
        final Component component = event.getComponent();
        final Window windowAncestor = SwingUtilities.getWindowAncestor(component);
View Full Code Here

    if (info == null || info.condition == null) {
      displayNoPreviousFindMessage();
      return;
    }
    final FilterController filterController = FilterController.getCurrentFilterController();
    final NodeModel start = Controller.getCurrentController().getSelection().getSelected();
    final NodeModel root = map.getNodeForID(info.rootID);
    if (root == null) {
      info.condition = null;
      displayNoPreviousFindMessage();
      return;
    }
    for (NodeModel n = start; !root.equals(n); n = n.getParentNode()) {
      if (n == null) {
        info.condition = null;
        displayNoPreviousFindMessage();
        return;
      }
    }
    final NodeModel next = filterController.findNext(start, null, Direction.FORWARD, info.condition);
    if (next == null) {
      displayNotFoundMessage(root, info.condition);
      return;
    }
    displayNode(info, next);
View Full Code Here

   * link actions).
   */
  private void displayNode(final FindNodeList info, final NodeModel node) {
    final MapModel map = node.getMap();
    final LinkedList<String> nodesUnfoldedByDisplay = new LinkedList<String>();
    NodeModel nodeOnPath = null;
    for (nodeOnPath = node; nodeOnPath != null && !info.nodesUnfoldedByDisplay.contains(nodeOnPath.createID()); nodeOnPath = nodeOnPath
        .getParentNode()) {
      if (Controller.getCurrentModeController().getMapController().isFolded(nodeOnPath)) {
        nodesUnfoldedByDisplay.add(nodeOnPath.createID());
      }
    }
    final ListIterator<String> oldPathIterator = info.nodesUnfoldedByDisplay
        .listIterator(info.nodesUnfoldedByDisplay.size());
    while (oldPathIterator.hasPrevious()) {
      final String oldPathNodeID = oldPathIterator.previous();
      final NodeModel oldPathNode = map.getNodeForID(oldPathNodeID);
      if (oldPathNode != null && oldPathNode.equals(nodeOnPath)) {
        break;
      }
      oldPathIterator.remove();
      if (oldPathNode != null) {
        Controller.getCurrentModeController().getMapController().setFolded(oldPathNode, true);
View Full Code Here

    }
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    if(selection == null){
      return;
    }
    final NodeModel selected = selection.getSelected();

    final NodeModel next;
    try
    {
      filterEditor.setSearchingBusyCursor();
      next = filterController.findNext(selected, null, direction, condition);
    }
View Full Code Here

TOP

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

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.