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; }
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; }
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 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. */ @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; }
/** * 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; }
/** * 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; }
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; }
public MapLayer next() { Layer layer = iter.next(); if (layer == null) { return null; } return new DefaultMapLayer(layer); }
public void addLayer(CollectionSource source, Style style) { // JG: for later when feature source extends source // if( source instanceof FeatureSource){ // addLayer( (FeatureSource) source, style); // } this.addLayer(new DefaultMapLayer(source, style, "")); }
public void addLayer(Collection collection, Style style) { if( collection instanceof FeatureCollection){ this.addLayer(new DefaultMapLayer((FeatureCollection)collection, style, "")); return; } this.addLayer(new DefaultMapLayer(collection, style, "")); }
/** * 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); }
/** * 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, "")); }