public MapLayerListEvent(MapContent map, Layer element, int index) { super(map); this.layer = element; this.mapLayer = element == null ? null : new DefaultMapLayer(element); this.fromIndex = index; this.toIndex = index; }
layer = new DefaultMapLayer(source, layerStyle); layer.setTitle(layers[i].getName()); definitionQuery.setMaxFeatures(maxFeatures); layer.setQuery(definitionQuery); map.addLayer(layer); } else if (layers[i].getType() == MapLayerInfo.TYPE_VECTOR) { layer = new DefaultMapLayer(source, layerStyle); layer.setTitle(layers[i].getName()); definitionQuery.setMaxFeatures(maxFeatures); layer.setQuery(definitionQuery); map.addLayer(layer); } else if (layers[i].getType() == MapLayerInfo.TYPE_RASTER) { .getReadParameters(); layer = new DefaultMapLayer(FeatureUtilities.wrapGridCoverageReader( reader, CoverageUtils.getParameters(params, layers[i] .getCoverage().getParameters())), layerStyle); layer.setTitle(layers[i].getName()); layer.setQuery(Query.ALL); map.addLayer(layer); } catch (IllegalArgumentException e) {
/** * Setter for property visible. * * @param visible * New value of property visible. */ public void setVisible(boolean visible) { if (this.visible == visible) { return; } // change visibility and fire events this.visible = visible; MapLayerEvent event = new MapLayerEvent(this, MapLayerEvent.VISIBILITY_CHANGED); if (visible) { fireMapLayerListenerLayerShown(event); } else { fireMapLayerListenerLayerHidden(event); } }
public void changed(FeatureEvent featureEvent) { fireMapLayerListenerLayerChanged(new MapLayerEvent( DefaultMapLayer.this, MapLayerEvent.DATA_CHANGED)); } };
/** * Setter for property title. * * @param title * New value of property title. * * @throws NullPointerException * DOCUMENT ME! */ public void setTitle(String title) { if (title == null) { throw new NullPointerException(); } this.title = title; fireMapLayerListenerLayerChanged(new MapLayerEvent(this, MapLayerEvent.METADATA_CHANGED)); }
public MapLayerListEvent(MapContent map, Layer element, int fromIndex, int toIndex) { super(map); this.layer = element; this.mapLayer = element == null ? null : new DefaultMapLayer(element); this.fromIndex = fromIndex; this.toIndex = toIndex; }
/** * Setter for property style. * * @param style * New value of property style. * * @throws NullPointerException * DOCUMENT ME! */ public void setStyle(Style style) { if (style == null) { throw new NullPointerException(); } this.style = style; fireMapLayerListenerLayerChanged(new MapLayerEvent(this, MapLayerEvent.STYLE_CHANGED)); }
public MapLayerListEvent( MapContent map, Layer element, int index, MapLayerEvent mapLayerEvent) { super(map); this.layer = element; this.mapLayer = element == null ? null : new DefaultMapLayer(element); this.fromIndex = index; this.toIndex = index; this.mapLayerEvent = mapLayerEvent; }
fireMapLayerListenerLayerChanged(new MapLayerEvent(this, MapLayerEvent.FILTER_CHANGED));
public MapLayer next() { Layer layer = iter.next(); if (layer == null) { return null; } return new DefaultMapLayer(layer); }
/** * Return the requested layer. * * @param index index of layer to return. * @return the layer at the specified position * @throws IndexOutOfBoundsException if the index is out of range */ @SuppressWarnings("deprecation") public MapLayer getLayer(int index) throws IndexOutOfBoundsException { Layer layer = layers().get(index); return new DefaultMapLayer(layer); }
/** * Remove a layer and trigger a {@link LayerListEvent}. * * @param index The index of the layer that it's going to be removed * @return the layer removed, if any */ public MapLayer removeLayer(int index) { Layer removed = layers().remove(index); return new DefaultMapLayer(removed); }
/** * Remove the layer at the given position in the list of layers held by this context. The * position must be valid or an IndexOutOfBoundsException will result. CAlling this method * triggers a {@linkplain MapLayerListEvent}. * * @param index the position of the layer in this context's list of layers * @return the layer that was removed */ public MapLayer removeLayer(int index) { Layer removed = layers().remove(index); return new DefaultMapLayer(removed); }
/** * Add a new layer and trigger a {@link LayerListEvent}. * * @param featureSource a SimpleFeatureSource with the new layer that will be added. */ public void addLayer(FeatureSource featureSource, Style style) { addLayer(new DefaultMapLayer(featureSource, style, "")); }
/** * Return the requested layer. * * @param index index of layer to return. * @return the layer at the specified position * @throws IndexOutOfBoundsException if the index is out of range */ public MapLayer getLayer(int index) throws IndexOutOfBoundsException { Layer layer = layers().get(index); return new DefaultMapLayer(layer); }
/** * Return this model's list of layers. If no layers are present, then an empty array is * returned. * * @return This model's list of layers. */ public MapLayer[] getLayers() { MapLayer[] array = new MapLayer[layers().size()]; int index = 0; for (Iterator<Layer> iter = layers().iterator(); iter.hasNext(); index++) { Layer layer = iter.next(); array[index] = new DefaultMapLayer(layer); } return array; }
/** * Return this model's list of layers. If no layers are present, then an empty array is * returned. * * @return This model's list of layers. */ @SuppressWarnings("deprecation") public MapLayer[] getLayers() { MapLayer[] array = new MapLayer[layers().size()]; int index = 0; for (Iterator<Layer> iter = layers().iterator(); iter.hasNext(); index++) { Layer layer = iter.next(); array[index] = new DefaultMapLayer(layer); } return array; }
/** * Add the given feature source as a new layer to the end of the list of layers held by this * context and trigger a {@linkplain MapLayerListEvent}. This is a convenience method equivalent * to {@linkplain #addLayer}(new DefaultMapLayer(featureSource, style). * * <p>If a coordinate reference system has not been set for the context an attempt is made to * retrieve one from the new layer and use that as the context's CRS. * * <p>If {@code style} is null, a default style is created using {@linkplain * SLD#createSimpleStyle(org.opengis.feature.simple.SimpleFeatureType)}. * * @param featureSource the source of the features for the new layer * @param style a Style object to be used in rendering this layer. */ public void addLayer(FeatureSource featureSource, Style style) { // checkCRS(featureSource); Style layerStyle = checkStyle(style, featureSource.getSchema()); addLayer(new DefaultMapLayer(featureSource, layerStyle, "")); }
public MapLayerListEvent(MapContent map, Layer element, int index, MapLayerEvent mapLayerEvent) { super(map); this.layer = element; this.mapLayer = element == null ? null : new DefaultMapLayer(element); this.fromIndex = index; this.toIndex = index; this.mapLayerEvent = mapLayerEvent; }
public MapLayerListEvent(MapContent map, Layer element, int index) { super(map); this.layer = element; this.mapLayer = element == null ? null : new DefaultMapLayer(element); this.fromIndex = index; this.toIndex = index; }