Search in sources :

Example 31 with Controller

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);
}
Also used : Controller(org.freeplane.features.mode.Controller)

Example 32 with Controller

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();
    }
}
Also used : MapModel(org.freeplane.features.map.MapModel) Controller(org.freeplane.features.mode.Controller)

Example 33 with Controller

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);
    }
}
Also used : MFileManager(org.freeplane.features.url.mindmapmode.MFileManager) MapModel(org.freeplane.features.map.MapModel) MLogicalStyleController(org.freeplane.features.styles.mindmapmode.MLogicalStyleController) MTextController(org.freeplane.features.text.mindmapmode.MTextController) MapController(org.freeplane.features.map.MapController) Controller(org.freeplane.features.mode.Controller) TextController(org.freeplane.features.text.TextController) MLinkController(org.freeplane.features.link.mindmapmode.MLinkController) ClipboardController(org.freeplane.features.clipboard.ClipboardController) AddOnsController(org.freeplane.main.addons.AddOnsController) ResourceController(org.freeplane.core.resources.ResourceController) ViewController(org.freeplane.features.ui.ViewController) ModeController(org.freeplane.features.mode.ModeController) MLocationController(org.freeplane.features.nodelocation.mindmapmode.MLocationController) MModeController(org.freeplane.features.mode.mindmapmode.MModeController) URL(java.net.URL)

Example 34 with Controller

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);
}
Also used : AddOnsController(org.freeplane.main.addons.AddOnsController) ResourceController(org.freeplane.core.resources.ResourceController) FilterController(org.freeplane.features.filter.FilterController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) SelectionController(org.freeplane.features.mode.SelectionController)

Example 35 with Controller

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();
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MModeController(org.freeplane.features.mode.mindmapmode.MModeController) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) MModeController(org.freeplane.features.mode.mindmapmode.MModeController) ModeController(org.freeplane.features.mode.ModeController)

Aggregations

Controller (org.freeplane.features.mode.Controller)135 ModeController (org.freeplane.features.mode.ModeController)78 ResourceController (org.freeplane.core.resources.ResourceController)63 NodeModel (org.freeplane.features.map.NodeModel)44 MapController (org.freeplane.features.map.MapController)37 LinkController (org.freeplane.features.link.LinkController)32 MapModel (org.freeplane.features.map.MapModel)31 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)30 MMapController (org.freeplane.features.map.mindmapmode.MMapController)27 TextController (org.freeplane.features.text.TextController)24 ViewController (org.freeplane.features.ui.ViewController)22 IconController (org.freeplane.features.icon.IconController)20 Component (java.awt.Component)18 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)18 FilterController (org.freeplane.features.filter.FilterController)16 FormatController (org.freeplane.features.format.FormatController)15 ScannerController (org.freeplane.features.format.ScannerController)15 IMapSelection (org.freeplane.features.map.IMapSelection)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)14 IMapViewManager (org.freeplane.features.ui.IMapViewManager)14