use of org.freeplane.features.styles.MapStyleModel in project freeplane by freeplane.
the class NodeStyleController method getDefaultFont.
public Font getDefaultFont(final MapModel map, final IStyle style) {
final MapStyleModel model = MapStyleModel.getExtension(map);
final NodeModel styleNode = model.getStyleNodeSafe(style);
return getFont(styleNode);
}
use of org.freeplane.features.styles.MapStyleModel 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.MapStyleModel 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.MapStyleModel 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;
}
use of org.freeplane.features.styles.MapStyleModel in project freeplane by freeplane.
the class MapView method updateContentStyle.
private void updateContentStyle() {
final NodeStyleController style = Controller.getCurrentModeController().getExtension(NodeStyleController.class);
MapModel map = getModel();
final MapStyleModel model = MapStyleModel.getExtension(map);
final NodeModel detailStyleNode = model.getStyleNodeSafe(MapStyleModel.DETAILS_STYLE);
detailFont = UITools.scale(style.getFont(detailStyleNode));
detailBackground = style.getBackgroundColor(detailStyleNode);
detailForeground = style.getColor(detailStyleNode);
detailHorizontalAlignment = style.getHorizontalTextAlignment(detailStyleNode).swingConstant;
final NodeModel noteStyleNode = model.getStyleNodeSafe(MapStyleModel.NOTE_STYLE);
noteFont = UITools.scale(style.getFont(noteStyleNode));
noteBackground = style.getBackgroundColor(noteStyleNode);
noteForeground = style.getColor(noteStyleNode);
noteHorizontalAlignment = style.getHorizontalTextAlignment(noteStyleNode).swingConstant;
}
Aggregations