Search in sources :

Example 36 with Controller

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

the class SetLinkAnchorAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    /**
     * @TODO
     *
     * -# implement GUID as reliable nodeID
     * -# correct tickmark handling in menu (BUG)
     * -# set tooltip for mouse-over SetLinkAnchorAction in menu
     */
    // get reference to selected node
    final Controller controller = Controller.getCurrentController();
    final NodeModel node = controller.getSelection().getSelected();
    // get file path of selected node
    File mindmapFile = node.getMap().getFile();
    if (mindmapFile == null) {
        UITools.errorMessage(TextUtils.getRawText("map_not_saved"));
        return;
    }
    // set idString variable according to file and node info
    final String idString = mindmapFile.toURI().toString() + '#' + node.createID();
    // save idString in LinkController
    ((MLinkController) (LinkController.getController())).setAnchorID(idString);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) Controller(org.freeplane.features.mode.Controller) LinkController(org.freeplane.features.link.LinkController) File(java.io.File)

Example 37 with Controller

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

the class FoldingController method handleMouseWheelEvent.

public boolean handleMouseWheelEvent(final MouseWheelEvent e) {
    if ((e.getModifiers() & InputEvent.ALT_MASK) != 0) {
        Controller controller = Controller.getCurrentController();
        final IMapSelection selection = controller.getSelection();
        final NodeModel node = selection.getSelected();
        if (e.getWheelRotation() > 0) {
            unfoldOneStage(node);
        } else {
            foldOneStage(node);
        }
        return true;
    }
    return false;
}
Also used : Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 38 with Controller

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

the class ShowNextChildAction method setEnabled.

@Override
public void setEnabled() {
    final Controller controller = Controller.getCurrentController();
    if (controller.getSelection() != null) {
        final NodeModel selected = controller.getSelection().getSelected();
        final MapController mapController = controller.getModeController().getMapController();
        final IMapViewManager mapViewManager = controller.getMapViewManager();
        super.setEnabled(mapViewManager.isFoldedOnCurrentView(selected) || mapViewManager.hasHiddenChildren(selected));
    } else {
        super.setEnabled(false);
    }
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) Controller(org.freeplane.features.mode.Controller)

Example 39 with Controller

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

the class ShowNextChildAction method actionPerformed.

public void actionPerformed(ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final NodeModel selected = controller.getSelection().getSelected();
    final MapController mapController = controller.getModeController().getMapController();
    mapController.showNextChild(selected);
}
Also used : Controller(org.freeplane.features.mode.Controller)

Example 40 with Controller

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

the class SetBooleanMapPropertyAction method setEnabled.

public void setEnabled() {
    final Controller controller = Controller.getCurrentController();
    setEnabled(controller.getSelection() != null);
}
Also used : Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

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