Search in sources :

Example 6 with LogicalStyleController

use of org.freeplane.features.styles.LogicalStyleController in project freeplane by freeplane.

the class MUIFactory method changeToolbar.

private void changeToolbar(final NodeModel node) {
    final Controller controller = Controller.getCurrentController();
    final MNodeStyleController styleController = (MNodeStyleController) controller.getModeController().getExtension(NodeStyleController.class);
    selectFontSize(Integer.toString(styleController.getFontSize(node)));
    selectFontName(styleController.getFontFamilyName(node));
    final LogicalStyleController logicalStyleController = LogicalStyleController.getController();
    ignoreChangeEvent = true;
    styles.setSelectedItem(logicalStyleController.getFirstStyle(node));
    ignoreChangeEvent = false;
}
Also used : MNodeStyleController(org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController) MNodeStyleController(org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) MNodeStyleController(org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController)

Example 7 with LogicalStyleController

use of org.freeplane.features.styles.LogicalStyleController in project freeplane by freeplane.

the class NodeStyleController method getBorderColorMatchesEdgeColor.

public Boolean getBorderColorMatchesEdgeColor(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final Boolean borderColorMatchesEdgeColor = getBorderColorMatchesEdgeColor(map, style);
    return borderColorMatchesEdgeColor;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) MapModel(org.freeplane.features.map.MapModel)

Example 8 with LogicalStyleController

use of org.freeplane.features.styles.LogicalStyleController in project freeplane by freeplane.

the class NodeStyleController method getBorderColor.

public Color getBorderColor(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final Color borderColor = getBorderColor(map, style);
    return borderColor;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) Color(java.awt.Color) MapModel(org.freeplane.features.map.MapModel)

Example 9 with LogicalStyleController

use of org.freeplane.features.styles.LogicalStyleController in project freeplane by freeplane.

the class NodeStyleController method getBorderWidthMatchesEdgeWidth.

public Boolean getBorderWidthMatchesEdgeWidth(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final Boolean borderWidthMatchesEdgeWidth = getBorderWidthMatchesEdgeWidth(map, style);
    return borderWidthMatchesEdgeWidth;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) MapModel(org.freeplane.features.map.MapModel)

Example 10 with LogicalStyleController

use of org.freeplane.features.styles.LogicalStyleController in project freeplane by freeplane.

the class StyleControlGroup method setStyle.

@Override
public void setStyle(NodeModel node) {
    internalChange = true;
    try {
        final LogicalStyleController logicalStyleController = LogicalStyleController.getController();
        if (addStyleBox) {
            final boolean isStyleSet = LogicalStyleModel.getStyle(node) != null;
            mSetStyle.setValue(isStyleSet);
            setStyleList(mMapStyleButton, logicalStyleController.getMapStyleNames(node, "\n"));
        }
        setStyleList(mNodeStyleButton, logicalStyleController.getNodeStyleNames(node, "\n"));
        if (mAutomaticLayoutComboBox != null) {
            final ModeController modeController = Controller.getCurrentModeController();
            AutomaticLayoutController al = modeController.getExtension(AutomaticLayoutController.class);
            IExtension extension = al.getExtension(node);
            if (extension == null)
                mAutomaticLayoutComboBox.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
            else
                mAutomaticLayoutComboBox.setSelectedIndex(((AutomaticLayout) extension).ordinal());
        }
        if (mAutomaticEdgeColorComboBox != null) {
            final ModeController modeController = Controller.getCurrentModeController();
            AutomaticEdgeColorHook al = (AutomaticEdgeColorHook) modeController.getExtension(AutomaticEdgeColorHook.class);
            final AutomaticEdgeColor extension = (AutomaticEdgeColor) al.getExtension(node);
            if (extension == null) {
                mAutomaticEdgeColorComboBox.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
                mEditEdgeColorsBtn.setEnabled(false);
            } else {
                mAutomaticEdgeColorComboBox.setSelectedIndex(extension.rule.ordinal());
                mEditEdgeColorsBtn.setEnabled(true);
            }
        }
    } finally {
        internalChange = false;
    }
}
Also used : AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) AutomaticEdgeColorHook(org.freeplane.features.edge.AutomaticEdgeColorHook) IExtension(org.freeplane.core.extension.IExtension) AutomaticLayout(org.freeplane.features.styles.AutomaticLayout) MLogicalStyleController(org.freeplane.features.styles.mindmapmode.MLogicalStyleController) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) ModeController(org.freeplane.features.mode.ModeController) AutomaticEdgeColor(org.freeplane.features.edge.AutomaticEdgeColor)

Aggregations

LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)19 MapModel (org.freeplane.features.map.MapModel)10 IStyle (org.freeplane.features.styles.IStyle)10 Controller (org.freeplane.features.mode.Controller)8 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)8 CloudController (org.freeplane.features.cloud.CloudController)7 EdgeController (org.freeplane.features.edge.EdgeController)7 IconController (org.freeplane.features.icon.IconController)6 LinkController (org.freeplane.features.link.LinkController)6 TextController (org.freeplane.features.text.TextController)6 JPopupMenu (javax.swing.JPopupMenu)5 FreeplaneToolBar (org.freeplane.core.ui.components.FreeplaneToolBar)5 AttributeController (org.freeplane.features.attribute.AttributeController)5 ClipboardController (org.freeplane.features.clipboard.ClipboardController)5 FilterController (org.freeplane.features.filter.FilterController)5 LocationController (org.freeplane.features.nodelocation.LocationController)5 NoteController (org.freeplane.features.note.NoteController)5 ViewController (org.freeplane.features.ui.ViewController)5 UserInputListenerFactory (org.freeplane.view.swing.ui.UserInputListenerFactory)5 MCloudController (org.freeplane.features.cloud.mindmapmode.MCloudController)4