Package org.freeplane.features.mode

Examples of org.freeplane.features.mode.ModeController


       automaticLayoutComboBoxModel.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
       mAutomaticLayoutComboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if(internalChange)
            return;
          final ModeController modeController = Controller.getCurrentModeController();
          AutomaticLayoutController al = modeController.getExtension(AutomaticLayoutController.class);
          NamedObject selectedItem = (NamedObject)mAutomaticLayoutComboBox.getSelectedItem();
          al.undoableDeactivateHook(Controller.getCurrentController().getMap().getRootNode());
          if(!selectedItem.equals(AUTOMATIC_LAYOUT_DISABLED)){
            al.undoableActivateHook(Controller.getCurrentController().getMap().getRootNode(), (AutomaticLayout) selectedItem.getObject());
          }
        }
      });
    }
      final String label = TextUtils.getText("AutomaticLayoutAction.text");
      rightBuilder.append(new JLabel(label), 5);
      rightBuilder.append(mAutomaticLayoutComboBox);
      rightBuilder.nextLine();
    }
    {
      if(mAutomaticEdgeColorCheckBox == null){
        mAutomaticEdgeColorCheckBox = new JCheckBox();
        mAutomaticEdgeColorCheckBox.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            final ModeController modeController = Controller.getCurrentModeController();
            AutomaticEdgeColorHook al = (AutomaticEdgeColorHook) modeController.getExtension(AutomaticEdgeColorHook.class);
            al.undoableToggleHook(Controller.getCurrentController().getMap().getRootNode());
          }
        });
      }
      final String label = TextUtils.getText("AutomaticEdgeColorHookAction.text");
View Full Code Here


        if (viewNodeFormat == null && node.getUserObject() instanceof IFormattedObject)
          viewNodeFormat = ((IFormattedObject)node.getUserObject()).getPattern();
        mNodeFormat.setValue(viewNodeFormat);
      }
      if(mAutomaticLayoutComboBox != null){
        final ModeController modeController = Controller.getCurrentModeController();
        AutomaticLayoutController al = modeController.getExtension(AutomaticLayoutController.class);
        IExtension extension = al.getExtension(node);
        if(extension == null)
          mAutomaticLayoutComboBox.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
        else
          mAutomaticLayoutComboBox.setSelectedIndex(((AutomaticLayout)extension).ordinal());
      }
      if(mAutomaticEdgeColorCheckBox != null){
        final ModeController modeController = Controller.getCurrentModeController();
        AutomaticEdgeColorHook al = (AutomaticEdgeColorHook) modeController.getExtension(AutomaticEdgeColorHook.class);
        mAutomaticEdgeColorCheckBox.setSelected(al.isActive(node));
      }
    }
    finally {
      internalChange = false;
View Full Code Here

    btn.setText(text);
    }

  private void addListeners() {
    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;
View Full Code Here

  public static final String SHOW_NOTE_ICONS = "show_note_icons";
  private static final Integer NODE_TOOLTIP = 9;
  public static final String SHOW_NOTES_IN_MAP = "show_notes_in_map";

  public static NoteController getController() {
    final ModeController modeController = Controller.getCurrentModeController();
    return getController(modeController);
  }
View Full Code Here

  public static NoteController getController(ModeController modeController) {
    return (NoteController) modeController.getExtension(NoteController.class);
    }
 
  public static void install( final NoteController noteController) {
    final ModeController modeController = Controller.getCurrentModeController();
    modeController.addExtension(NoteController.class, noteController);
    if (firstRun) {
      noteIcon = IconStoreFactory.create().getUIIcon("knotes.png");
      bwNoteIconUrl = ResourceController.getResourceController().getResource("/images/note_black_and_transp.png");
      firstRun = false;
    }
View Full Code Here

   final private ModeController modeController;

  public NoteController() {
    super();
    final ModeController modeController = Controller.getCurrentModeController();
    this.modeController = modeController;
    modeController.getMapController().getReadManager().addElementHandler("richcontent", new NoteBuilder(this));
    final NoteWriter noteWriter = new NoteWriter(this);
    final WriteManager writeManager = modeController.getMapController().getWriteManager();
    writeManager.addAttributeWriter("map", noteWriter);
    writeManager.addExtensionElementWriter(NoteModel.class, noteWriter);
    registerNoteTooltipProvider(modeController);
    registerStateIconProvider();
  }
View Full Code Here

      return null;
    }
    //ignore documentation maps loaded using documentation actions
    if(map.containsExtension(DocuMapAttribute.class))
      return null;
    final ModeController modeController = Controller.getCurrentModeController();
    if (!modeController.getModeName().equals(MModeController.MODENAME)) {
      return null;
    }
    final File file = map.getFile();
    return getRestorable(file);
  }
View Full Code Here

    updateMenus();
  }

  private void updateMenus() {
    Controller controller = Controller.getCurrentController();
    final ModeController modeController = controller.getModeController();
    if(!modeController.getUserInputListenerFactory().useRibbonMenu()) {
      final MenuBuilder menuBuilder = modeController.getUserInputListenerFactory().getMenuBuilder(MenuBuilder.class);
      menuBuilder.removeChildElements(MENU_CATEGORY);
      List<AFreeplaneAction> openMapActions = createOpenLastMapActionList();
      for(AFreeplaneAction openMapAction:openMapActions)
      {
        final IFreeplaneAction acceleratableAction = menuBuilder.acceleratableAction(openMapAction);
View Full Code Here

    }
  }

  public List<AFreeplaneAction> createOpenLastMapActionList() {
    Controller controller = Controller.getCurrentController();
    final ModeController modeController = controller.getModeController();
      int i = 0;
      int maxEntries = getMaxMenuEntries();
      List<AFreeplaneAction> openMapActions = new ArrayList<AFreeplaneAction>(maxEntries);
      for (final String key : lastOpenedList) {
        if (i == 0
                && (!modeController.getModeName().equals(MModeController.MODENAME) || controller.getMap() == null || controller
                    .getMap().getURL() == null)) {
          i++;
          maxEntries++;
        }
        if (i == maxEntries) {
View Full Code Here

    this.modeController = null;
    return controller;
  }

  public static void install() {
    ModeController modeController = Controller.getCurrentModeController();
    modeController.addAction(new EditStylesAction());
  }
View Full Code Here

TOP

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

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.