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