use of org.freeplane.features.mode.Controller 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.Controller in project freeplane by freeplane.
the class HelpController method install.
public static void install() {
Controller controller = Controller.getCurrentController();
controller.addExtension(HelpController.class, new HelpController());
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class PresentationPngExporter method exportSlide.
private void exportSlide(File presentationDirectory, Slide slide) {
final NodeModel placedNode = slide.getCurrentPlacedNode();
if (placedNode != null)
slide.apply(presentationZoomFactor);
else
slide.apply(1f);
mapViewComponent.validate();
mapViewComponent.setSize(mapViewComponent.getPreferredSize());
File exportFile = new File(presentationDirectory, FileUtils.validFileNameOf(slide.getName()) + ".png");
final ExportToImage exporter = ExportToImage.toPNG();
final Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
if (placedNode != null) {
final Dimension slideSize;
if (ResourceController.getResourceController().getBooleanProperty(SWITCH_TO_FULL_SCREEN_PROPERTY))
slideSize = mapViewComponent.getGraphicsConfiguration().getBounds().getSize();
else
slideSize = SwingUtilities.getWindowAncestor(mapViewComponent).getSize();
exporter.export(map, slideSize, placedNode, slide.getPlacedNodePosition(), exportFile);
} else
exporter.export(map, exportFile);
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class MNoteController method onWrite.
@Override
protected void onWrite(final MapModel map) {
final ModeController modeController = Controller.getCurrentModeController();
final Controller controller = modeController.getController();
final IMapSelection selection = controller.getSelection();
if (selection == null) {
return;
}
final NodeModel selected = selection.getSelected();
noteManager.saveNote(selected);
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class FModeController method startup.
@Override
public void startup() {
final Controller controller = getController();
controller.getMapViewManager().changeToMode(MODENAME);
if (controller.getMap() == null) {
((FMapController) getMapController()).newMap(File.listRoots());
}
super.startup();
}
Aggregations