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