Package org.freeplane.features.map

Examples of org.freeplane.features.map.NodeModel


        return;
      }
      if (!event.getProperty().equals(LogicalStyleModel.class)) {
        return;
      }
      final NodeModel node = event.getNode();
      final MapModel map = node.getMap();
      final IStyle styleKey = (IStyle) event.getNewValue();
      final MapStyleModel mapStyles = MapStyleModel.getExtension(map);
      final NodeModel styleNode = mapStyles.getStyleNode(styleKey);
      if (styleNode == null) {
        return;
      }
      modeController.undoableRemoveExtensions(LogicalStyleKeys.NODE_STYLE, node, styleNode);
    }
View Full Code Here


          return;
        }
        if (selection.size() == 1 && node.depth() >= 2) {
          return;
        }
        final NodeModel nextSelection;
        if (node.depth() < 2) {
          if (node.depth() == 1 && node.hasChildren()) {
            nextSelection = (NodeModel) node.getChildAt(0);
          }
          else {
            nextSelection = (NodeModel) (node.getMap().getRootNode().getChildAt(0).getChildAt(0));
          }
        }
        else {
          nextSelection = node;
        }
        EventQueue.invokeLater(new Runnable() {
          public void run() {
            selection.selectAsTheOnlyOneSelected(nextSelection);
          }
        });
      }


      public void onDeselect(final NodeModel node) {
      }
    });

    mapController.addNodeChangeListener(new INodeChangeListener() {
      public void nodeChanged(NodeChangeEvent event) {
        final NodeModel node = event.getNode();
        if(node.getUserObject().equals(MapStyleModel.DEFAULT_STYLE)){
          mapController.fireMapChanged(new MapChangeEvent(this, node.getMap(), MapStyle.MAP_STYLES, null, null));
        }
      }
    });

View Full Code Here

                  ) {
                  public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
                    final IMapSelection selection = modeController.getController().getSelection();
                    if(selection == null)
                      return;
              final NodeModel node = selection.getSelected();
                    Set<NodeLinkModel> links = new LinkedHashSet<NodeLinkModel>( NodeLinks.getLinks(node));
                    links.addAll(getLinksTo(node));
                    boolean firstAction = true;
                    for(NodeLinkModel link : links){
                      final String targetID = link.getTargetID();
                      final NodeModel target;
                      if(node.getID().equals(targetID)){
                        if(link instanceof ConnectorModel){
                          ConnectorModel cm = (ConnectorModel) link;
                          target = cm.getSource();
                          if(node.equals(target))
View Full Code Here

                  ) {
                  public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
                    final IMapSelection selection = modeController.getController().getSelection();
                    if(selection == null)
                      return;
              final NodeModel node = selection.getSelected();
                    boolean firstAction = true;
                    NodeModel parentNode = node.getParentNode();
              if(parentNode != null){
                      for(NodeModel clone : node.clones()){
                  if(!clone.equals(node)){
                          final GotoLinkNodeAction gotoLinkNodeAction = new GotoLinkNodeAction(LinkController.this, clone);
                          NodeModel subtreeRootParentNode = clone.getSubtreeRoot().getParentNode();
                    gotoLinkNodeAction.configureText("follow_clone", subtreeRootParentNode);
                          gotoLinkNodeAction.putValue(Action.SMALL_ICON, CloneStateIconSupplier.CLONEROOT_ICON.getIcon());
                          if(firstAction){
                            builder.addSeparator(key, MenuBuilder.AS_CHILD);
                            firstAction = false;
View Full Code Here

    super(map, scriptContext);
  }

  // MapRO: R
  public Node node(final String id) {
    final NodeModel node = getDelegate().getNodeForID(id);
    return node != null ? new NodeProxy(node, getScriptContext()) : null;
  }
View Full Code Here

    return node != null ? new NodeProxy(node, getScriptContext()) : null;
  }

  // MapRO: R
  public Node getRoot() {
    final NodeModel rootNode = getDelegate().getRootNode();
    return new NodeProxy(rootNode, getScriptContext());
  }
View Full Code Here

      fileSavedDateTime = TextUtils.getText("FileProperties_NeverSaved");
      fileSize = TextUtils.getText("FileProperties_NeverSaved");
      fileChangesSinceSave = 0;
    }
    //node statistics
    final NodeModel rootNode = map.getRootNode();
        final int nodeMainBranches = rootNode.getChildCount();
    final ICondition trueCondition = new ICondition() {
        public boolean checkNode(NodeModel node) {
            return true;
        }
    };
View Full Code Here

    final Enumeration<NodeModel> children = node.children();
    if (condition.checkNode(node)) {
        result++;
    }
    while (children.hasMoreElements()) {
      final NodeModel child = children.nextElement();
      result += getNodeCount(child, condition);
    }
    return result;
  }
View Full Code Here

      return new AbstractList<Proxy.Node>() {
        final private List<NodeModel> nodeModels = list;
   
        @Override
        public Proxy.Node get(final int index) {
          final NodeModel nodeModel = nodeModels.get(index);
          return new NodeProxy(nodeModel, scriptContext);
        }
   
        @Override
        public int size() {
View Full Code Here

      return;
    }
    final IActor actor = new IActor() {
      public void act() {
        arrowLink.setColor(color);
        final NodeModel node = arrowLink.getSource();
        fireNodeConnectorChange(node, arrowLink);
      }

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

      public void undo() {
        arrowLink.setColor(oldColor);
        final NodeModel node = arrowLink.getSource();
        fireNodeConnectorChange(node, arrowLink);
      }
    };
    Controller.getCurrentModeController().execute(actor, arrowLink.getSource().getMap());
  }
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.