use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class ControllerProxy method newMap.
public Map newMap() {
final MapModel oldMap = Controller.getCurrentController().getMap();
final MMapIO mapIO = (MMapIO) Controller.getCurrentModeController().getExtension(MapIO.class);
final MapModel newMap = mapIO.newMapFromDefaultTemplate();
restartTransaction(oldMap, newMap);
return new MapProxy(newMap, scriptContext);
}
use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class ControllerProxy method deactivateUndo.
public void deactivateUndo() {
final MapModel map = Controller.getCurrentController().getMap();
if (map instanceof MapModel) {
MModeController modeController = ((MModeController) Controller.getCurrentModeController());
modeController.deactivateUndo((MMapModel) map);
}
}
use of org.freeplane.features.map.MapModel 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.map.MapModel in project freeplane by freeplane.
the class MLinkController method deleteMapLinksForClone.
public void deleteMapLinksForClone(final NodeModel model) {
final MapModel map = model.getMap();
final MapLinks mapLinks = map.getExtension(MapLinks.class);
if (mapLinks != null) {
IActor actor = new IActor() {
@Override
public void undo() {
mapLinkChanger.insertMapLinks(mapLinks, model);
}
@Override
public String getDescription() {
return "deleteMapLinks";
}
@Override
public void act() {
mapLinkChanger.deleteMapLinks(mapLinks, model, model);
}
};
modeController.execute(actor, map);
}
}
use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class NodeLinks method addArrowlink.
public void addArrowlink(final NodeLinkModel newLink) {
links.add(newLink);
final MapModel map = newLink.getSource().getMap();
addLinkToMap(map, newLink);
}
Aggregations