Package org.freeplane.features.map

Examples of org.freeplane.features.map.IMapSelection


    public void updateMenus(final ModeController modeController, final MenuBuilder builder) {
      if(builder.contains(key)) {
        builder.addPopupMenuListener((DefaultMutableTreeNode)builder.get(key).getParent(), new PopupMenuListener(
                  ) {
                  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)){
View Full Code Here


                    return;
                focusOwner.requestFocus();
                if (Boolean.TRUE.equals(component.getClientProperty(CANCEL))) {
                    return;
                }
                final IMapSelection selection = Controller.getCurrentController().getSelection();
        if (selection == null || selection.getSelected() == null)
                    return;
                    setSourceLabel(link, sourceLabelEditor.getText());
                    setTargetLabel(link, targetLabelEditor.getText());
                setMiddleLabel(link, middleLabelEditor.getText());
                setAlpha(link, transparencySlider.getValue());
View Full Code Here

  public AddLocalLinkAction() {
    super("AddLocalLinkAction");
  }

  public void actionPerformed(final ActionEvent e) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final List<NodeModel> selecteds = selection.getOrderedSelection();
    final int size = selecteds.size();
    if (size < 2) {
      Controller.getCurrentController();
      UITools.errorMessage(TextUtils.getText("less_than_two_selected_nodes"));
      return;
View Full Code Here

  public void actionPerformed(final ActionEvent e) {
    final ASelectableCondition condition = filterEditor.getCondition();
    if(condition == null){
      return;
    }
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final MapController mapController = Controller.getCurrentModeController().getMapController();
    final NodeModel selected = selection.getSelected();
        final NodeModel rootNode = selected.getMap().getRootNode();
    boolean nodeFound = condition.checkNode(rootNode);
    if(nodeFound){
      selection.selectAsTheOnlyOneSelected(rootNode);
    }
    NodeModel next = rootNode;
    for(;;){
      next = filterController.findNext(next, rootNode, Direction.FORWARD, condition);
      if(next == null){
        break;
      }
      mapController.displayNode(next);
      if(nodeFound){
        selection.toggleSelected(next);
      }
      else{
        selection.selectAsTheOnlyOneSelected(next);
        nodeFound = true;
      }
    }
    if(condition.checkNode(selected))
        selection.makeTheSelected(selected);
  }
View Full Code Here

    applet.setWaitingCursor(waiting);
  }

  public void start() {
    try {
      final IMapSelection selection = getController().getSelection();
      if (selection != null) {
        selection.selectRoot();
      }
      else {
        System.err.println("View is null.");
      }
    }
View Full Code Here

    controller.setStyle(node, style);
  }

  @Override
  public void setSelected() {
    IMapSelection selection = Controller.getCurrentController().getSelection();
    if(selection != null){
      NodeModel node= selection.getSelected();
      final IStyle style = LogicalStyleModel.getStyle(node);
      setSelected(this.style == style || this.style != null && this.style.equals(style));
    }
    else
      setSelected(false);
View Full Code Here

      else {
        assert evt.getSource().equals(mProperty);
        enabled = true;
        mSet.setValue(true);
      }
      final IMapSelection selection = Controller.getCurrentController().getSelection();
      final Collection<NodeModel> nodes = selection.getSelection();
      if (enabled )
        internalChange = true;
      for (final NodeModel node : nodes) {
        applyValue(enabled, node, evt);
      }
      internalChange = false;
      setStyle(selection.getSelected());
    }
View Full Code Here

            Controller.getCurrentController().getSelection().selectBranch(nodeModel, false);
        }
    }

  public void selectMultipleNodes(final Collection<Node> toSelect) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final Iterator<Node> it = toSelect.iterator();
    if (!it.hasNext()) {
      return;
    }
    selection.selectAsTheOnlyOneSelected(((NodeProxy) it.next()).getDelegate());
    while (it.hasNext()) {
      final NodeModel nodeModel = ((NodeProxy) it.next()).getDelegate();
      Controller.getCurrentController().getSelection().toggleSelected(nodeModel);
    }
  }
View Full Code Here

  @Override
  protected void onWrite(final MapModel map) {
    final ModeController modeController = Controller.getCurrentModeController();
    final Controller controller = modeController.getController();
    final IMapSelection selection = controller.getSelection();
    if (selection == null) {
      return;
    }
    final NodeModel selected = selection.getSelected();
    noteManager.saveNote(selected);
  }
View Full Code Here

    super();
//    this.controller = controller;
  }

  public boolean checkNode(final NodeModel node) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    return selection != null && selection.isSelected(node);
  }
View Full Code Here

TOP

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

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.