use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getMaxWidth.
public Quantity<LengthUnits> getMaxWidth(NodeModel node) {
final MapModel map = node.getMap();
final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
final Collection<IStyle> style = styleController.getStyles(node);
final Quantity<LengthUnits> maxTextWidth = getMaxNodeWidth(map, style);
return maxTextWidth;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getBorderWidthMatchesEdgeWidth.
public Boolean getBorderWidthMatchesEdgeWidth(NodeModel node) {
final MapModel map = node.getMap();
final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
final Collection<IStyle> style = styleController.getStyles(node);
final Boolean borderWidthMatchesEdgeWidth = getBorderWidthMatchesEdgeWidth(map, style);
return borderWidthMatchesEdgeWidth;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class EdgeController method getStyleDash.
private DashVariant getStyleDash(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 EdgeModel styleModel = EdgeModel.getModel(styleNode);
if (styleModel == null) {
continue;
}
final DashVariant dash = styleModel.getDash();
if (dash == null) {
continue;
}
return dash;
}
return null;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class EdgeController method getStyleEdgeColorRule.
private ObjectRule<Color, Rules> getStyleEdgeColorRule(NodeModel node) {
MapModel map = node.getMap();
Collection<IStyle> collection = LogicalStyleController.getController(modeController).getStyles(node);
final MapStyleModel styles = MapStyleModel.getExtension(map);
for (IStyle styleKey : collection) {
final NodeModel styleNode = styles.getStyleNode(styleKey);
if (styleNode == null) {
continue;
}
if (node != styleNode && map.getRootNode().containsExtension(AutomaticEdgeColor.class)) {
AutomaticLayoutController automaticLayoutController = modeController.getExtension(AutomaticLayoutController.class);
if (automaticLayoutController != null && automaticLayoutController.isAutomaticLevelStyle(styleNode)) {
continue;
}
}
ObjectRule<Color, Rules> nodeColor = getNodeColorRule(styleNode);
if (nodeColor != null)
return nodeColor;
}
return null;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class EdgeController method getStyleWidth.
private Integer getStyleWidth(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 EdgeModel styleModel = EdgeModel.getModel(styleNode);
if (styleModel == null) {
continue;
}
final int width = styleModel.getWidth();
if (width == EdgeModel.DEFAULT_WIDTH) {
continue;
}
return width;
}
return null;
}
Aggregations