Package org.freeplane.features.mode

Examples of org.freeplane.features.mode.Controller


    super("CutAction");
  }

  public void actionPerformed(final ActionEvent e) {
    final ModeController mMindMapController = Controller.getCurrentModeController();
    final Controller controller = Controller.getCurrentController();
    final NodeModel root = controller.getMap().getRootNode();
    if (controller.getSelection().isSelected(root)) {
      UITools.errorMessage(TextUtils.getText("cannot_delete_root"));
      return;
    }
    final int showResult = OptionalDontShowMeAgainDialog.show("really_cut_node", "confirmation",
        MClipboardController.RESOURCES_CUT_NODES_WITHOUT_QUESTION,
        OptionalDontShowMeAgainDialog.ONLY_OK_SELECTION_IS_STORED);
    if (showResult != JOptionPane.OK_OPTION) {
      return;
    }
    final MClipboardController clipboardController = (MClipboardController) mMindMapController
        .getExtension(ClipboardController.class);
    clipboardController.cut(controller.getSelection().getSortedSelection(true));
    controller.getMapViewManager().obtainFocusForSelected();
  }
View Full Code Here


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

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    if (assignAttributeDialog == null) {
      assignAttributeDialog = new AssignAttributeDialog(AttributeController.getController(),
          controller.getViewController().getFrame());
    }
    assignAttributeDialog.setVisible(true);
  }
View Full Code Here

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

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final Component initialMapView = controller.getMapViewManager().getMapViewComponent();
    final Map<String, MapModel> mapViews = getMapViews();
    final Iterator<Entry<String, MapModel>> iterator = mapViews.entrySet().iterator();
    while (iterator.hasNext()) {
      final Entry<String, MapModel> entry = iterator.next();
      controller.getMapViewManager().changeToMapView(entry.getKey());
      final ModeController modeController = controller.getModeController();
      if (modeController instanceof MModeController) {
        ((MModeController) modeController).save();
      }
    }
    if (initialMapView != null) {
      controller.getMapViewManager().changeToMapView(initialMapView);
    }
  }
View Full Code Here

   * (non-Javadoc)
   * @see
   * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(final ActionEvent ev) {
    Controller controller =Controller.getCurrentController();
    final MMapController mapController = (MMapController) controller.getModeController().getMapController();
    try {
      mapController.restoreCurrentMap();
    }
    catch (final Exception e) {
      LogUtils.severe(e);
View Full Code Here

  void redo() {
    if (!filters.hasNext()) {
      return;
    }
    Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final Filter next = filters.next();
    next.applyFilter(this, map, true);
  }
View Full Code Here

    final Filter next = filters.next();
    next.applyFilter(this, map, true);
  }

  void undo() {
    Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final Filter previous = filters.previous();
    undoImpl(map);
    while (previous != filters.next()) {
      ;
    }
View Full Code Here

  public void actionPerformed(final ActionEvent e) {
    final ModeController modeController = Controller.getCurrentModeController();
    ArrayList<IIconInformation> actions = new ArrayList<IIconInformation>();
   
    final Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final IconRegistry iconRegistry = map.getIconRegistry();
    final ListModel usedIcons = iconRegistry.getIconsAsListModel();
    for(int i = 0; i < usedIcons.getSize(); i++){
      final Object icon = usedIcons.getElementAt(i);
      if(icon instanceof MindIcon){
        actions.add(new IconAction((MindIcon) icon));
      }
    }

    final MIconController mIconController = (MIconController) IconController.getController();
    for (AFreeplaneAction aFreeplaneAction : mIconController.getIconActions())
      actions.add((IIconInformation) aFreeplaneAction);
   
    actions.add((IIconInformation) modeController.getAction("RemoveIcon_0_Action"));
    actions.add((IIconInformation) modeController.getAction("RemoveIconAction"));
    actions.add((IIconInformation) modeController.getAction("RemoveAllIconsAction"));

    final ViewController viewController = controller.getViewController();
    final IconSelectionPopupDialog selectionDialog = new IconSelectionPopupDialog(viewController.getJFrame(),
        actions);
    final NodeModel selected = controller.getSelection().getSelected();
    controller.getMapViewManager().scrollNodeToVisible(selected);
    selectionDialog.pack();
    UITools.setDialogLocationRelativeTo(selectionDialog, selected);
    selectionDialog.setModal(true);
    selectionDialog.show();
    final int result = selectionDialog.getResult();
View Full Code Here

  public static final String RESOURCES_DELETE_NODES_WITHOUT_QUESTION = "delete_nodes_without_question";
  private static final String PREF_MM2XML = "/xslt/mm2preferences.xsl";
  private UndoAction undo;

  static public MModeController getMModeController() {
    Controller controller = Controller.getCurrentController();
    return (MModeController) controller.getModeController(MODENAME);
  }
View Full Code Here

  }

  public void deHighlight() {
    if (originallySelectedNode == null)
      return;
    final Controller controller = Controller.getCurrentController();
    if (controller == null)
      return;
    final MapController mapController = controller.getModeController().getMapController();
    mapController.displayNode(originallySelectedNode);
    mapController.select(originallySelectedNode);
    foldOriginallyFolded(mapController);
    originallySelectedNode = null;
    pane.setToolTipText(null);
View Full Code Here

  }

  public void actionPerformed(final ActionEvent e) {
    if(UITools.isEditingText())
      return;
    final Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
    final MapController mapController = Controller.getCurrentModeController().getMapController();
    mapController.addNodeChangeListener(this);
    try{
      undoHandler.getUndoAction().actionPerformed(e);
    if(lastChangedNode != null){
      mapController.displayNode(lastChangedNode);
      controller.getSelection().selectAsTheOnlyOneSelected(lastChangedNode);
      lastChangedNode = null;
    }
    }
    finally{
      mapController.removeNodeChangeListener(this);
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.