Search in sources :

Example 6 with IStyle

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

the class NodeStyleController method getBorderColorMatchesEdgeColor.

private Boolean getBorderColorMatchesEdgeColor(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 NodeBorderModel borderModel = NodeBorderModel.getModel(styleNode);
        if (borderModel == null) {
            continue;
        }
        final Boolean borderColorMatchesEdgeColor = borderModel.getBorderColorMatchesEdgeColor();
        if (borderColorMatchesEdgeColor == null) {
            continue;
        }
        return borderColorMatchesEdgeColor;
    }
    return true;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 7 with IStyle

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

the class NodeStyleController method getStyleMinWidth.

private Quantity<LengthUnits> getStyleMinWidth(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 NodeSizeModel sizeModel = NodeSizeModel.getModel(styleNode);
        if (sizeModel == null) {
            continue;
        }
        final Quantity<LengthUnits> minWidth = sizeModel.getMinNodeWidth();
        if (minWidth == null) {
            continue;
        }
        return minWidth;
    }
    return DEFAULT_MINIMUM_WIDTH;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) LengthUnits(org.freeplane.core.ui.LengthUnits) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 8 with IStyle

use of org.freeplane.features.styles.IStyle 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 9 with IStyle

use of org.freeplane.features.styles.IStyle 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 10 with IStyle

use of org.freeplane.features.styles.IStyle 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)

Aggregations

IStyle (org.freeplane.features.styles.IStyle)43 NodeModel (org.freeplane.features.map.NodeModel)31 MapStyleModel (org.freeplane.features.styles.MapStyleModel)30 MapModel (org.freeplane.features.map.MapModel)14 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)10 LengthUnits (org.freeplane.core.ui.LengthUnits)9 Color (java.awt.Color)5 IActor (org.freeplane.core.undo.IActor)5 MMapController (org.freeplane.features.map.mindmapmode.MMapController)4 DashVariant (org.freeplane.features.DashVariant)3 StyleTranslatedObject (org.freeplane.features.styles.StyleTranslatedObject)3 Controller (org.freeplane.features.mode.Controller)2 ModeController (org.freeplane.features.mode.ModeController)2 ArrayList (java.util.ArrayList)1 TranslatedObject (org.freeplane.core.resources.TranslatedObject)1 IMapSelection (org.freeplane.features.map.IMapSelection)1 HorizontalTextAlignment (org.freeplane.features.nodestyle.NodeStyleModel.HorizontalTextAlignment)1 AutomaticLayoutController (org.freeplane.features.styles.AutomaticLayoutController)1 LogicalStyleModel (org.freeplane.features.styles.LogicalStyleModel)1