Search in sources :

Example 6 with Controller

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

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());
}
Also used : ResourceController(org.freeplane.core.resources.ResourceController) Controller(org.freeplane.features.mode.Controller)

Example 8 with Controller

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ExportToImage(org.freeplane.features.export.mindmapmode.ExportToImage) MapModel(org.freeplane.features.map.MapModel) Dimension(java.awt.Dimension) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) ResourceController(org.freeplane.core.resources.ResourceController) File(java.io.File)

Example 9 with Controller

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection) ModeController(org.freeplane.features.mode.ModeController) NoteController(org.freeplane.features.note.NoteController) MTextController(org.freeplane.features.text.mindmapmode.MTextController) ResourceController(org.freeplane.core.resources.ResourceController) LinkController(org.freeplane.features.link.LinkController) MapController(org.freeplane.features.map.MapController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) SpellCheckerController(org.freeplane.features.spellchecker.mindmapmode.SpellCheckerController)

Example 10 with Controller

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

Aggregations

Controller (org.freeplane.features.mode.Controller)135 ModeController (org.freeplane.features.mode.ModeController)78 ResourceController (org.freeplane.core.resources.ResourceController)63 NodeModel (org.freeplane.features.map.NodeModel)44 MapController (org.freeplane.features.map.MapController)37 LinkController (org.freeplane.features.link.LinkController)32 MapModel (org.freeplane.features.map.MapModel)31 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)30 MMapController (org.freeplane.features.map.mindmapmode.MMapController)27 TextController (org.freeplane.features.text.TextController)24 ViewController (org.freeplane.features.ui.ViewController)22 IconController (org.freeplane.features.icon.IconController)20 Component (java.awt.Component)18 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)18 FilterController (org.freeplane.features.filter.FilterController)16 FormatController (org.freeplane.features.format.FormatController)15 ScannerController (org.freeplane.features.format.ScannerController)15 IMapSelection (org.freeplane.features.map.IMapSelection)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)14 IMapViewManager (org.freeplane.features.ui.IMapViewManager)14