public class FLyrVect extends FLyrDefault implements VectorLayer, LegendContentsChangedListener, Observer
Modifier and Type | Class and Description |
---|---|
protected class |
FLyrVect.EnvelopeCantBeInitializedException |
static class |
FLyrVect.RegisterPersistence |
FLyrDefault.RegisterMetadata
Modifier and Type | Field and Description |
---|---|
protected ILabelingStrategy |
strategy |
layerListeners, metadataContainer
METADATA_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(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() |
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
draw(BufferedImage image,
Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale)
Draws using IFeatureIterator.
|
void |
drawLabels(BufferedImage image,
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.
|
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(Point p,
double tolerance,
Cancellable cancel)
Executes a consultation about information of a point on the layer.
|
DynObjectSet |
getInfo(Point p,
double tolerance,
Cancellable cancel,
boolean fast)
Executes a consultation about information of a point on the layer.
|
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.
|
Set |
getMetadataChildren()
Returns an unsorted set of child Metadata objects.
|
Object |
getMetadataID()
Returns the unique identifier of the Metadata.
|
int |
getShapeType()
Returns the type of the shape.
|
SpatialCache |
getSpatialCache() |
String |
getTocImageIcon()
Returns the image icon that will be shown in the TOC next to this layer.
|
GeometryType |
getTypeVectorLayer() |
boolean |
isEditing()
Returns if this layer is editable.
|
boolean |
isLabeled()
Returns true if labels are drawn, or false otherwise.
|
protected boolean |
isOnePoint(AffineTransform graphicsTransform,
ViewPort viewPort,
double dpi,
CartographicSupport csSym,
Geometry geom,
int[] xyCoords) |
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 |
isWritable()
Returns the writing status of this layer.
|
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(Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties)
Prints this layer according to some properties requested.
|
void |
printLabels(Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties) |
protected void |
putLoadLegend() |
protected void |
putLoadSelection() |
FeatureSet |
queryByEnvelope(Envelope envelope,
FeatureType featureType)
It return the
FeatureSet that intersects with the envelope. |
FeatureSet |
queryByEnvelope(Envelope envelope,
FeatureType featureType,
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(Point2D mapPoint,
double tol,
FeatureType featureType)
Deprecated.
|
FeatureSet |
queryByPoint(Point point,
double tol,
FeatureType featureType) |
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 |
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 |
setLegend(IVectorLegend legend)
Sets the layer's legend as a vector legend.
|
protected void |
setLoadLegend(IVectorLegend legend) |
protected void |
setLoadSelection(Object xml) |
void |
setMaxFeaturesInEditionCache(int maxFeatures)
Siempre es un numero mayor de 1000
|
void |
setSpatialCacheEnabled(boolean spatialCacheEnabled)
Deprecated.
|
boolean |
symbolChanged(SymbolLegendEvent e)
Invocado cuando se cambia en el legend el símbolo por defecto.
|
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,
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, getDrawVersion, getDynClass, getDynValue, getError, getErrors, getExtendedProperties, getFLayerStatus, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMetadataName, getMinScale, getName, getNumErrors, getParentLayer, getProjection, getProperty, getTocStatusImage, getTransparency, hasChangedForDrawing, hasDynValue, hidesThisArea, implement, invokeDynMethod, invokeDynMethod, isActive, isAvailable, isInTOC, isOk, isTemporary, isVisible, isWithinScale, nameChanged, newComposedLayer, removeLayerListener, removeLegendListener, reProject, setActive, setAvailable, setCoordTrans, setDynValue, setError, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setProperty, setTemporary, setTocStatusImage, setTransparency, setVisible, updateDrawVersion, visibilityChanged, visibleRequired, wakeUp
dispose, dispose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addLayerListener, getCoordTrans, getDrawVersion, getError, getErrors, getFLayerStatus, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMinScale, getName, getNumErrors, getParentLayer, getTocStatusImage, isActive, isAvailable, isInTOC, isOk, isTemporary, isVisible, isWithinScale, newComposedLayer, removeLayerListener, setActive, setAvailable, setCoordTrans, setError, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setTemporary, setVisible, visibleRequired
getProjection, reProject
getMetadataName
clear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValue
dispose
getExtendedProperties, getProperty, setProperty
addLegendListener, removeLegendListener
protected ILabelingStrategy strategy
public String getTocImageIcon()
FLayer
getTocImageIcon
in interface FLayer
getTocImageIcon
in class FLyrDefault
null
if there isn't anypublic DataStore getDataStore()
getDataStore
in interface SingleLayer
public void setDataStore(DataStore dataStore) throws LoadLayerException
bindToDataStore(DataStore)
setDataStore
in interface SingleLayer
dataStore
- LoadLayerException
protected void bindToDataStore(DataStore dataStore) throws LoadLayerException
dataStore
- LoadLayerException
public Envelope getFullEnvelope() throws ReadException
FLayer
getFullEnvelope
in interface FLayer
ReadException
- if fails the driver used in this method.public void setBaseQuery(FeatureQuery baseQuery)
setBaseQuery
in interface VectorLayer
public FeatureQuery getBaseQuery()
getBaseQuery
in interface VectorLayer
public void addBaseFilter(Evaluator filter)
addBaseFilter
in interface VectorLayer
public void addBaseFilter(String filter)
addBaseFilter
in interface VectorLayer
public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale) throws ReadException
draw
in interface FLayer
image
- g
- viewPort
- cancel
- scale
- ReadDriverException
ReadException
- if fails the driver used in this method.FLayer.print(Graphics2D, ViewPort, Cancellable, double, PrintAttributes)
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintAttributes properties) throws ReadException
FLayer
print
in interface FLayer
g
- 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
ClassifiableVectorial
Sets the layer's legend as a vector legend.
setLegend
in interface ClassifiableVectorial
legend
- the legend with vector dataLegendLayerException
- if fails setting the legend to this layer.public ILegend getLegend()
getLegend
in interface Classifiable
public int getShapeType() throws ReadException
Classifiable
Returns 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 Classifiable
ReadException
Geometry
,
Constant
public GeometryType getGeometryType() throws ReadException
getGeometryType
in interface Classifiable
ReadException
- if there is an error getting the geometry typepublic void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class FLyrDefault
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class FLyrDefault
PersistenceException
public String toString()
toString
in class FLyrDefault
public boolean isEditing()
FLayer
Returns if this layer is editable.
One layer is editable if user can modify its information with graphical tools.
isEditing
in interface FLayer
isEditing
in class FLyrDefault
true
if this layer is editable; false
otherwiseFLayer.setEditing(boolean)
public void setEditing(boolean b) throws StartEditionLayerException
FLayer
setEditing
in interface FLayer
setEditing
in class FLyrDefault
StartEditionLayerException
public void clearSpatialCache()
getSpatialCache()
public boolean isSpatialCacheEnabled()
getSpatialCache()
public void setSpatialCacheEnabled(boolean spatialCacheEnabled)
getSpatialCache()
public SpatialCache getSpatialCache()
public void setMaxFeaturesInEditionCache(int maxFeatures)
maxFeatures
- public boolean isPropertiesMenuVisible()
public void reload() throws ReloadLayerException
FLayer
Tries 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 FLayer
reload
in class FLyrDefault
ReloadLayerException
- if it's thrown a ReadException
or an
IOException
during the load of this layer.FLayer.load()
protected void setLoadSelection(Object xml)
protected void setLoadLegend(IVectorLegend legend)
protected void putLoadSelection()
protected void putLoadLegend() throws LegendLayerException
LegendLayerException
protected void cleanLoadOptions()
public boolean isWritable()
FLayer
Returns the writing status of this layer.
One layer is writable if there is a writing driver for this layer.
isWritable
in interface FLayer
isWritable
in class FLyrDefault
true
if there is a writing driver for this layer; false
otherwisepublic FLayer cloneLayer() throws Exception
FLayer
This 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 FLayer
cloneLayer
in class FLyrDefault
Exception
- any exception produced during the cloning of this layer.protected boolean isOnePoint(AffineTransform graphicsTransform, ViewPort viewPort, double dpi, CartographicSupport csSym, Geometry geom, int[] xyCoords)
public boolean isLabeled()
ILabelable
isLabeled
in interface ILabelable
public void setIsLabeled(boolean isLabeled)
ILabelable
setIsLabeled
in interface ILabelable
public ILabelingStrategy getLabelingStrategy()
ILabelable
getLabelingStrategy
in interface ILabelable
ILabelingStrategy
public void setLabelingStrategy(ILabelingStrategy strategy)
ILabelable
setLabelingStrategy
in interface ILabelable
public void drawLabels(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, double dpi) throws ReadException
ILabelable
drawLabels
in interface ILabelable
ReadException
public void printLabels(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintAttributes properties) throws ReadException
printLabels
in interface ILabelable
ReadException
public boolean allowLinks()
allowLinks
in interface FLayer
allowLinks
in class FLyrDefault
public void load() throws LoadLayerException
FLayer
Executes 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 FLayer
load
in class FLyrDefault
LoadLayerException
- if fails loading the layer.FLayer.reload()
public FeatureStore getFeatureStore()
getFeatureStore
in interface VectorLayer
public FeatureQuery createFeatureQuery()
createFeatureQuery
in interface VectorLayer
public FeatureSet queryByPoint(Point2D mapPoint, double tol, FeatureType featureType) throws DataException
queryByPoint(org.gvsig.fmap.geom.primitive.Point, double, FeatureType)
DataException
public FeatureSet queryByPoint(Point point, double tol, FeatureType featureType) throws DataException
DataException
public FeatureSet queryByGeometry(Geometry geom, FeatureType featureType) throws DataException
geom
- featureType
- DataException
public 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.DataException
public FeatureSet queryByEnvelope(Envelope envelope, FeatureType featureType, 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.DataException
public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException
InfoByPoint
Executes 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 InfoByPoint
p
- 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(Point p, double tolerance, Cancellable cancel, boolean fast) throws LoadLayerException, DataException
InfoByPoint
Executes 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 InfoByPoint
p
- 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
InfoByPoint
Executes 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 InfoByPoint
p
- 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.LoadLayerException
DataException
public void legendCleared(LegendClearEvent event)
legendCleared
in interface LegendContentsChangedListener
public boolean symbolChanged(SymbolLegendEvent e)
LegendContentsChangedListener
symbolChanged
in interface LegendContentsChangedListener
e
- SymbolLegendEventpublic void update(Observable observable, Object notification)
Observer
Observable
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 Observer
s 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 Set getMetadataChildren()
Metadata
getMetadataChildren
in interface Metadata
public Object getMetadataID() throws MetadataException
Metadata
getMetadataID
in interface Metadata
MetadataException
public GeometryType getTypeVectorLayer() throws DataException, LocatorException, GeometryTypeNotSupportedException, GeometryTypeNotValidException
protected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.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 Iterator iterator()
public String getInfoString()
FLayer
getInfoString
in interface FLayer
getInfoString
in class FLyrDefault