Search in sources :

Example 31 with IStyle

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

the class LocationController method getStyleChildGap.

private Quantity<LengthUnits> getStyleChildGap(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 LocationModel styleModel = styleNode.getExtension(LocationModel.class);
        if (styleModel == null) {
            continue;
        }
        Quantity<LengthUnits> vGap = styleModel.getVGap();
        if (vGap == LocationModel.DEFAULT_VGAP) {
            continue;
        }
        return vGap;
    }
    return null;
}
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 32 with IStyle

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

the class NodeStyleController method getStyleShape.

private ShapeConfigurationModel getStyleShape(final MapModel map, final Collection<IStyle> style) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : style) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
        if (styleModel == null) {
            continue;
        }
        final ShapeConfigurationModel shapeConfiguration = styleModel.getShapeConfiguration();
        if (shapeConfiguration.getShape() == null) {
            continue;
        }
        return shapeConfiguration;
    }
    return null;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 33 with IStyle

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

the class NodeStyleController method getBorderWidth.

private Quantity<LengthUnits> getBorderWidth(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 Quantity<LengthUnits> borderWidth = borderModel.getBorderWidth();
        if (borderWidth == null) {
            continue;
        }
        return borderWidth;
    }
    return DEFAULT_BORDER_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 34 with IStyle

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

the class NodeStyleController method getBorderDash.

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

Example 35 with IStyle

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

the class NodeStyleController method getBorderColor.

private Color getBorderColor(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 Color borderColor = borderModel.getBorderColor();
        if (borderColor == null) {
            continue;
        }
        return borderColor;
    }
    return EdgeController.STANDARD_EDGE_COLOR;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel) Color(java.awt.Color)

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