Search in sources :

Example 16 with MTextController

use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.

the class NodeProxy method setDetailsText.

// Node: R/W
public void setDetailsText(String html) {
    final MTextController textController = (MTextController) TextController.getController();
    if (html == null) {
        textController.setDetailsHidden(getDelegate(), false);
        textController.setDetails(getDelegate(), null);
    } else {
        textController.setDetails(getDelegate(), html);
    }
}
Also used : MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Example 17 with MTextController

use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.

the class NodeProxy method setDateTime.

// Node: R/W
public void setDateTime(final Date date) {
    final MTextController textController = (MTextController) TextController.getController();
    textController.setNodeObject(getDelegate(), ProxyUtils.createDefaultFormattedDateTime(date));
}
Also used : MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Example 18 with MTextController

use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.

the class NodeProxy method setHideDetails.

// Node: R/W
public void setHideDetails(boolean hide) {
    MTextController controller = (MTextController) MTextController.getController();
    controller.setDetailsHidden(getDelegate(), hide);
}
Also used : MTextController(org.freeplane.features.text.mindmapmode.MTextController)

Example 19 with MTextController

use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.

the class AttributeTable method getCellEditor.

@SuppressWarnings("serial")
public TableCellEditor getCellEditor(final int row, final int col, EventObject e) {
    if (dce != null) {
        dce.stopCellEditing();
    }
    if (col == 1) {
        final MTextController textController = (MTextController) TextController.getController();
        if (e instanceof KeyEvent) {
            final KeyEvent kev = (KeyEvent) e;
            textController.getEventQueue().setFirstEvent(kev);
        }
        final IAttributeTableModel model = (IAttributeTableModel) getModel();
        final String text = getValueForEdit(row, col);
        final DialogTableCellEditor dialogTableCellEditor = new DialogTableCellEditor();
        EditNodeBase base = textController.getEditNodeBase(model.getNode(), text, dialogTableCellEditor.getEditControl(), false);
        if (base != null) {
            dialogTableCellEditor.setEditBase(base);
            return dialogTableCellEditor;
        }
    }
    final JComboBox comboBox;
    if (dce == null) {
        comboBox = new JComboBoxWithBorder() {

            // Workaround for bug introduced in Java 8: they use wrong component in DefaultCellEditor.EditorDelegate
            @Override
            public void actionPerformed(ActionEvent e) {
                if (e != null && e.getSource() == dce) {
                    super.actionPerformed(new ActionEvent(getEditor(), e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers()));
                } else
                    super.actionPerformed(e);
            }
        };
        comboBox.addFocusListener(AttributeTable.focusListener);
        comboBox.getEditor().getEditorComponent().addFocusListener(AttributeTable.focusListener);
        comboBox.setRenderer(new TypedListCellRenderer());
        dce = new DefaultCellEditor(comboBox) {

            public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) {
                return super.getTableCellEditorComponent(table, ((AttributeTable) table).getValueForEdit(row, col), isSelected, row, col);
            }
        };
        dce.setClickCountToStart(CLICK_COUNT_TO_START);
    }
    return dce;
}
Also used : JComboBox(javax.swing.JComboBox) EditNodeBase(org.freeplane.features.text.mindmapmode.EditNodeBase) ActionEvent(java.awt.event.ActionEvent) DefaultCellEditor(javax.swing.DefaultCellEditor) KeyEvent(java.awt.event.KeyEvent) TypedListCellRenderer(org.freeplane.core.ui.components.TypedListCellRenderer) JTable(javax.swing.JTable) IAttributeTableModel(org.freeplane.features.attribute.IAttributeTableModel) EventObject(java.util.EventObject) IFormattedObject(org.freeplane.features.format.IFormattedObject) FormattedObject(org.freeplane.features.format.FormattedObject) MTextController(org.freeplane.features.text.mindmapmode.MTextController) JComboBoxWithBorder(org.freeplane.core.ui.components.JComboBoxWithBorder) EditedComponent(org.freeplane.features.text.mindmapmode.EditNodeBase.EditedComponent) Component(java.awt.Component) JComponent(javax.swing.JComponent)

Example 20 with MTextController

use of org.freeplane.features.text.mindmapmode.MTextController in project freeplane by freeplane.

the class ImportExplorerFavoritesAction method addNode.

/**
 */
private NodeModel addNode(final NodeModel target, final String nodeContent) {
    final NodeModel node = ((MMapController) Controller.getCurrentModeController().getMapController()).addNewNode(target, target.getChildCount(), target.isNewChildLeft());
    ((MTextController) TextController.getController()).setNodeText(node, nodeContent);
    return node;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MMapController(org.freeplane.features.map.mindmapmode.MMapController) 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