Search in sources :

Example 11 with MTextController

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);
    }
}
Also used : MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Example 12 with MTextController

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);
}
Also used : MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Example 13 with MTextController

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;
}
Also used : KeyEvent(java.awt.event.KeyEvent) JRestrictedSizeScrollPane(org.freeplane.core.ui.components.JRestrictedSizeScrollPane) JEditorPane(javax.swing.JEditorPane) MTextController(org.freeplane.features.text.mindmapmode.MTextController) Dimension(java.awt.Dimension) EditNodeDialog(org.freeplane.features.text.mindmapmode.EditNodeDialog) Font(java.awt.Font)

Example 14 with MTextController

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Example 15 with MTextController

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);
        }
    }
}
Also used : MNoteController(org.freeplane.features.note.mindmapmode.MNoteController) NodeModel(org.freeplane.features.map.NodeModel) MAttributeController(org.freeplane.features.attribute.mindmapmode.MAttributeController) MapStyleModel(org.freeplane.features.styles.MapStyleModel) MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Aggregations

MTextController (org.freeplane.features.text.mindmapmode.MTextController)25 NodeModel (org.freeplane.features.map.NodeModel)11 ModeController (org.freeplane.features.mode.ModeController)8 MMapController (org.freeplane.features.map.mindmapmode.MMapController)7 Component (java.awt.Component)5 KeyEvent (java.awt.event.KeyEvent)5 MLinkController (org.freeplane.features.link.mindmapmode.MLinkController)5 Controller (org.freeplane.features.mode.Controller)5 TextController (org.freeplane.features.text.TextController)5 MLocationController (org.freeplane.features.nodelocation.mindmapmode.MLocationController)4 JComponent (javax.swing.JComponent)3 JPopupMenu (javax.swing.JPopupMenu)3 JTable (javax.swing.JTable)3 ResourceController (org.freeplane.core.resources.ResourceController)3 AttributeController (org.freeplane.features.attribute.AttributeController)3 MAttributeController (org.freeplane.features.attribute.mindmapmode.MAttributeController)3 CloudController (org.freeplane.features.cloud.CloudController)3 MCloudController (org.freeplane.features.cloud.mindmapmode.MCloudController)3 EdgeController (org.freeplane.features.edge.EdgeController)3 MEdgeController (org.freeplane.features.edge.mindmapmode.MEdgeController)3