use of com.revolsys.swing.map.layer.elevation.ElevationModelLayer in project com.revolsys.open by revolsys.
the class RasterizerGriddedElevationModelLayerRenderer method addAddMenuItem.
private static void addAddMenuItem(final MenuFactory menu, final String type, final BiFunction<ElevationModelLayer, IMultipleGriddedElevationModelLayerRenderer, RasterizerGriddedElevationModelLayerRenderer> rendererFactory) {
final String iconName = ("style_" + type.replace(' ', '_') + ":add").toLowerCase();
final String name = "Add " + type + " Style";
Menus.addMenuItem(menu, "add", name, iconName, (final IMultipleGriddedElevationModelLayerRenderer parentRenderer) -> {
final ElevationModelLayer layer = parentRenderer.getLayer();
final RasterizerGriddedElevationModelLayerRenderer newRenderer = rendererFactory.apply(layer, parentRenderer);
parentRenderer.addRendererEdit(newRenderer);
}, false);
}
Aggregations