Package org.freeplane.features.map

Examples of org.freeplane.features.map.IMapSelection


  public void actionPerformed(ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final MNoteController noteController = (MNoteController) NoteController.getController();
    noteController.setShowNotesInMap(map, ! NoteController.getController().showNotesInMap(map));
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    selection.keepNodePosition(selection.getSelected(), 0.0f, 0.0f);
    setSelected();
  }
View Full Code Here


    final Object source = e.getSource();
    if(! (source instanceof MapView))
      return;
    final MapView map = (MapView) source;
    final Controller controller = map.getModeController().getController();
    final IMapSelection selection = controller.getSelection();
    if(selection != null){
      final NodeModel selected = selection.getSelected();
      if(selected != null)
        controller.getMapViewManager().getComponent(selected).requestFocusInWindow();
    }
  }
View Full Code Here

    final Controller controller = Controller.getCurrentController();
    final NodeView nodeView = getRelatedNodeView(e);
    final NodeModel newlySelectedNode = nodeView.getModel();
    final boolean extend = Compat.isMacOsX() ? e.isMetaDown() : e.isControlDown();
    final boolean range = e.isShiftDown();
    final IMapSelection selection = controller.getSelection();
    if (range && !extend) {
      selection.selectContinuous(newlySelectedNode);
    }
    else if (extend && !range) {
      selection.toggleSelected(newlySelectedNode);
    }
    if (extend == range) {
      if (selection.isSelected(newlySelectedNode) && selection.size() == 1
              && FocusManager.getCurrentManager().getFocusOwner() instanceof MainView)
        return;
      else {
        selection.selectAsTheOnlyOneSelected(newlySelectedNode);
      }
      e.consume();
    }
  }
View Full Code Here

    if (nodeView == null)
      return;
    final NodeModel model = nodeView.getModel();
      TextController controller = TextController.getController();
    if (eventFromHideDisplayArea(e)){
      final IMapSelection selection = Controller.getCurrentController().getSelection();
      selection.keepNodePosition(model, 0.0f, 0.0f);
        controller.setDetailsHidden(model, ! DetailTextModel.getDetailText(model).isHidden());
    }
    else {
      nodeSelector.extendSelection(e);
      if (canEdit(controller) && isEditingStartEvent(e)) {
View Full Code Here

    final Controller controller = Controller.getCurrentController();
    final ModeController modeController = Controller.getCurrentModeController();
    final MapController mapController = modeController.getMapController();
    mapController.addNodeSelectionListener(new INodeSelectionListener() {
      public void onSelect(final NodeModel node) {
        final IMapSelection selection = controller.getSelection();
        if (selection == null) {
          return;
        }
        if (selection.size() == 1) {
          setStyle(node);
        }
      }

      public void onDeselect(final NodeModel node) {
      }
    });
    mapController.addNodeChangeListener(new INodeChangeListener() {
      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

  public FindAction() {
    super(KEY);
  }

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

    }
View Full Code Here

  {
    final ASelectableCondition condition = filterEditor.getCondition();
    if(condition == null){
      return;
    }
    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);
    }
    finally
    {
      filterEditor.setSearchingDefaultCursor();
    }

    if(next != null){
      final MapController mapController = Controller.getCurrentModeController().getMapController();
      mapController.displayNode(next);
      selection.selectAsTheOnlyOneSelected(next);
      if (reFocusSearchInputField)
      {
        // this is called by Enter key listener in FilterConditionEditor
        // => we want to re-focus the search term input field so that one can hit enter
        // again to find the next search result!
View Full Code Here

    mSplitPane.setLeftComponent(null);
    mSplitPane.setRightComponent(null);
    mSplitPane.setLeftComponent(mapPane);
    setSplitPaneLayoutManager();
    final Controller controller = Controller.getCurrentModeController().getController();
    final IMapSelection selection = controller.getSelection();
    if(selection == null){
      return;
    }
    final NodeModel node = selection.getSelected();
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        final Component component = controller.getMapViewManager().getComponent(node);
        if (component != null) {
          component.requestFocus();
View Full Code Here

    final SModeController modeController = this.modeController;
    final StyleEditorPanel styleEditorPanel = new StyleEditorPanel(modeController, null, false);
    final MapController mapController = modeController.getMapController();
    mapController.addNodeSelectionListener(new INodeSelectionListener() {
      public void onSelect(final NodeModel node) {
        final IMapSelection selection = controller.getSelection();
        if (selection == null) {
          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);
          }
        });
      }

View Full Code Here

    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();
                    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();
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.