Search in sources :

Example 86 with Controller

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

the class CutAction method actionPerformed.

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();
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ClipboardController(org.freeplane.features.clipboard.ClipboardController) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) ClipboardController(org.freeplane.features.clipboard.ClipboardController) ModeController(org.freeplane.features.mode.ModeController)

Example 87 with Controller

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

the class ClipboardController method createActions.

/**
 */
private void createActions() {
    final Controller controller = Controller.getCurrentController();
    ModeController modeController = controller.getModeController();
    modeController.addAction(new CopyAction());
    modeController.addAction(new CopySingleAction());
    modeController.addAction(new CopyIDAction());
    modeController.addAction(new CopyNodeURIAction());
}
Also used : ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) TextController(org.freeplane.features.text.TextController) ModeController(org.freeplane.features.mode.ModeController)

Example 88 with Controller

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

the class CopyIDAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final Collection<NodeModel> selectedNodes = controller.getSelection().getSelection();
    StringBuilder sb = null;
    for (final NodeModel node : selectedNodes) {
        if (sb == null) {
            sb = new StringBuilder();
        } else {
            sb.append(", ");
        }
        sb.append(node.createID());
    }
    final String idString = sb.toString();
    final ClipboardController clipboardController = (ClipboardController) Controller.getCurrentModeController().getExtension(ClipboardController.class);
    clipboardController.setClipboardContents(new StringSelection(idString));
    controller.getViewController().out(idString);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) Controller(org.freeplane.features.mode.Controller) StringSelection(java.awt.datatransfer.StringSelection)

Example 89 with Controller

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

the class CopySingleAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final Collection<NodeModel> selection = controller.getSelection().getSelection();
    final ModeController modeController = Controller.getCurrentModeController();
    final Transferable copy = ((ClipboardController) modeController.getExtension(ClipboardController.class)).copySingle(selection);
    if (copy != null) {
        ((ClipboardController) modeController.getExtension(ClipboardController.class)).setClipboardContents(copy);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) Transferable(java.awt.datatransfer.Transferable) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 90 with Controller

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

the class ExportAction method export.

private void export(final MapModel model) {
    final Controller controller = Controller.getCurrentController();
    exp.export(controller.getViewController().getFrame(), model);
}
Also used : Controller(org.freeplane.features.mode.Controller)

Aggregations

Controller (org.freeplane.features.mode.Controller)152 ModeController (org.freeplane.features.mode.ModeController)92 ResourceController (org.freeplane.core.resources.ResourceController)69 NodeModel (org.freeplane.features.map.NodeModel)46 MapController (org.freeplane.features.map.MapController)41 MapModel (org.freeplane.features.map.MapModel)34 LinkController (org.freeplane.features.link.LinkController)32 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)32 TextController (org.freeplane.features.text.TextController)27 MMapController (org.freeplane.features.map.mindmapmode.MMapController)24 ViewController (org.freeplane.features.ui.ViewController)23 IconController (org.freeplane.features.icon.IconController)22 Component (java.awt.Component)19 FilterController (org.freeplane.features.filter.FilterController)17 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)17 FormatController (org.freeplane.features.format.FormatController)16 ScannerController (org.freeplane.features.format.ScannerController)16 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)15 File (java.io.File)14 MTextController (org.freeplane.features.text.mindmapmode.MTextController)14