Package org.freeplane.features.map

Examples of org.freeplane.features.map.IMapSelection


     styles.setSelectedItem(logicalStyleController.getFirstStyle(node));
        ignoreChangeEvent = false;
  }

  public void nodeChanged(final NodeChangeEvent event) {
    IMapSelection selection = Controller.getCurrentController().getSelection();
    if(selection != null) {
      if (event.getNode() != selection.getSelected()) {
        return;
      }
    }
    changeToolbar(event.getNode());
  }
View Full Code Here


  private OptionalDontShowMeAgainDialog( final String pMessageId, final String pTitleId,
                                        final String pPropertyName, final int pMessageType) {
//    this.controller = controller;
    Controller controller = Controller.getCurrentController();
    mParent = controller.getViewController().getFrame();
    final IMapSelection selection = controller.getSelection();
    if (selection != null) {
      mNode = selection.getSelected();
    }
    else {
      mNode = null;
    }
    mMessageId = pMessageId;
View Full Code Here

        resetFilter(root);
        if (filterChildren(root, checkNode(root), false)) {
          addFilterResult(root, FilterInfo.FILTER_SHOW_ANCESTOR);
        }
      }
      final IMapSelection selection = Controller.getCurrentController().getSelection();
      final NodeModel selected = selection.getSelected();
      final NodeModel selectedVisible = selected.getVisibleAncestorOrSelf();
      selection.keepNodePosition(selectedVisible, 0.5f, 0.5f);
      refreshMap(source, map);
      selectVisibleNode();
    }
    finally {
      Controller.getCurrentController().getViewController().setWaitingCursor(false);
View Full Code Here

  private void resetFilter(final NodeModel node) {
    node.getFilterInfo().reset();
  }

  private void selectVisibleNode() {
    final IMapSelection mapSelection = Controller.getCurrentController().getSelection();
    final Collection<NodeModel> selectedNodes = mapSelection.getSelection();
    final NodeModel[] array = new NodeModel[selectedNodes.size()];
    boolean next = false;
    for(NodeModel node : selectedNodes.toArray(array)){
      if(next){
        if (!node.isVisible()) {
          mapSelection.toggleSelected(node);
        }
      }
      else
        next = true;
    }
    NodeModel selected = mapSelection.getSelected();
    if (!selected.isVisible()) {
      if(mapSelection.getSelection().size() > 1){
        mapSelection.toggleSelected(selected);
      }
      else
        mapSelection.selectAsTheOnlyOneSelected(selected.getVisibleAncestorOrSelf());
    }
    mapSelection.setSiblingMaxLevel(mapSelection.getSelected().getNodeLevel(false));
  }
View Full Code Here

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

  public void actionPerformed(final ActionEvent e) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final List<NodeModel> selecteds = selection.getOrderedSelection();
    final int size = selecteds.size();
    final MLinkController linkController = (MLinkController) LinkController.getController();
    final NodeModel target = selecteds.get(size-1);
    if (selecteds.size() < 2) {
      linkController.addConnector(target, target);
View Full Code Here

    super("SelectBranchAction");
  }

  @Override
    protected void actionPerformed(ActionEvent e, NodeModel node) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    selection.selectBranch(node, true);
    }
View Full Code Here

    };
    Controller.getCurrentModeController().getMapController().addNodeSelectionListener(listener);
  }

  private void addLinks(final JComponent arrowLinkPopup, final NodeModel source) {
    final IMapSelection selection = Controller.getCurrentModeController().getController().getSelection();
    if (!selection.isSelected(source)) {
      GotoLinkNodeAction gotoLinkNodeAction = new GotoLinkNodeAction(this, source);
      gotoLinkNodeAction.configureText("follow_graphical_link", source);
      addAction(arrowLinkPopup, gotoLinkNodeAction);
    }
  }
View Full Code Here

    }

  public void addNewSummaryNodeStartEditing(final int summaryLevel, final int start, final int end){
    stopEditing();
    ModeController modeController = getMModeController();
    final IMapSelection selection = modeController.getController().getSelection();
    NodeModel selected = selection.getSelected();
    final NodeModel parentNode = selected.getParentNode();
    final boolean isLeft = selected.isLeft();
    final NodeModel newNode = addNewNode(parentNode, end+1, isLeft);
    final SummaryNode summary = modeController.getExtension(SummaryNode.class);
    summary.undoableActivateHook(newNode, summary);
View Full Code Here

            }
            for (final Integer position : range) {
                final NodeModel node = sortedChildren.get(position.intValue());
                moveSingleNodeInGivenDirection(node, direction);
            }
            final IMapSelection selection = Controller.getCurrentController().getSelection();
            selection.selectAsTheOnlyOneSelected(selected);
      for (NodeModel selectedNode : selectedNodes) {
        selection.makeTheSelected(selectedNode);
            }
        }
    }
View Full Code Here

  @Override
  public void actionPerformed(final ActionEvent e) {
    Controller.getCurrentController().getViewController().setWaitingCursor(true);
    try {
      final List<NodeModel> nodes = new ArrayList<NodeModel>();
      final IMapSelection selection = Controller.getCurrentController().getSelection();
            if (mode == ExecutionMode.ON_SINGLE_NODE) {
        nodes.add(selection.getSelected());
      }
      else {
        nodes.addAll(selection.getSelection());
      }
      final MModeController modeController = (MModeController) Controller.getCurrentModeController();
      modeController.startTransaction();
      for (final NodeModel node : nodes) {
        try {
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.