use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class SwingPasswordStrategy method onWrongPassword.
public void onWrongPassword() {
final Controller controller = Controller.getCurrentController();
JOptionPane.showMessageDialog(controller.getViewController().getCurrentRootComponent(), TextUtils.getText("accessories/plugins/EncryptNode.properties_wrong_password"), "Freeplane", JOptionPane.ERROR_MESSAGE);
}
use of org.freeplane.features.mode.Controller 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.mode.Controller 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)) {
closeWithoutSaving(map);
return newDocumentationMap(url);
}
final URL alternativeURL = MFileManager.getController(getMModeController()).getAlternativeURL(url, AlternativeFileMode.ALL);
if (alternativeURL == null)
return false;
controller.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);
closeWithoutSaving(map);
newMapView(newModel);
return true;
} finally {
controller.getViewController().setWaitingCursor(false);
}
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class MapController method select.
public void select(final NodeModel node) {
final MapModel map = node.getMap();
final Controller controller = Controller.getCurrentController();
if (!map.equals(controller.getMap())) {
controller.getMapViewManager().changeToMap(map);
}
displayNode(node);
controller.getSelection().selectAsTheOnlyOneSelected(node);
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class DeleteAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final ModeController modeController = Controller.getCurrentModeController();
for (final NodeModel node : modeController.getMapController().getSelectedNodes()) {
if (node.isRoot()) {
return;
}
}
final Controller controller = Controller.getCurrentController();
final int showResult = OptionalDontShowMeAgainDialog.show("really_remove_node", "confirmation", MModeController.RESOURCES_DELETE_NODES_WITHOUT_QUESTION, OptionalDontShowMeAgainDialog.ONLY_OK_SELECTION_IS_STORED);
if (showResult != JOptionPane.OK_OPTION) {
return;
}
final MMapController mapController = (MMapController) modeController.getMapController();
mapController.deleteNodes(controller.getSelection().getSortedSelection(true));
controller.getMapViewManager().obtainFocusForSelected();
}
Aggregations