use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class ExportAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
if (exp == null) {
exp = new ExportDialog();
}
final MapModel model = Controller.getCurrentController().getMap();
if (model == null) {
return;
}
export(model);
}
use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class FilterHistory method undo.
void undo() {
Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
final Filter previous = filters.previous();
undoImpl(map);
while (previous != filters.next()) {
;
}
if (filters.nextIndex() > 1) {
filters.previous();
}
}
use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class MMapController method deleteWithoutUndo.
private void deleteWithoutUndo(final NodeModel parent, final int index) {
final NodeModel child = parent.getChildAt(index);
firePreNodeDelete(parent, child, index);
final MapModel map = parent.getMap();
setSaved(map, false);
parent.remove(index);
fireNodeDeleted(parent, child, index);
}
use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class MMapController method insertSingleNewNode.
private void insertSingleNewNode(final NodeModel newNode, final NodeModel parent, final int index, final boolean newNodeIsLeft) {
final MapModel map = parent.getMap();
newNode.setLeft(newNodeIsLeft);
final IActor actor = new IActor() {
public void act() {
insertNodeIntoWithoutUndo(newNode, parent, index);
}
public String getDescription() {
return "addNewNode";
}
public void undo() {
deleteWithoutUndo(parent, index);
}
};
Controller.getCurrentModeController().execute(actor, map);
}
use of org.freeplane.features.map.MapModel in project freeplane by freeplane.
the class MMapController method restoreCurrentMap.
/**
*@throws XMLException
* @deprecated -- use MMapIO
*/
@Deprecated
public boolean restoreCurrentMap() throws FileNotFoundException, IOException, URISyntaxException, XMLException {
final Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
final URL url = map.getURL();
if (url == null) {
UITools.errorMessage(TextUtils.getText("map_not_saved"));
return false;
}
if (map.containsExtension(DocuMapAttribute.class)) {
controller.close(true);
return newDocumentationMap(url);
}
final URL alternativeURL = MFileManager.getController(getMModeController()).getAlternativeURL(url, AlternativeFileMode.ALL);
if (alternativeURL == null)
return false;
Controller.getCurrentController().getViewController().setWaitingCursor(true);
try {
final MapModel newModel = new MMapModel();
((MFileManager) MFileManager.getController()).loadAndLock(alternativeURL, newModel);
newModel.setURL(url);
newModel.setSaved(alternativeURL.equals(url));
fireMapCreated(newModel);
controller.close(true);
newMapView(newModel);
return true;
} finally {
Controller.getCurrentController().getViewController().setWaitingCursor(false);
}
}
Aggregations