Search in sources :

Example 6 with MapStyleModel

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

the class NodeStyleController method getDefaultFont.

public Font getDefaultFont(final MapModel map, final IStyle style) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    final NodeModel styleNode = model.getStyleNodeSafe(style);
    return getFont(styleNode);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 7 with MapStyleModel

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

the class NodeStyleController method getStyleBackgroundColor.

private Color getStyleBackgroundColor(final MapModel map, final Collection<IStyle> styleKeys) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : styleKeys) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
        if (styleModel == null) {
            continue;
        }
        final Color styleColor = styleModel.getBackgroundColor();
        if (styleColor == null) {
            continue;
        }
        return styleColor;
    }
    return null;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel) Color(java.awt.Color)

Example 8 with MapStyleModel

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

the class NodeStyleController method getStyleTextColor.

private Color getStyleTextColor(final MapModel map, final Collection<IStyle> collection) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : collection) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
        if (styleModel == null) {
            continue;
        }
        final Color styleColor = styleModel == null ? null : styleModel.getColor();
        if (styleColor == null) {
            continue;
        }
        return styleColor;
    }
    return null;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel) Color(java.awt.Color)

Example 9 with MapStyleModel

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

the class NodeStyleController method getNodeNumbering.

public boolean getNodeNumbering(NodeModel node) {
    if (SummaryNode.isFirstGroupNode(node) || SummaryNode.isSummaryNode(node))
        return false;
    Collection<IStyle> collection = LogicalStyleController.getController(modeController).getStyles(node);
    final MapStyleModel model = MapStyleModel.getExtension(node.getMap());
    for (IStyle styleKey : collection) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final Boolean numbering = NodeStyleModel.getNodeNumbering(styleNode);
        if (numbering != null) {
            return numbering;
        }
    }
    return false;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 10 with MapStyleModel

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

the class MapView method updateContentStyle.

private void updateContentStyle() {
    final NodeStyleController style = Controller.getCurrentModeController().getExtension(NodeStyleController.class);
    MapModel map = getModel();
    final MapStyleModel model = MapStyleModel.getExtension(map);
    final NodeModel detailStyleNode = model.getStyleNodeSafe(MapStyleModel.DETAILS_STYLE);
    detailFont = UITools.scale(style.getFont(detailStyleNode));
    detailBackground = style.getBackgroundColor(detailStyleNode);
    detailForeground = style.getColor(detailStyleNode);
    detailHorizontalAlignment = style.getHorizontalTextAlignment(detailStyleNode).swingConstant;
    final NodeModel noteStyleNode = model.getStyleNodeSafe(MapStyleModel.NOTE_STYLE);
    noteFont = UITools.scale(style.getFont(noteStyleNode));
    noteBackground = style.getBackgroundColor(noteStyleNode);
    noteForeground = style.getColor(noteStyleNode);
    noteHorizontalAlignment = style.getHorizontalTextAlignment(noteStyleNode).swingConstant;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) MapStyleModel(org.freeplane.features.styles.MapStyleModel) MapModel(org.freeplane.features.map.MapModel)

Aggregations

MapStyleModel (org.freeplane.features.styles.MapStyleModel)48 NodeModel (org.freeplane.features.map.NodeModel)39 IStyle (org.freeplane.features.styles.IStyle)30 Color (java.awt.Color)10 MapModel (org.freeplane.features.map.MapModel)10 Controller (org.freeplane.features.mode.Controller)6 LengthUnits (org.freeplane.core.ui.LengthUnits)5 IActor (org.freeplane.core.undo.IActor)5 MMapController (org.freeplane.features.map.mindmapmode.MMapController)5 StyleTranslatedObject (org.freeplane.features.styles.StyleTranslatedObject)4 ModeController (org.freeplane.features.mode.ModeController)3 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)3 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)3 MapStyle (org.freeplane.features.styles.MapStyle)3 Font (java.awt.Font)2 ArrayList (java.util.ArrayList)2 DashVariant (org.freeplane.features.DashVariant)2 ConditionalStyleModel (org.freeplane.features.styles.ConditionalStyleModel)2 MapView (org.freeplane.view.swing.map.MapView)2 NodeView (org.freeplane.view.swing.map.NodeView)2