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);
}
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);
}
}
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);
}
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();
}
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);
}
}
Aggregations