use of com.revolsys.swing.map.layer.elevation.gridded.renderer.RasterizerGriddedElevationModelLayerRenderer in project com.revolsys.open by revolsys.
the class GriddedElevationModelLayer method factoryInit.
public static void factoryInit() {
// Renderers
MapObjectFactoryRegistry.newFactory("rasterizerGriddedElevationModelLayerRenderer", RasterizerGriddedElevationModelLayerRenderer::new);
MapObjectFactoryRegistry.newFactory("multipleGriddedElevationModelLayerRenderer", MultipleGriddedElevationModelLayerRenderer::new);
MapObjectFactoryRegistry.newFactory("tiledMultipleGriddedElevationModelLayerRenderer", TiledMultipleGriddedElevationModelLayerRenderer::new);
// Layers
MapObjectFactoryRegistry.newFactory("griddedElevationModelLayer", "Gridded Elevation Model Layer", GriddedElevationModelLayer::new);
MapObjectFactoryRegistry.newFactory("tiledGriddedElevationModelLayer", "Tiled Gridded Elevation Model Layer", TiledGriddedElevationModelLayer::new);
// Menus
final EnableCheck enableCheck = RsSwingServiceInitializer.enableCheck(GriddedElevationModelReadFactory.class);
menuItemPathAddLayer("gridded_dem", "Add Gridded Elevation Model Layer", "gridded_dem", GriddedElevationModelReadFactory.class);
TreeNodes.addMenuItem(PathTreeNode.MENU, "gridded_dem", "Export Gridded Elevation Model", //
(final PathTreeNode node) -> actionExport(node)).setVisibleCheck(//
enableCheck).setIconName("gridded_dem", "save");
TreeNodes.addMenuItem(PathTreeNode.MENU, "gridded_dem", "Zoom to Gridded Elevation Model", (final PathTreeNode node) -> actionZoomTo(node)).setVisibleCheck(//
enableCheck).setIconName("gridded_dem", "magnifier");
}
use of com.revolsys.swing.map.layer.elevation.gridded.renderer.RasterizerGriddedElevationModelLayerRenderer in project com.revolsys.open by revolsys.
the class TiledGriddedElevationModelLayer method setStyle.
@SuppressWarnings("unchecked")
public void setStyle(Object style) {
if (style instanceof Map) {
final Map<String, Object> map = (Map<String, Object>) style;
style = MapObjectFactory.toObject(map);
}
if (style instanceof TiledMultipleGriddedElevationModelLayerRenderer) {
final TiledMultipleGriddedElevationModelLayerRenderer renderer = (TiledMultipleGriddedElevationModelLayerRenderer) style;
setRenderer(renderer);
} else if (style instanceof RasterizerGriddedElevationModelLayerRenderer) {
final TiledMultipleGriddedElevationModelLayerRenderer renderer = new TiledMultipleGriddedElevationModelLayerRenderer(this, (RasterizerGriddedElevationModelLayerRenderer) style);
setRenderer(renderer);
} else {
Logs.error(this, "Cannot create renderer for: " + style);
}
}
use of com.revolsys.swing.map.layer.elevation.gridded.renderer.RasterizerGriddedElevationModelLayerRenderer in project com.revolsys.open by revolsys.
the class GriddedElevationModelStylePanel method save.
@Override
public void save() {
final RasterizerGriddedElevationModelLayerRenderer renderer = getRenderer();
renderer.setRasterizer(this.rasterizer);
super.save();
}
use of com.revolsys.swing.map.layer.elevation.gridded.renderer.RasterizerGriddedElevationModelLayerRenderer in project com.revolsys.open by revolsys.
the class GriddedElevationModelLayer method setStyle.
@SuppressWarnings("unchecked")
public void setStyle(Object style) {
if (style instanceof Map) {
final Map<String, Object> map = (Map<String, Object>) style;
style = MapObjectFactory.toObject(map);
}
if (style instanceof MultipleGriddedElevationModelLayerRenderer) {
final MultipleGriddedElevationModelLayerRenderer renderer = (MultipleGriddedElevationModelLayerRenderer) style;
setRenderer(renderer);
} else if (style instanceof RasterizerGriddedElevationModelLayerRenderer) {
final MultipleGriddedElevationModelLayerRenderer renderer = new MultipleGriddedElevationModelLayerRenderer(this, (RasterizerGriddedElevationModelLayerRenderer) style);
setRenderer(renderer);
} else {
Logs.error(this, "Cannot create renderer for: " + style);
}
}
Aggregations