public class FLyrVect extends FLyrDefault implements VectorLayer, LegendContentsChangedListener, Observer
| Modifier and Type | Class and Description |
|---|---|
protected class |
FLyrVect.EnvelopeCantBeInitializedException |
static class |
FLyrVect.SelfRegister |
FLyrDefault.RegisterMetadata, FLyrDefault.RegisterPersistence| Modifier and Type | Field and Description |
|---|---|
protected ILabelingStrategy |
strategy |
static java.lang.String |
TAG_LAYERVECT_MAXSCALE |
static java.lang.String |
TAG_LAYERVECT_MINSCALE |
drawVersion, layerListeners, metadataContainer, propertiesMETADATA_CRS, METADATA_DEFINITION_DESCRIPTION, METADATA_DEFINITION_NAME, METADATA_NAME| Constructor and Description |
|---|
FLyrVect() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBaseFilter(Evaluator filter) |
void |
addBaseFilter(java.lang.String filter) |
boolean |
allowLinks()
Deprecated.
the hiperlink functionaliti is out the layer now
|
protected void |
bindToDataStore(DataStore dataStore)
Enlaza la capa con el DataStore indicado.
|
protected void |
cleanLoadOptions() |
void |
clearSpatialCache()
Deprecated.
|
FLayer |
cloneLayer()
This method can be used to have a fast cloned layer.
|
FeatureQuery |
createFeatureQuery() |
FeatureQuery |
createQueryByGeometry(Geometry geom,
FeatureType featureType) |
FeatureQuery |
createQueryByPoint(double x,
double y,
double tol,
FeatureType featureType) |
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale)
Draws using IFeatureIterator.
|
void |
drawLabels(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
double dpi)
Causes the labels to be drawn.
|
static Envelope |
fromViewPortCRSToSourceCRS(FLayer lyr,
Envelope env)
Returns envelope in layer's data source CRS from envelope provided in
viewport CRS
|
static Geometry |
fromViewPortCRSToSourceCRS(FLayer lyr,
Geometry geo,
boolean clone)
Deprecated.
use the transformToSourceCRS method of layer.
|
FeatureQuery |
getBaseQuery() |
DataStore |
getDataStore()
Return the store associated to the layer.
|
DataStoreParameters |
getDataStoreParameters() |
FeatureStore |
getFeatureStore() |
Envelope |
getFullEnvelope()
Returns the full extension of the layer node.
|
GeometryType |
getGeometryType()
Returns the layer's geometry type
|
DynObjectSet |
getInfo(Point p,
double tolerance)
Executes a consultation about information of a point on the layer.
|
DynObjectSet |
getInfo(java.awt.Point p,
double tolerance,
Cancellable cancel)
Executes a consultation about information of a point on the layer.
|
DynObjectSet |
getInfo(java.awt.Point p,
double tolerance,
Cancellable cancel,
boolean fast)
Executes a consultation about information of a point on the layer.
|
java.lang.String |
getInfoString()
Returns an string with the information of this layer.
|
ILabelingStrategy |
getLabelingStrategy()
Returns the current labeling strategy
|
ILegend |
getLegend()
Devuelve la Leyenda de la capa.
|
java.util.Set |
getMetadataChildren()
Returns an unsorted set of child Metadata objects.
|
java.lang.Object |
getMetadataID()
Returns the unique identifier of the Metadata.
|
IProjection |
getProjection()
Returns the current projection.
|
java.lang.Object |
getProperty(java.lang.Object key)
Returns a reference to an object (property) associated to this layer.
|
int |
getShapeType()
Returns the type of the shape.
|
SpatialCache |
getSpatialCache() |
java.lang.String |
getTocImageIcon()
Returns the image icon that will be shown in the TOC next to this layer.
|
GeometryType |
getTypeVectorLayer() |
void |
invalidate() |
boolean |
isEditing()
Returns if this layer is editable.
|
boolean |
isLabeled()
Returns true if labels are drawn, or false otherwise.
|
boolean |
isLayerToSnap() |
boolean |
isPropertiesMenuVisible()
This method returns a boolean that is used by the FPopMenu to make
visible the properties menu or not.
|
boolean |
isSpatialCacheEnabled()
Deprecated.
|
boolean |
isTemporary() |
boolean |
isWritable()
Returns the writing status of this layer.
|
java.util.Iterator |
iterator() |
void |
legendCleared(LegendClearEvent event) |
void |
load()
Executes the initialization operations of this layer.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
print(java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties)
Prints this layer according to some properties requested.
|
void |
printLabels(java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties) |
protected void |
putLoadLegend() |
protected void |
putLoadSelection() |
FeatureSet |
queryByContainedInEnvelope(Envelope envelope,
FeatureType featureType) |
FeatureSet |
queryByContainedInEnvelope(Envelope envelope,
FeatureType featureType,
java.lang.String[] names) |
FeatureSet |
queryByContainedInGeometry(Geometry geom,
FeatureType featureType) |
FeatureSet |
queryByEnvelope(Envelope envelope,
FeatureType featureType)
It return the
FeatureSet that intersects with the envelope. |
FeatureSet |
queryByEnvelope(Envelope envelope,
FeatureType featureType,
java.lang.String[] names)
It return the
FeatureSet that intersects with the envelope. |
FeatureSet |
queryByGeometry(Geometry geom,
FeatureType featureType)
Input geom must be in the CRS of the view.
|
FeatureSet |
queryByPoint(java.awt.geom.Point2D mapPoint,
double tol,
FeatureType featureType)
Deprecated.
|
FeatureSet |
queryByPoint(Point point,
double tol,
FeatureType featureType) |
void |
refreshSpatialCache(Envelope envelope) |
void |
reload()
Tries recover a layer of a possible error.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setBaseQuery(FeatureQuery baseQuery) |
void |
setDataStore(DataStore dataStore)
Deprecated.
|
void |
setDataStoreParameters(DataStoreParameters parameters) |
void |
setEditing(boolean b)
Do nothing.
|
void |
setIsLabeled(boolean isLabeled)
Enables or disables the label drawing.
|
void |
setLabelingStrategy(ILabelingStrategy strategy)
Sets the new labeling strategy.
|
void |
setLayerToSnap(boolean enable) |
void |
setLegend(IVectorLegend legend)
Sets the layer's legend as a vector legend.
|
protected void |
setLoadLegend(IVectorLegend legend) |
protected void |
setLoadSelection(java.lang.Object xml) |
void |
setMaxFeaturesInEditionCache(int maxFeatures)
Siempre es un numero mayor de 1000
|
void |
setSpatialCacheEnabled(boolean spatialCacheEnabled)
Deprecated.
|
void |
setVisible(boolean visibility)
Changes the status of this layer to visible or not.
|
boolean |
symbolChanged(SymbolLegendEvent e)
Invocado cuando se cambia en el legend el símbolo por defecto.
|
java.lang.String |
toString()
Sobreimplementación del método toString para que las bases de datos
identifiquen la capa.
|
Geometry |
transformToSourceCRS(Geometry geom,
boolean clone) |
void |
update(Observable observable,
java.lang.Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
activationChanged, addError, addLayerListener, addLegendListener, callEditionChanged, callLegendChanged, clear, delegate, drawValueChanged, editionChanged, getClassName, getCoordTrans, getDefaultTolerance, getDrawVersion, getDynClass, getDynValue, getError, getErrors, getExtendedProperties, getFLayerStatus, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMetadataName, getMinScale, getName, getNumErrors, getParentLayer, getTocStatusImage, getTransparency, hasChangedForDrawing, hasDynValue, hidesThisArea, implement, invokeDynMethod, invokeDynMethod, isActive, isAvailable, isInTOC, isOk, isVisible, isWithinScale, nameChanged, newComposedLayer, removeLayerListener, removeLegendListener, reProject, setActive, setAvailable, setCoordTrans, setDynValue, setError, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setProperty, setTemporary, setTocStatusImage, setTransparency, updateDrawVersion, updateDrawVersion, visibilityChanged, visibleRequired, wakeUpdispose, disposeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddError, addLayerListener, getCoordTrans, getDefaultTolerance, getDrawVersion, getError, getErrors, getFLayerStatus, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMinScale, getName, getNumErrors, getParentLayer, getTocStatusImage, isActive, isAvailable, isInTOC, isOk, isVisible, isWithinScale, newComposedLayer, removeLayerListener, setActive, setAvailable, setCoordTrans, setError, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setTemporary, visibleRequiredgetMetadataNameclear, clone, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValuedisposegetExtendedProperties, setPropertyaddLegendListener, removeLegendListenerpublic static final java.lang.String TAG_LAYERVECT_MAXSCALE
public static final java.lang.String TAG_LAYERVECT_MINSCALE
protected ILabelingStrategy strategy
public java.lang.String getTocImageIcon()
FLayergetTocImageIcon in interface FLayergetTocImageIcon in class FLyrDefaultnull if there isn't anypublic DataStore getDataStore()
getDataStore in interface HasDataStoregetDataStore in interface SingleLayerpublic void setDataStore(DataStore dataStore) throws LoadLayerException
bindToDataStore(DataStore)setDataStore in interface SingleLayerdataStore - LoadLayerExceptionpublic void setDataStoreParameters(DataStoreParameters parameters)
public void setVisible(boolean visibility)
FLayerChanges the status of this layer to visible or not.
One layer is visible if it's check box associated is selected. This means
that layer will tried to be painted. If the data associated isn't available,
then this property will change to false.
setVisible in interface FLayersetVisible in class FLyrDefaultvisibility - the boolean to be setFLayer.isVisible(),
FLayer.visibleRequired(),
FLayer.isAvailable()protected void bindToDataStore(DataStore dataStore) throws LoadLayerException
dataStore - LoadLayerExceptionpublic Envelope getFullEnvelope() throws ReadException
FLayergetFullEnvelope in interface FLayerReadException - if fails the driver used in this method.public void setBaseQuery(FeatureQuery baseQuery)
setBaseQuery in interface VectorLayerpublic FeatureQuery getBaseQuery()
getBaseQuery in interface VectorLayerpublic void addBaseFilter(Evaluator filter)
addBaseFilter in interface VectorLayerpublic void addBaseFilter(java.lang.String filter)
addBaseFilter in interface VectorLayerpublic void draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale)
throws ReadException
draw in interface FLayerimage - g - viewPort - cancel - scale - ReadDriverExceptionReadException - if fails the driver used in this method.FLayer.print(Graphics2D, ViewPort, Cancellable, double, PrintAttributes)public void print(java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties)
throws ReadException
FLayerprint in interface FLayerg - for rendering 2-dimensional shapes, text and images on the Java(tm) platformviewPort - the information for drawing the layerscancel - an object thread that implements the Cancellable interface, and will allow to cancel the drawscale - the scale of the view. Must be between FLayer.getMinScale() and FLayer.getMaxScale().properties - a set with the settings to be applied to a whole print job and to all the docs in the print jobReadException - if fails the driver used in this method.FLayer.draw(BufferedImage, Graphics2D, ViewPort, Cancellable, double)public void setLegend(IVectorLegend legend) throws LegendLayerException
ClassifiableVectorialSets the layer's legend as a vector legend.
setLegend in interface ClassifiableVectoriallegend - the legend with vector dataLegendLayerException - if fails setting the legend to this layer.public ILegend getLegend()
getLegend in interface Classifiablepublic int getShapeType()
throws ReadException
ClassifiableReturns the type of the shape.
All geometry types are defined in Geometry.TYPES.
For getting the equivalent shape of a geometry type, you must use a method like
SHPFileWrite#getShapeType().
getShapeType in interface ClassifiableReadExceptionGeometry,
Constantpublic GeometryType getGeometryType() throws ReadException
getGeometryType in interface ClassifiableReadException - if there is an error getting the geometry typepublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentsaveToState in class FLyrDefaultPersistenceExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentloadFromState in class FLyrDefaultPersistenceExceptionpublic java.lang.String toString()
toString in class FLyrDefaultpublic boolean isEditing()
FLayerReturns if this layer is editable.
One layer is editable if user can modify its information with graphical tools.
isEditing in interface FLayerisEditing in class FLyrDefaulttrue if this layer is editable; false otherwiseFLayer.setEditing(boolean)public void setEditing(boolean b)
throws StartEditionLayerException
FLayersetEditing in interface FLayersetEditing in class FLyrDefaultStartEditionLayerExceptionpublic void clearSpatialCache()
getSpatialCache()public boolean isSpatialCacheEnabled()
getSpatialCache()public void setSpatialCacheEnabled(boolean spatialCacheEnabled)
getSpatialCache()public SpatialCache getSpatialCache()
public void refreshSpatialCache(Envelope envelope)
public void setMaxFeaturesInEditionCache(int maxFeatures)
maxFeatures - public boolean isPropertiesMenuVisible()
public void reload()
throws ReloadLayerException
FLayerTries recover a layer of a possible error.
If it has any problem during the load, marks the availability to false and throws an exception.
reload in interface FLayerreload in class FLyrDefaultReloadLayerException - if it's thrown a ReadException or an
IOException during the load of this layer.FLayer.load()protected void setLoadSelection(java.lang.Object xml)
protected void setLoadLegend(IVectorLegend legend)
protected void putLoadSelection()
protected void putLoadLegend()
throws LegendLayerException
LegendLayerExceptionprotected void cleanLoadOptions()
public boolean isWritable()
FLayerReturns the writing status of this layer.
One layer is writable if there is a writing driver for this layer.
isWritable in interface FLayerisWritable in class FLyrDefaulttrue if there is a writing driver for this layer; false otherwisepublic FLayer cloneLayer() throws java.lang.Exception
FLayerThis method can be used to have a fast cloned layer.
The implementations should take care of not recreate this layer. Instead of this, is better to use the same source (driver) and deepclone the legend. Exception: the labels aren't deepcloned to avoid memory consumption.
Note: Labels are memory consuming to speed up layers like PostGIS and so on.
cloneLayer in interface FLayercloneLayer in class FLyrDefaultjava.lang.Exception - any exception produced during the cloning of this layer.public boolean isLabeled()
ILabelableisLabeled in interface ILabelablepublic void setIsLabeled(boolean isLabeled)
ILabelablesetIsLabeled in interface ILabelablepublic ILabelingStrategy getLabelingStrategy()
ILabelablegetLabelingStrategy in interface ILabelableILabelingStrategypublic void setLabelingStrategy(ILabelingStrategy strategy)
ILabelablesetLabelingStrategy in interface ILabelablepublic void drawLabels(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
double dpi)
throws ReadException
ILabelabledrawLabels in interface ILabelableReadExceptionpublic void printLabels(java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties)
throws ReadException
printLabels in interface ILabelableReadExceptionpublic boolean allowLinks()
allowLinks in interface FLayerallowLinks in class FLyrDefaultpublic void load()
throws LoadLayerException
FLayerExecutes the initialization operations of this layer. This method is invoked only one time during the life of this layer and just before visualize it.
load in interface FLayerload in class FLyrDefaultLoadLayerException - if fails loading the layer.FLayer.reload()public FeatureStore getFeatureStore()
getFeatureStore in interface VectorLayerpublic FeatureQuery createFeatureQuery()
createFeatureQuery in interface VectorLayerpublic FeatureSet queryByPoint(java.awt.geom.Point2D mapPoint, double tol, FeatureType featureType) throws DataException
queryByPoint(org.gvsig.fmap.geom.primitive.Point, double, FeatureType)DataExceptionpublic FeatureSet queryByPoint(Point point, double tol, FeatureType featureType) throws DataException
DataExceptionpublic FeatureQuery createQueryByPoint(double x, double y, double tol, FeatureType featureType) throws DataException
DataExceptionpublic FeatureSet queryByGeometry(Geometry geom, FeatureType featureType) throws DataException
geom - featureType - DataExceptionpublic FeatureQuery createQueryByGeometry(Geometry geom, FeatureType featureType) throws DataException
DataExceptionpublic FeatureSet queryByContainedInGeometry(Geometry geom, FeatureType featureType) throws DataException
DataExceptionpublic FeatureSet queryByEnvelope(Envelope envelope, FeatureType featureType) throws DataException
FeatureSet that intersects with the envelope.envelope - envelope that defines the area for the query.featureType - only the features with this feature type are used in
the query.DataExceptionpublic FeatureSet queryByEnvelope(Envelope envelope, FeatureType featureType, java.lang.String[] names) throws DataException
FeatureSet that intersects with the envelope.envelope - envelope that defines the area for the query in viewport
CRSfeatureType - only the features with this feature type are used in
the query.names - the feature attributes that have to be checked.DataExceptionpublic FeatureSet queryByContainedInEnvelope(Envelope envelope, FeatureType featureType) throws DataException
DataExceptionpublic FeatureSet queryByContainedInEnvelope(Envelope envelope, FeatureType featureType, java.lang.String[] names) throws DataException
DataExceptionpublic DynObjectSet getInfo(java.awt.Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException
InfoByPointExecutes a consultation about information of a point on the layer.
There is an area around the point where will got the information.
getInfo in interface InfoByPointp - point where is the consultationtolerance - permissible margin around the coordinates of the point where
the method will got the information. Each
singular implementation of this method would use it in a
different way. The coordinates also depend on the
implementation.cancel - shared object that determines if this layer can continue being
drawnLoadLayerException - any exception produced using the driver.DataException - TODOpublic DynObjectSet getInfo(java.awt.Point p, double tolerance, Cancellable cancel, boolean fast) throws LoadLayerException, DataException
InfoByPointExecutes a consultation about information of a point on the layer.
There is an area around the point where will got the information.
getInfo in interface InfoByPointp - point where is the consultationtolerance - permissible margin around the coordinates of the point where
the method will got the information. Each
singular implementation of this method would use it in a
different way. The coordinates also depend on the
implementation.cancel - shared object that determines if this layer can continue being
drawnfast - if true try to reuse objects as much as possible to make the
object iteration faster. If true, DynObjects got through the
returned set must not be stored unless cloned.LoadLayerException - any exception produced using the driver.DataException - TODOpublic DynObjectSet getInfo(Point p, double tolerance) throws LoadLayerException, DataException
InfoByPointExecutes a consultation about information of a point on the layer.
There is an area around the point where will got the information.
getInfo in interface InfoByPointp - point in map coordinates where is the consultationtolerance - permissible margin around the coordinates of the point where
the method will got the information. Each
singular implementation of this method would use it in a
different way. The unit are in map coordinates.LoadLayerExceptionDataExceptionpublic void legendCleared(LegendClearEvent event)
legendCleared in interface LegendContentsChangedListenerpublic boolean symbolChanged(SymbolLegendEvent e)
LegendContentsChangedListenersymbolChanged in interface LegendContentsChangedListenere - SymbolLegendEventpublic void update(Observable observable, java.lang.Object notification)
ObserverObservable object is changed and this
Observer has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer and other Observers listening to the same
Observable.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver and prepare this method
implementation to handle receiving DefaultComplexNotification instances
as well as direct notification objects.
public void setLayerToSnap(boolean enable)
public boolean isLayerToSnap()
public java.util.Set getMetadataChildren()
MetadatagetMetadataChildren in interface Metadatapublic java.lang.Object getMetadataID()
throws MetadataException
MetadatagetMetadataID in interface MetadataMetadataExceptionpublic GeometryType getTypeVectorLayer() throws DataException, LocatorException, GeometryTypeNotSupportedException, GeometryTypeNotValidException
protected void doDispose()
throws BaseException
AbstractDisposableAbstractDisposable.dispose() method, to be
implemented by child classes.doDispose in class AbstractDisposableBaseExceptionAbstractDisposable.dispose()public static Envelope fromViewPortCRSToSourceCRS(FLayer lyr, Envelope env)
lyr - env - public static Geometry fromViewPortCRSToSourceCRS(FLayer lyr, Geometry geo, boolean clone)
lyr - geo - clone - public java.util.Iterator iterator()
public java.lang.String getInfoString()
FLayergetInfoString in interface FLayergetInfoString in class FLyrDefaultpublic boolean isTemporary()
isTemporary in interface FLayerisTemporary in class FLyrDefaultpublic DataStoreParameters getDataStoreParameters()
public IProjection getProjection()
ProjectedReturns the current projection.
getProjection in interface ProjectedgetProjection in class FLyrDefaultProjected.reProject(ICoordTrans)public void invalidate()
invalidate in interface FLayerinvalidate in class FLyrDefaultpublic java.lang.Object getProperty(java.lang.Object key)
ExtendedPropertiesSupportReturns a reference to an object (property) associated to this layer.
For example, you can attach a network definition to key "network" and check if a layer has a network loaded using getAssociatedObject("network") and that it's not null.
getProperty in interface ExtendedPropertiesSupportgetProperty in class FLyrDefaultkey - the key associated to the propertynull if key is not foundExtendedPropertiesSupport.getExtendedProperties(),
ExtendedPropertiesSupport.setProperty(Object, Object)