Search in sources :

Example 1 with MapStyleModel

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

the class IconController method getStyleIconSize.

private Quantity<LengthUnits> getStyleIconSize(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 Quantity<LengthUnits> iconSize = styleNode.getSharedData().getIcons().getIconSize();
        if (iconSize == null) {
            continue;
        }
        return iconSize;
    }
    return DEFAULT_ICON_SIZE;
}
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 2 with MapStyleModel

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

the class NodeStyleController method getNodeFormat.

public String getNodeFormat(NodeModel node) {
    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 String format = NodeStyleModel.getNodeFormat(styleNode);
        if (format != null) {
            return format;
        }
    }
    // automatically disable all IContentTransformers!
    return PatternFormat.STANDARD_FORMAT_PATTERN;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 3 with MapStyleModel

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

the class NodeStyleController method getBorderDashMatchesEdgeDash.

private Boolean getBorderDashMatchesEdgeDash(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 borderDashMatchesEdgeDash = borderModel.getBorderDashMatchesEdgeDash();
        if (borderDashMatchesEdgeDash == null) {
            continue;
        }
        return borderDashMatchesEdgeDash;
    }
    return false;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 4 with MapStyleModel

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

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

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