use of org.freeplane.features.styles.MapStyleModel 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;
}
use of org.freeplane.features.styles.MapStyleModel 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;
}
use of org.freeplane.features.styles.MapStyleModel 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;
}
use of org.freeplane.features.styles.MapStyleModel in project freeplane by freeplane.
the class NodeStyleController method getBorderWidthMatchesEdgeWidth.
private Boolean getBorderWidthMatchesEdgeWidth(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 borderWidthMatchesEdgeWidth = borderModel.getBorderWidthMatchesEdgeWidth();
if (borderWidthMatchesEdgeWidth == null) {
continue;
}
return borderWidthMatchesEdgeWidth;
}
return false;
}
use of org.freeplane.features.styles.MapStyleModel in project freeplane by freeplane.
the class NodeStyleController method getMaxNodeWidth.
private Quantity<LengthUnits> getMaxNodeWidth(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> maxTextWidth = sizeModel.getMaxNodeWidth();
if (maxTextWidth == null) {
continue;
}
return maxTextWidth;
}
return DEFAULT_MAXIMUM_WIDTH;
}
Aggregations