use of org.freeplane.features.styles.MapStyleModel 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.MapStyleModel in project freeplane by freeplane.
the class NodeStyleController method getHorizontalTextAlignment.
private HorizontalTextAlignment getHorizontalTextAlignment(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 HorizontalTextAlignment textAlignment = styleModel.getHorizontalTextAlignment();
if (textAlignment == null) {
continue;
}
return textAlignment;
}
return null;
}
use of org.freeplane.features.styles.MapStyleModel in project freeplane by freeplane.
the class NodeStyleController method getBorderDash.
private DashVariant getBorderDash(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 DashVariant borderDash = borderModel.getBorderDash();
if (borderDash == null) {
continue;
}
return borderDash;
}
return DashVariant.DEFAULT;
}
Aggregations