use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class MapBackgroundImageAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final Controller controller = Controller.getCurrentController();
final MapController mapController = Controller.getCurrentModeController().getMapController();
final ViewerController vc = controller.getModeController().getExtension(ViewerController.class);
final NodeModel selectedNode = mapController.getSelectedNode();
if (selectedNode == null) {
return;
}
final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class);
final URI uri = vc.createURI(selectedNode);
if (uri == null) {
return;
}
final MapModel model = controller.getMap();
mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, uri.toString());
}
use of org.freeplane.features.styles.MapStyle in project freeplane by freeplane.
the class ViewLayoutTypeAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final MapView map = (MapView) Controller.getCurrentController().getMapViewManager().getMapViewComponent();
if (isSelected()) {
map.setLayoutType(MapViewLayout.MAP);
setSelected(false);
} else {
map.setLayoutType(layoutType);
setSelected(true);
}
final MapStyle mapStyle = (MapStyle) map.getModeController().getExtension(MapStyle.class);
mapStyle.setMapViewLayout(map.getModel(), map.getLayoutType());
map.anchorToSelected(map.getSelected(), 0.5f, 0.5f);
final NodeView root = map.getRoot();
invalidate(root);
root.revalidate();
}
Aggregations