use of org.freeplane.features.styles.IStyle 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.IStyle 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;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getStyleBackgroundColor.
private Color getStyleBackgroundColor(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 NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
if (styleModel == null) {
continue;
}
final Color styleColor = styleModel.getBackgroundColor();
if (styleColor == null) {
continue;
}
return styleColor;
}
return null;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getStyleTextColor.
private Color getStyleTextColor(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 NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
if (styleModel == null) {
continue;
}
final Color styleColor = styleModel == null ? null : styleModel.getColor();
if (styleColor == null) {
continue;
}
return styleColor;
}
return null;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getNodeNumbering.
public boolean getNodeNumbering(NodeModel node) {
if (SummaryNode.isFirstGroupNode(node) || SummaryNode.isSummaryNode(node))
return false;
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 Boolean numbering = NodeStyleModel.getNodeNumbering(styleNode);
if (numbering != null) {
return numbering;
}
}
return false;
}
Aggregations