Package org.freeplane.features.mode

Examples of org.freeplane.features.mode.Controller


  private ActionAcceleratorManager acceleratorManager;
  private final boolean useRibbonMenu;

  public UserInputListenerFactory(final ModeController modeController, boolean useRibbons) {
    useRibbonMenu = useRibbons;
    Controller controller = Controller.getCurrentController();
    mapsMenuActionListener = new MapsMenuActionListener(controller);
    menuBuilderList.put(MenuBuilder.class, new MenuBuilder(modeController, getAcceleratorManager()));
    menuBuilderList.put(RibbonBuilder.class, new RibbonBuilder(modeController, getAcceleratorManager()));
    controller.getMapViewManager().addMapSelectionListener(new IMapSelectionListener() {
      public void afterMapChange(final MapModel oldMap, final MapModel newMap) {
        if(modeController.equals(Controller.getCurrentModeController()))
          getMenuBuilder(MenuBuilder.class).afterMapChange(newMap);
      }
View Full Code Here


  }

  private void updateModeMenu() {
    if(!useRibbonMenu()) {
      getMenuBuilder(MenuBuilder.class).removeChildElements(FreeplaneMenuBar.MODES_MENU);
      Controller controller = Controller.getCurrentController();
      for (final String key : new LinkedList<String>(controller.getModes())) {
        final AFreeplaneAction modesMenuActionListener = new ModesMenuActionListener(key, controller);
        final ModeController modeController = controller.getModeController();
        final boolean isSelected;
        if (modeController != null) {
          isSelected = modeController.getModeName().equals(key);
        }
        else {
View Full Code Here

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

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class);
    final MapModel model = controller.getMap();
    mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, null);
  }
View Full Code Here

    }
    return false;
  }

  public void extendSelection(final MouseEvent e) {
    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);
View Full Code Here

    }
  }

  public void selectSingleNode(MouseEvent e) {
    final NodeView nodeV = getRelatedNodeView(e);
    final Controller controller = Controller.getCurrentController();
    if (!((MapView) controller.getMapViewManager().getMapViewComponent()).isSelected(nodeV)) {
      controller.getSelection().selectAsTheOnlyOneSelected(nodeV.getModel());
    }
  }
View Full Code Here

        public void run() {
          if (e.getModifiers() != 0) {
            return;
          }
          try {
            Controller controller = Controller.getCurrentController();
            if (!controller.getModeController().isBlocked() && controller.getSelection().size() <= 1) {
              final NodeView nodeV = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class,
                  e.getComponent());
              if (nodeV.isDisplayable() && nodeV.getModel().isVisible()) {
                nodeV.getMap().select();
                controller.getSelection().selectAsTheOnlyOneSelected(nodeV.getModel());
              }
            }
          }
          catch (NullPointerException e) {
          }
View Full Code Here

  }

  /**
   */
  private int getHGapChange(final Point dragNextPoint, final NodeModel node) {
    final Controller controller = Controller.getCurrentController();
    final MapView mapView = ((MapView) controller.getMapViewManager().getMapViewComponent());
    int hGapChange = (int) ((dragNextPoint.x - dragStartingPoint.x) / mapView.getZoom());
    if (node.isLeft()) {
      hGapChange = -hGapChange;
    }
    return hGapChange;
View Full Code Here

  }

  /**
   */
  private int getNodeShiftYChange(final Point dragNextPoint, final NodeModel node) {
    final Controller controller = Controller.getCurrentController();
    final MapView mapView = ((MapView) controller.getMapViewManager().getMapViewComponent());
    final int shiftYChange = (int) ((dragNextPoint.y - dragStartingPoint.y) / mapView.getZoom());
    return shiftYChange;
  }
View Full Code Here

  }

  /**
   */
  private int getVGapChange(final Point dragNextPoint, final NodeModel node) {
    final Controller controller = Controller.getCurrentController();
    final MapView mapView = ((MapView) controller.getMapViewManager().getMapViewComponent());
    final int vGapChange = (int) ((dragNextPoint.y - dragStartingPoint.y) / mapView.getZoom());
    return vGapChange;
  }
View Full Code Here

  public void mouseClicked(final MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2
        && doubleClickTimer.getDelay() > 0) {
      final MainView mainView = (MainView) e.getComponent();
      if (mainView.getMouseArea().equals(MouseArea.MOTION)) {
        final Controller controller = Controller.getCurrentController();
        MLocationController locationController = (MLocationController) LocationController
            .getController(controller.getModeController());
        if (e.getModifiersEx() == 0) {
          final NodeView nodeV = getNodeView(e);
          final NodeModel node = nodeV.getModel();
          locationController.moveNodePosition(node, LocationModel.getModel(node).getVGap(),
              LocationModel.HGAP, 0);
View Full Code Here

TOP

Related Classes of org.freeplane.features.mode.Controller

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.