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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations