use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.
the class NodeProxy method setText.
// Node: R/W
public void setText(final Object value) {
if (value instanceof String) {
final MTextController textController = (MTextController) TextController.getController();
textController.setNodeText(getDelegate(), (String) value);
} else {
setObject(value);
}
}
use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.
the class NodeProxy method setMinimized.
// Node: R/W
public void setMinimized(boolean shortened) {
final MTextController textController = (MTextController) TextController.getController();
textController.setIsMinimized(getDelegate(), shortened);
}
use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.
the class LatexRenderer method createEditor.
public EditNodeBase createEditor(NodeModel node, IEditControl editControl, String text, boolean editLong) {
MTextController textController = MTextController.getController();
if (// Format=Text!
textController.isTextFormattingDisabled(node))
return null;
final KeyEvent firstKeyEvent = textController.getEventQueue().getFirstEvent();
String nodeFormat = textController.getNodeFormat(node);
final String latexText = getLatexNode(text, nodeFormat, TargetMode.FOR_EDITOR);
// this option has been added to work around bugs in JSyntaxPane with Chinese characters
if (ResourceController.getResourceController().getBooleanProperty(LATEX_EDITOR_DISABLE))
return null;
if (latexText != null) {
JEditorPane textEditor = new JEditorPane();
textEditor.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true);
final JRestrictedSizeScrollPane scrollPane = new JRestrictedSizeScrollPane(textEditor);
scrollPane.setMinimumSize(new Dimension(0, 60));
final EditNodeDialog editNodeDialog = new LatexEditor(node, latexText, firstKeyEvent, editControl, false, textEditor);
editNodeDialog.setTitle(TextUtils.getText("latex_editor"));
textEditor.setContentType("text/latex");
final String fontName = ResourceController.getResourceController().getProperty(LATEX_EDITOR_FONT);
final int fontSize = ResourceController.getResourceController().getIntProperty(LATEX_EDITOR_FONT_SIZE);
textEditor.setFont(new Font(fontName, Font.PLAIN, fontSize));
return editNodeDialog;
}
return null;
}
use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.
the class ControllerProxy method editImpl.
private void editImpl(Node node, boolean editInline) {
final NodeModel nodeModel = ((NodeProxy) node).getDelegate();
Controller.getCurrentController().getSelection().selectAsTheOnlyOneSelected(nodeModel);
((MTextController) TextController.getController()).edit(FirstAction.EDIT_CURRENT, !editInline);
}
use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.
the class MLogicalStyleController method copyStyleExtensions.
public void copyStyleExtensions(final IStyle style, final NodeModel target) {
final MTextController textController = MTextController.getController();
final MapStyleModel extension = MapStyleModel.getExtension(target.getMap());
final NodeModel styleNode = extension.getStyleNode(style);
if (styleNode != null) {
final MAttributeController attributeController = MAttributeController.getController();
attributeController.copyAttributesToNode(styleNode, target);
final String detailTextText = DetailTextModel.getDetailTextText(styleNode);
if (detailTextText != null)
textController.setDetails(target, detailTextText);
final String noteText = NoteModel.getNoteText(styleNode);
if (noteText != null) {
MNoteController noteController = (MNoteController) NoteController.getController();
noteController.setNoteText(target, noteText);
}
}
}
Aggregations