use of org.freeplane.features.styles.IStyle 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.IStyle in project freeplane by freeplane.
the class NodeStyleController method getBorderDashMatchesEdgeDash.
public Boolean getBorderDashMatchesEdgeDash(NodeModel node) {
final MapModel map = node.getMap();
final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
final Collection<IStyle> style = styleController.getStyles(node);
final Boolean borderDashMatchesEdgeDash = getBorderDashMatchesEdgeDash(map, style);
return borderDashMatchesEdgeDash;
}
use of org.freeplane.features.styles.IStyle 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;
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getStyleFont.
private Font getStyleFont(final Font baseFont, final MapModel map, final Collection<IStyle> collection) {
final MapStyleModel model = MapStyleModel.getExtension(map);
Boolean bold = null;
Boolean strikedThrough = null;
Boolean italic = null;
String fontFamilyName = null;
Integer fontSize = null;
for (IStyle styleKey : collection) {
final NodeModel styleNode = model.getStyleNode(styleKey);
if (styleNode == null) {
continue;
}
final NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
if (styleModel == null) {
continue;
}
if (bold == null)
bold = styleModel.isBold();
if (strikedThrough == null)
strikedThrough = styleModel.isStrikedThrough();
if (italic == null)
italic = styleModel.isItalic();
if (fontFamilyName == null)
fontFamilyName = styleModel.getFontFamilyName();
if (fontSize == null)
fontSize = styleModel.getFontSize();
if (bold != null && italic != null && fontFamilyName != null && fontSize != null && strikedThrough == null)
break;
}
return createFont(baseFont, fontFamilyName, fontSize, bold, italic, strikedThrough);
}
use of org.freeplane.features.styles.IStyle in project freeplane by freeplane.
the class NodeStyleController method getBorderWidth.
public Quantity<LengthUnits> getBorderWidth(NodeModel node) {
final MapModel map = node.getMap();
final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
final Collection<IStyle> style = styleController.getStyles(node);
final Quantity<LengthUnits> borderWidth = getBorderWidth(map, style);
return borderWidth;
}
Aggregations