use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class SetBooleanMapPropertyAction method setSelected.
@Override
public void setSelected() {
try {
final Controller controller = Controller.getCurrentController();
final NodeModel node = controller.getSelection().getSelected();
final ModeController modeController = controller.getModeController();
final MapStyle mapStyleController = MapStyle.getController(modeController);
final String value = mapStyleController.getPropertySetDefault(node.getMap(), propertyName);
boolean isSet = Boolean.parseBoolean(value);
setSelected(isSet);
} catch (Exception e) {
setSelected(false);
}
}
use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class MapView method requiredBackground.
private Color requiredBackground() {
final MapStyle mapStyle = getModeController().getExtension(MapStyle.class);
final Color mapBackground = mapStyle.getBackground(model);
return mapBackground;
}
use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class MapView method loadBackgroundImage.
private void loadBackgroundImage() {
final MapStyle mapStyle = getModeController().getExtension(MapStyle.class);
final String uriString = mapStyle.getProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE);
backgroundComponent = null;
if (uriString != null) {
URI uri = assignAbsoluteURI(uriString);
final ViewerController vc = getModeController().getExtension(ViewerController.class);
final IViewerFactory factory = vc.getCombiFactory();
if (uri != null) {
assignViewerToBackgroundComponent(factory, uri);
}
}
repaint();
}
use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class MapViewController method setZoom.
/* (non-Javadoc)
* @see org.freeplane.core.frame.IMapViewController#setZoom(float)
*/
public void setZoom(final float zoom) {
this.zoom = zoom;
final MapView mapView = getMapView();
if (mapView == null) {
return;
}
final MapModel map = mapView.getModel();
final MapStyle mapStyle = mapView.getModeController().getExtension(MapStyle.class);
if (mapView.getZoom() == zoom) {
return;
}
mapStyle.setZoom(map, zoom);
mapView.setZoom(zoom);
setZoomComboBox(zoom);
final Object[] messageArguments = { String.valueOf(zoom * 100f) };
final String stringResult = TextUtils.format("user_defined_zoom_status_bar", messageArguments);
controller.getViewController().out(stringResult);
}
use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class MapProxy method setBackgroundColor.
// Map: R/W
public void setBackgroundColor(Color color) {
final MapStyle mapStyle = (MapStyle) Controller.getCurrentModeController().getExtension(MapStyle.class);
final MapStyleModel model = (MapStyleModel) mapStyle.getMapHook();
mapStyle.setBackgroundColor(model, color);
}
Aggregations