Class Layer
java.lang.Object
com.vividsolutions.jump.workbench.model.AbstractLayerable
com.vividsolutions.jump.workbench.model.GeoReferencedLayerable
com.vividsolutions.jump.workbench.model.Layer
- All Implemented Interfaces:
Disposable, Layerable, LayerManagerProxy
- Direct Known Subclasses:
LayerView, ReferencedImagesLayer, SpatialDSLayer, SystemLayerFinder.NonSavePromptingLayer
Adds colour, line-width, and other stylistic information to a Feature
Collection.
When adding or removing multiple features to this Layer's FeatureCollection, prefer #addAll and #removeAll to #add and #remove -- fewer events will be fired.
-
Constructor Summary
ConstructorsConstructorDescriptionLayer()Called by Java2XMLLayer(String name, Color fillColor, FeatureCollection featureCollection, LayerManager layerManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeatureSchemaOperation(String expression) voidstatic UndoableCommandaddUndo(String layerName, LayerManagerProxy proxy, UndoableCommand wrappeeCommand) Enables a layer to be changed undoably.static ColordefaultLineColor(Color fillColor) voiddispose()Releases references to the data, to facilitate garbage collection.Returns a wrapper around the FeatureCollection which was added using #wrapFeatureCollection.Styles do not notify the Layer when their parameters change.get a list of all stylesget a list of all styles matching the parameter classgetStylesIfEnabled(Class<?> filter) get a list of all enabled styles matching the parameter classbooleanbooleanbooleanbooleanvoidremoveStyle(Style p) setDataSourceQuery(DataSourceQuery dataSourceQuery) voidsetDescription(String description) voidsetDrawingLast(boolean drawingLast) Used for lightweight layers like the Vector layer.voidsetFeatureCollection(FeatureCollection featureCollection) setFeatureCollectionModified(boolean featureCollectionModified) protected voidsetFeatureCollectionWrapper(FeatureCollectionWrapper featureCollectionWrapper) voidsetLayerManager(LayerManager layerManager) Called by Java2XMLvoidsetStyles(Collection<Style> newStyles) voidsetSynchronizingLineColor(boolean synchronizingLineColor) static voidtryToInvalidateEnvelope(Layer layer) Does nothing if the underlying feature collection is not a FeatureDataset.Methods inherited from class GeoReferencedLayerable
getBlackboard, getEnvelope, getSrsInfo, setEnvelope, setSrsInfoMethods inherited from class AbstractLayerable
fireAppearanceChanged, fireLayerChanged, getLayerManager, getMaxScale, getMinScale, getName, getTask, isEditable, isReadonly, isScaleDependentRenderingEnabled, isSelectable, isVisible, setEditable, setMaxScale, setMinScale, setName, setReadonly, setScaleDependentRenderingEnabled, setSelectable, setVisible, toString
-
Constructor Details
-
Layer
public Layer()Called by Java2XML -
Layer
public Layer(String name, Color fillColor, FeatureCollection featureCollection, LayerManager layerManager)
-
-
Method Details
-
defaultLineColor
-
setDescription
-
setDrawingLast
public void setDrawingLast(boolean drawingLast) Used for lightweight layers like the Vector layer.- Parameters:
drawingLast- true if the layer should be among those drawn last
-
setFeatureCollection
-
setSynchronizingLineColor
public void setSynchronizingLineColor(boolean synchronizingLineColor) -
getBasicStyle
-
getVertexStyle
-
getLabelStyle
-
getDescription
-
getFeatureCollectionWrapper
Returns a wrapper around the FeatureCollection which was added using #wrapFeatureCollection. The original FeatureCollection can be retrieved using FeatureCollectionWrapper#getWrappee. However, parties are encouraged to use the FeatureCollectionWrapper instead, so that feature additions and removals cause FeatureEvents to be fired (by the Layer).- Returns:
- the FeatureCollectionWrapper containing features
-
setFeatureCollectionWrapper
-
getStyle
Styles do not notify the Layer when their parameters change. Therefore, after you modify a Style's parameters (for example, the fill colour of BasicStyle), be sure to call #fireAppearanceChanged- Parameters:
c- Can even be the desired Style's superclass or interface- Returns:
- The style value
-
getStylesIfEnabled
-
getStyles
-
getStyles
-
hasReadableDataSource
public boolean hasReadableDataSource() -
isDrawingLast
public boolean isDrawingLast() -
isSynchronizingLineColor
public boolean isSynchronizingLineColor() -
addStyle
-
dispose
public void dispose()Releases references to the data, to facilitate garbage collection. Important for MDI apps like the JUMP Workbench. Called when the last JInternalFrame viewing the LayerManager is closed (i.e. internal frame's responsibility). To conserve memory, if layers are frequently added and removed from the LayerManager, parties may want to call #dispose themselves rather than waiting for the internal frame to be closed.- Specified by:
disposein interfaceDisposable
-
removeStyle
-
cloneStyles
-
setStyles
-
setLayerManager
Description copied from interface:LayerableCalled by Java2XML- Specified by:
setLayerManagerin interfaceLayerable- Overrides:
setLayerManagerin classAbstractLayerable- Parameters:
layerManager- the LayerManager
-
addUndo
public static UndoableCommand addUndo(String layerName, LayerManagerProxy proxy, UndoableCommand wrappeeCommand) Enables a layer to be changed undoably. Since the layer's features are saved, only use this method for layers with few features.- Parameters:
layerName- the target Layer nameproxy- a LayerManager proxywrappeeCommand- the undoable command- Returns:
- the command to be executed
-
tryToInvalidateEnvelope
Does nothing if the underlying feature collection is not a FeatureDataset.- Parameters:
layer- the Layer whose envelope must be invalidated
-
getDataSourceQuery
-
setDataSourceQuery
-
isFeatureCollectionModified
public boolean isFeatureCollectionModified() -
setFeatureCollectionModified
-
getFeatureSchemaOperations
-
addFeatureSchemaOperation
-