Search in sources :

Example 86 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class MNoteController method onWrite.

@Override
protected void onWrite(final MapModel map) {
    final ModeController modeController = Controller.getCurrentModeController();
    final Controller controller = modeController.getController();
    final IMapSelection selection = controller.getSelection();
    if (selection == null) {
        return;
    }
    final NodeModel selected = selection.getSelected();
    noteManager.saveNote(selected);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection) ModeController(org.freeplane.features.mode.ModeController) NoteController(org.freeplane.features.note.NoteController) MTextController(org.freeplane.features.text.mindmapmode.MTextController) ResourceController(org.freeplane.core.resources.ResourceController) MapController(org.freeplane.features.map.MapController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) SpellCheckerController(org.freeplane.features.spellchecker.mindmapmode.SpellCheckerController)

Example 87 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class RemoveNoteAction method doesNoteExist.

private boolean doesNoteExist() {
    boolean foundNote = false;
    final ModeController modeController = Controller.getCurrentModeController();
    if (modeController == null) {
        foundNote = false;
    } else {
        for (final NodeModel node : modeController.getMapController().getSelectedNodes()) {
            if (NoteModel.getNoteText(node) != null) {
                foundNote = true;
                break;
            }
        }
    }
    return foundNote;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ModeController(org.freeplane.features.mode.ModeController)

Example 88 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class RemoveNoteAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final int showResult = OptionalDontShowMeAgainDialog.show("really_remove_notes", "confirmation", MNoteController.RESOURCES_REMOVE_NOTES_WITHOUT_QUESTION, OptionalDontShowMeAgainDialog.ONLY_OK_SELECTION_IS_STORED);
    if (showResult != JOptionPane.OK_OPTION) {
        return;
    }
    final ModeController modeController = Controller.getCurrentModeController();
    for (final Iterator<NodeModel> iterator = modeController.getMapController().getSelectedNodes().iterator(); iterator.hasNext(); ) {
        final NodeModel node = iterator.next();
        if (NoteModel.getNoteText(node) != null) {
            removeNote(node);
        }
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ModeController(org.freeplane.features.mode.ModeController)

Example 89 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class SetBooleanMapPropertyAction method setSelected.

@Override
public void setSelected() {
    try {
        final Controller controller = Controller.getCurrentController();
        final NodeModel node = controller.getSelection().getSelected();
        final ModeController modeController = controller.getModeController();
        final MapStyle mapStyleController = MapStyle.getController(modeController);
        final String value = mapStyleController.getPropertySetDefault(node.getMap(), propertyName);
        boolean isSet = Boolean.parseBoolean(value);
        setSelected(isSet);
    } catch (Exception e) {
        setSelected(false);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapStyle(org.freeplane.features.styles.MapStyle) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 90 with ModeController

use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.

the class ManageNodeConditionalStylesAction method actionPerformed.

public void actionPerformed(ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final ConditionalStyleModel conditionalStyleModel = getConditionalStyleModel();
    Component pane = createConditionalStylePane(map, conditionalStyleModel);
    final ModeController modeController = Controller.getCurrentModeController();
    modeController.startTransaction();
    try {
        final int confirmed = JOptionPane.showConfirmDialog(controller.getMapViewManager().getMapViewComponent(), pane, TextUtils.getText(TextUtils.removeMnemonic("ManageNodeConditionalStylesAction.text")), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
        if (JOptionPane.OK_OPTION == confirmed) {
            modeController.commit();
            modeController.getMapController().nodeChanged(controller.getSelection().getSelected(), NodeModel.UNKNOWN_PROPERTY, null, null);
        } else {
            modeController.rollback();
        }
    } catch (RuntimeException ex) {
        ex.printStackTrace();
        modeController.rollback();
    }
}
Also used : ConditionalStyleModel(org.freeplane.features.styles.ConditionalStyleModel) MapModel(org.freeplane.features.map.MapModel) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) Component(java.awt.Component)

Aggregations

ModeController (org.freeplane.features.mode.ModeController)222 NodeModel (org.freeplane.features.map.NodeModel)90 Controller (org.freeplane.features.mode.Controller)56 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)48 MapModel (org.freeplane.features.map.MapModel)37 IActor (org.freeplane.core.undo.IActor)31 MapController (org.freeplane.features.map.MapController)30 ResourceController (org.freeplane.core.resources.ResourceController)29 MMapController (org.freeplane.features.map.mindmapmode.MMapController)20 File (java.io.File)17 TextController (org.freeplane.features.text.TextController)17 Color (java.awt.Color)16 Point (java.awt.Point)16 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)15 MapView (org.freeplane.view.swing.map.MapView)13 NodeView (org.freeplane.view.swing.map.NodeView)13 Component (java.awt.Component)12 URL (java.net.URL)12 LinkController (org.freeplane.features.link.LinkController)12 MenuBuilder (org.freeplane.core.ui.MenuBuilder)11