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()));
}
}
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);
}
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));
}
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();
}
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);
}
Aggregations