use of org.freeplane.core.extension.IExtension in project freeplane by freeplane.
the class PersistentNodeHook method isActiveForSelection.
private boolean isActiveForSelection(Enum<?> value) {
final NodeModel[] nodes = getNodes();
for (int i = 0; i < nodes.length; i++) {
final NodeModel nodeModel = nodes[i];
final IExtension nodeValue = nodeModel.getExtension(getExtensionClass());
if (value == null && nodeValue != null || value != null && !value.equals(nodeValue)) {
return false;
}
}
return true;
}
use of org.freeplane.core.extension.IExtension in project freeplane by freeplane.
the class MapStyle method moveStyle.
private void moveStyle(final MapModel sourceMap, final MapModel targetMap, boolean overwrite) {
final MapStyleModel source = (MapStyleModel) sourceMap.getRootNode().removeExtension(MapStyleModel.class);
if (source == null)
return;
final IExtension undoHandler = targetMap.getExtension(IUndoHandler.class);
source.getStyleMap().putExtension(IUndoHandler.class, undoHandler);
final NodeModel targetRoot = targetMap.getRootNode();
final MapStyleModel target = MapStyleModel.getExtension(targetRoot);
if (target == null) {
targetRoot.addExtension(source);
} else {
target.copyFrom(source, overwrite);
}
}
use of org.freeplane.core.extension.IExtension in project freeplane by freeplane.
the class MapStyle method getBackground.
public Color getBackground(final MapModel map) {
final IExtension extension = map.getRootNode().getExtension(MapStyleModel.class);
final Color backgroundColor = extension != null ? ((MapStyleModel) extension).getBackgroundColor() : null;
if (backgroundColor != null) {
return backgroundColor;
}
final String stdcolor = ResourceController.getResourceController().getProperty(MapStyle.RESOURCES_BACKGROUND_COLOR);
final Color standardMapBackgroundColor = ColorUtils.stringToColor(stdcolor);
return standardMapBackgroundColor;
}
Aggregations