/** * Static convenience method: displays a {@code JSimpleStyleDialog} to prompt the user for style * preferences to use with the given {@code StyleLayer}. The layer's existing style, if any, * will be used to initialize the dialog. * * @param parent parent component (may be null) * @param layer the map layer * @return a new Style instance or null if the user cancels the dialog */ public static Style showDialog(Component parent, StyleLayer layer) { /* * Grid coverages and readers are not supported yet... */ if (layer instanceof RasterLayer) { JOptionPane.showMessageDialog( null, "Sorry, styling for for grid coverages is not working yet", "Style dialog", JOptionPane.WARNING_MESSAGE); return null; } SimpleFeatureType type = (SimpleFeatureType) layer.getFeatureSource().getSchema(); return showDialog(parent, type, layer.getStyle()); }
/** * Static convenience method: displays a {@code JSimpleStyleDialog} to prompt * the user for style preferences to use with the given {@code StyleLayer}. The * layer's existing style, if any, will be used to initialize the dialog. * * @param parent parent component (may be null) * @param layer the map layer * * @return a new Style instance or null if the user cancels the dialog */ public static Style showDialog(Component parent, StyleLayer layer) { /* * Grid coverages and readers are not supported yet... */ if (layer instanceof RasterLayer) { JOptionPane.showMessageDialog(null, "Sorry, styling for for grid coverages is not working yet", "Style dialog", JOptionPane.WARNING_MESSAGE); return null; } SimpleFeatureType type = (SimpleFeatureType) layer.getFeatureSource().getSchema(); return showDialog(parent, type, layer.getStyle()); }