Search in sources :

Example 11 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class IconSelectionPlugin method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final ModeController modeController = Controller.getCurrentModeController();
    ArrayList<IIconInformation> actions = new ArrayList<IIconInformation>();
    final Controller controller = Controller.getCurrentController();
    actions.add((IIconInformation) modeController.getAction("RemoveIcon_0_Action"));
    actions.add((IIconInformation) modeController.getAction("RemoveIconAction"));
    actions.add((IIconInformation) modeController.getAction("RemoveAllIconsAction"));
    final MIconController mIconController = (MIconController) IconController.getController();
    for (AFreeplaneAction aFreeplaneAction : mIconController.getIconActions()) actions.add((IIconInformation) aFreeplaneAction);
    final IconSelectionPopupDialog selectionDialog = new IconSelectionPopupDialog(UITools.getCurrentFrame(), 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();
    if (result >= 0) {
        final Action action = (Action) actions.get(result);
        action.actionPerformed(new ActionEvent(action, 0, NodeModel.NODE_ICON, selectionDialog.getModifiers()));
    }
}
Also used : AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) NodeModel(org.freeplane.features.map.NodeModel) Action(javax.swing.Action) AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) ActionEvent(java.awt.event.ActionEvent) ArrayList(java.util.ArrayList) IIconInformation(org.freeplane.features.icon.IIconInformation) ModeController(org.freeplane.features.mode.ModeController) IconSelectionPopupDialog(org.freeplane.core.ui.components.IconSelectionPopupDialog) IconController(org.freeplane.features.icon.IconController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 12 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class LinkController method loadURL.

public void loadURL(final MouseEvent e) {
    ModeController modeController = Controller.getCurrentModeController();
    loadURL(modeController.getMapController().getSelectedNode(), e);
}
Also used : ModeController(org.freeplane.features.mode.ModeController)

Example 13 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class LinkController method createActions.

/**
 */
private void createActions() {
    final ModeController modeController = Controller.getCurrentModeController();
    modeController.addAction(new FollowLinkAction());
    modeController.addUiBuilder(Phase.ACTIONS, "clone_actions", new ClonesMenuBuilder(modeController), new ChildActionEntryRemover(modeController));
    modeController.addUiBuilder(Phase.ACTIONS, "link_actions", new LinkMenuBuilder(modeController), new ChildActionEntryRemover(modeController));
}
Also used : ChildActionEntryRemover(org.freeplane.core.ui.menubuilders.generic.ChildActionEntryRemover) ModeController(org.freeplane.features.mode.ModeController)

Example 14 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class LinkController method install.

public static void install(final LinkController linkController) {
    final ModeController modeController = Controller.getCurrentModeController();
    modeController.addExtension(LinkController.class, linkController);
    linkController.init();
}
Also used : ModeController(org.freeplane.features.mode.ModeController)

Example 15 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class FollowLinkAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final ModeController modeController = Controller.getCurrentModeController();
    final MapController mapController = modeController.getMapController();
    LinkController linkController = LinkController.getController();
    NodeModel selNode = mapController.getSelectedNode();
    linkController.loadURL(selNode, e);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ModeController(org.freeplane.features.mode.ModeController) MapController(org.freeplane.features.map.MapController)

Aggregations

ModeController (org.freeplane.features.mode.ModeController)185 NodeModel (org.freeplane.features.map.NodeModel)80 Controller (org.freeplane.features.mode.Controller)43 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)36 MapController (org.freeplane.features.map.MapController)31 MapModel (org.freeplane.features.map.MapModel)30 IActor (org.freeplane.core.undo.IActor)28 ResourceController (org.freeplane.core.resources.ResourceController)21 MMapController (org.freeplane.features.map.mindmapmode.MMapController)21 Point (java.awt.Point)16 TextController (org.freeplane.features.text.TextController)16 Component (java.awt.Component)13 MapView (org.freeplane.view.swing.map.MapView)13 LinkController (org.freeplane.features.link.LinkController)12 NodeView (org.freeplane.view.swing.map.NodeView)12 Color (java.awt.Color)11 File (java.io.File)11 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)11 IMapSelection (org.freeplane.features.map.IMapSelection)10 ViewController (org.freeplane.features.ui.ViewController)10