Search in sources :

Example 1 with MapStyle

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);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapStyle(org.freeplane.features.styles.MapStyle) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 2 with MapStyle

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;
}
Also used : Color(java.awt.Color) MapStyle(org.freeplane.features.styles.MapStyle)

Example 3 with MapStyle

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();
}
Also used : MapStyle(org.freeplane.features.styles.MapStyle) IViewerFactory(org.freeplane.view.swing.features.filepreview.IViewerFactory) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) URI(java.net.URI)

Example 4 with MapStyle

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);
}
Also used : MapStyle(org.freeplane.features.styles.MapStyle) MapModel(org.freeplane.features.map.MapModel)

Example 5 with MapStyle

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);
}
Also used : MapStyleModel(org.freeplane.features.styles.MapStyleModel) MapStyle(org.freeplane.features.styles.MapStyle)

Aggregations

MapStyle (org.freeplane.features.styles.MapStyle)12 Controller (org.freeplane.features.mode.Controller)6 MapModel (org.freeplane.features.map.MapModel)5 Color (java.awt.Color)3 NodeModel (org.freeplane.features.map.NodeModel)3 ModeController (org.freeplane.features.mode.ModeController)3 MapStyleModel (org.freeplane.features.styles.MapStyleModel)3 URI (java.net.URI)2 File (java.io.File)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 JFileChooser (javax.swing.JFileChooser)1 ResourceController (org.freeplane.core.resources.ResourceController)1 MapController (org.freeplane.features.map.MapController)1 MFileManager (org.freeplane.features.url.mindmapmode.MFileManager)1 IViewerFactory (org.freeplane.view.swing.features.filepreview.IViewerFactory)1 ViewerController (org.freeplane.view.swing.features.filepreview.ViewerController)1