Search in sources :

Example 16 with ModeController

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

the class NodeStyleController method install.

public static void install(final NodeStyleController styleController) {
    final ModeController modeController = Controller.getCurrentModeController();
    modeController.addExtension(NodeStyleController.class, styleController);
}
Also used : ModeController(org.freeplane.features.mode.ModeController)

Example 17 with ModeController

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

the class PasteFormat method pasteFormat.

/**
 */
private void pasteFormat(final NodeModel node) {
    final NodeModel pattern = CopyFormat.getPattern();
    if (pattern == null) {
        JOptionPane.showMessageDialog(Controller.getCurrentController().getViewController().getCurrentRootComponent(), TextUtils.getText("no_format_copy_before_format_paste"), "", /*=Title*/
        JOptionPane.ERROR_MESSAGE);
        return;
    }
    final ModeController modeController = Controller.getCurrentModeController();
    modeController.undoableRemoveExtensions(LogicalStyleKeys.LOGICAL_STYLE, node, node);
    modeController.undoableCopyExtensions(LogicalStyleKeys.LOGICAL_STYLE, pattern, node);
    modeController.undoableRemoveExtensions(LogicalStyleKeys.NODE_STYLE, node, node);
    modeController.undoableCopyExtensions(LogicalStyleKeys.NODE_STYLE, pattern, node);
    if (ResourceController.getResourceController().getBooleanProperty("copyFormatToNewSiblingIncludesIcons")) {
        modeController.undoableRemoveExtensions(Keys.ICONS, node, node);
        modeController.undoableCopyExtensions(Keys.ICONS, pattern, node);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ModeController(org.freeplane.features.mode.ModeController)

Example 18 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) LinkController(org.freeplane.features.link.LinkController) MapController(org.freeplane.features.map.MapController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) SpellCheckerController(org.freeplane.features.spellchecker.mindmapmode.SpellCheckerController)

Example 19 with ModeController

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

the class MNoteController method startupController.

public void startupController() {
    final ModeController modeController = Controller.getCurrentModeController();
    if (shouldUseSplitPane()) {
        showNotesPanel(false);
    }
    modeController.getMapController().addNodeSelectionListener(noteManager);
    Controller.getCurrentController().getMapViewManager().addMapSelectionListener(noteManager);
    noteManager.mNoteDocumentListener = new NoteDocumentListener();
}
Also used : ModeController(org.freeplane.features.mode.ModeController)

Example 20 with ModeController

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

the class MNoteController method setDefaultStyle.

void setDefaultStyle(NodeModel node) {
    final StyleSheet styleSheet = noteViewerComponent.getDocument().getStyleSheet();
    styleSheet.removeStyle("body");
    styleSheet.removeStyle("p");
    // set default font for notes:
    final ModeController modeController = Controller.getCurrentModeController();
    String noteCssRule = getNoteCSSStyle(modeController, node, 1f, false);
    String bodyRule = new StringBuilder("body {").append(noteCssRule).append("}\n").toString();
    styleSheet.addRule(bodyRule);
    if (ResourceController.getResourceController().getBooleanProperty(MNoteController.RESOURCES_USE_MARGIN_TOP_ZERO_FOR_NOTES)) {
        /* this is used for paragraph spacing. I put it here, too, as
			 * the tooltip display uses the same spacing. But it is to be discussed.
			 * fc, 23.3.2009.
			 */
        String paragraphtRule = "p {margin-top:0;}\n";
        styleSheet.addRule(paragraphtRule);
    }
}
Also used : StyleSheet(javax.swing.text.html.StyleSheet) ModeController(org.freeplane.features.mode.ModeController)

Aggregations

ModeController (org.freeplane.features.mode.ModeController)185 NodeModel (org.freeplane.features.map.NodeModel)80 Controller (org.freeplane.features.mode.Controller)43 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)36 MapController (org.freeplane.features.map.MapController)31 MapModel (org.freeplane.features.map.MapModel)30 IActor (org.freeplane.core.undo.IActor)28 ResourceController (org.freeplane.core.resources.ResourceController)21 MMapController (org.freeplane.features.map.mindmapmode.MMapController)21 Point (java.awt.Point)16 TextController (org.freeplane.features.text.TextController)16 Component (java.awt.Component)13 MapView (org.freeplane.view.swing.map.MapView)13 LinkController (org.freeplane.features.link.LinkController)12 NodeView (org.freeplane.view.swing.map.NodeView)12 Color (java.awt.Color)11 File (java.io.File)11 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)11 IMapSelection (org.freeplane.features.map.IMapSelection)10 ViewController (org.freeplane.features.ui.ViewController)10