Search in sources :

Example 16 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class EditDetailsAction method actionPerformed.

/*
	 * (non-Javadoc)
	 * @see
	 * freeplane.controller.actions.ActorXml#act(freeplane.controller.actions.
	 * generated.instance.XmlAction)
	 */
public void actionPerformed(final ActionEvent arg0) {
    final Controller controller = Controller.getCurrentController();
    final NodeModel nodeModel = controller.getSelection().getSelected();
    final IMapViewManager viewController = controller.getMapViewManager();
    final Component node = viewController.getComponent(nodeModel);
    node.requestFocus();
    final MTextController textController = (MTextController) MTextController.getController();
    textController.editDetails(nodeModel, null, useDialog);
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) NodeModel(org.freeplane.features.map.NodeModel) Controller(org.freeplane.features.mode.Controller) Component(java.awt.Component)

Example 17 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class BToolbarContributor method afterViewChange.

public void afterViewChange(final Component oldView, final Component newView) {
    if (newView == null) {
        return;
    }
    final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
    mapViewManager.getModeController(newView);
    final MapModel map = mapViewManager.getModel(newView);
    final URL url = map.getURL();
    if (url == null) {
        return;
    }
    setURLField(url.toString());
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) MapModel(org.freeplane.features.map.MapModel) URL(java.net.URL)

Example 18 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class ControllerProxy method newMap.

public Map newMap(URL url) {
    try {
        final MapModel oldMap = Controller.getCurrentController().getMap();
        Controller.getCurrentModeController().getMapController().newMap(url);
        final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
        final String key = mapViewManager.checkIfFileIsAlreadyOpened(url);
        // make the map the current map even if it was already opened
        if (key == null || !mapViewManager.tryToChangeToMapView(key))
            throw new RuntimeException("map " + url + " does not seem to be opened");
        final MapModel newMap = mapViewManager.getModel();
        restartTransaction(oldMap, newMap);
        return new MapProxy(newMap, scriptContext);
    } catch (Exception e) {
        throw new RuntimeException("error on newMap", e);
    }
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) MMapModel(org.freeplane.features.map.mindmapmode.MMapModel) MapModel(org.freeplane.features.map.MapModel)

Example 19 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class MapController method showNextChild.

public boolean showNextChild(final NodeModel node) {
    if (node.getChildCount() == 0)
        return false;
    final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
    final boolean unfold = mapViewManager.isFoldedOnCurrentView(node);
    if (unfold) {
        mapViewManager.hideChildren(node);
        setFoldingState(node, false);
    }
    boolean childShown = false;
    for (NodeModel child : childrenUnfolded(node)) {
        if (mapViewManager.showHiddenNode(child)) {
            if (child.hasVisibleContent()) {
                childShown = true;
                break;
            } else if (canBeUnfoldedOnCurrentView(child)) {
                unfoldUpToVisibleChild(child);
                childShown = true;
                break;
            }
        }
    }
    if (childShown) {
        fireNodeUnfold(node);
    }
    return childShown;
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager)

Example 20 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class BToolbarContributor method afterViewChange.

public void afterViewChange(final Component oldView, final Component newView) {
    if (newView == null) {
        return;
    }
    final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
    mapViewManager.getModeController(newView);
    final MapModel map = mapViewManager.getModel(newView);
    final URL url = map.getURL();
    if (url == null) {
        return;
    }
    setURLField(url.toString());
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) MapModel(org.freeplane.features.map.MapModel) URL(java.net.URL)

Aggregations

IMapViewManager (org.freeplane.features.ui.IMapViewManager)35 Component (java.awt.Component)13 Controller (org.freeplane.features.mode.Controller)13 MapModel (org.freeplane.features.map.MapModel)12 ModeController (org.freeplane.features.mode.ModeController)11 JComponent (javax.swing.JComponent)7 URL (java.net.URL)5 ResourceController (org.freeplane.core.resources.ResourceController)5 NodeModel (org.freeplane.features.map.NodeModel)5 MapView (org.freeplane.view.swing.map.MapView)5 Point (java.awt.Point)4 JTextComponent (javax.swing.text.JTextComponent)4 IUndoHandler (org.freeplane.core.undo.IUndoHandler)3 LinkController (org.freeplane.features.link.LinkController)3 MLinkController (org.freeplane.features.link.mindmapmode.MLinkController)3 ViewController (org.freeplane.features.ui.ViewController)3 Color (java.awt.Color)2 Dimension (java.awt.Dimension)2 ComponentAdapter (java.awt.event.ComponentAdapter)2 ComponentEvent (java.awt.event.ComponentEvent)2