public class FLyrVect extends FLyrDefault implements VectorLayer, LegendContentsChangedListener, org.gvsig.tools.observer.Observer
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 |
---|---|
protected void |
bindToDataStore(org.gvsig.fmap.dal.DataStore dataStore)
Enlaza la capa con el DataStore indicado.
|
protected void |
cleanLoadOptions() |
FLayer |
cloneLayer()
This method can be used to have a fast cloned layer.
|
protected void |
doDispose() |
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
org.gvsig.tools.task.Cancellable cancel,
double scale)
Draws using IFeatureIterator.
|
void |
drawLabels(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
org.gvsig.tools.task.Cancellable cancel,
double scale,
double dpi)
Causes the labels to be drawn.
|
static org.gvsig.fmap.geom.primitive.Envelope |
fromViewPortCRSToSourceCRS(FLayer lyr,
org.gvsig.fmap.geom.primitive.Envelope env)
Returns envelope in layer's data source CRS
from envelope provided in viewport CRS
|
static org.gvsig.fmap.geom.Geometry |
fromViewPortCRSToSourceCRS(FLayer lyr,
org.gvsig.fmap.geom.Geometry geo,
boolean clone)
Returns geometry in layer's data source CRS
from geometry provided in viewport CRS
|
org.gvsig.fmap.dal.DataStore |
getDataStore()
Devuelve el VectorialAdapater de la capa.
|
org.gvsig.fmap.dal.feature.FeatureStore |
getFeatureStore() |
org.gvsig.fmap.geom.primitive.Envelope |
getFullEnvelope()
Returns the full extension of the layer node.
|
org.gvsig.fmap.geom.type.GeometryType |
getGeometryType()
Returns the layer's geometry type
|
org.gvsig.tools.dynobject.DynObjectSet |
getInfo(org.gvsig.fmap.geom.primitive.Point p,
double tolerance)
Executes a consultation about information of a point on the layer.
|
org.gvsig.tools.dynobject.DynObjectSet |
getInfo(java.awt.Point p,
double tolerance,
org.gvsig.tools.task.Cancellable cancel)
Executes a consultation about information of a point on the layer.
|
org.gvsig.tools.dynobject.DynObjectSet |
getInfo(java.awt.Point p,
double tolerance,
org.gvsig.tools.task.Cancellable cancel,
boolean fast)
Executes a consultation about information of a point on the layer.
|
ILabelingStrategy |
getLabelingStrategy()
Returns the current labeling strategy
|
ILegend |
getLegend()
Devuelve la Leyenda de la capa.
|
java.util.Set |
getMetadataChildren() |
java.lang.Object |
getMetadataID() |
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.
|
org.gvsig.fmap.geom.type.GeometryType |
getTypeVectorLayer() |
boolean |
isEditing()
Returns if this layer is editable.
|
boolean |
isLabeled()
Returns true if labels are drawn, or false otherwise.
|
protected boolean |
isOnePoint(java.awt.geom.AffineTransform graphicsTransform,
ViewPort viewPort,
double dpi,
CartographicSupport csSym,
org.gvsig.fmap.geom.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 |
isWritable()
Returns the writing status of this layer.
|
void |
legendCleared(LegendClearEvent event) |
void |
load()
Executes the initialization operations of this layer.
|
void |
loadFromState(org.gvsig.tools.persistence.PersistentState state) |
void |
print(java.awt.Graphics2D g,
ViewPort viewPort,
org.gvsig.tools.task.Cancellable cancel,
double scale,
org.gvsig.compat.print.PrintAttributes properties)
Prints this layer according to some properties requested.
|
void |
printLabels(java.awt.Graphics2D g,
ViewPort viewPort,
org.gvsig.tools.task.Cancellable cancel,
double scale,
org.gvsig.compat.print.PrintAttributes properties) |
protected void |
putLoadLegend() |
protected void |
putLoadSelection() |
org.gvsig.fmap.dal.feature.FeatureSet |
queryByEnvelope(org.gvsig.fmap.geom.primitive.Envelope envelope,
org.gvsig.fmap.dal.feature.FeatureType featureType)
It return the
FeatureSet that intersects with the envelope. |
org.gvsig.fmap.dal.feature.FeatureSet |
queryByEnvelope(org.gvsig.fmap.geom.primitive.Envelope envelope,
org.gvsig.fmap.dal.feature.FeatureType featureType,
java.lang.String[] names)
It return the
FeatureSet that intersects with the envelope. |
org.gvsig.fmap.dal.feature.FeatureSet |
queryByGeometry(org.gvsig.fmap.geom.Geometry geom,
org.gvsig.fmap.dal.feature.FeatureType featureType) |
org.gvsig.fmap.dal.feature.FeatureSet |
queryByPoint(org.gvsig.fmap.geom.primitive.Point point,
double tol,
org.gvsig.fmap.dal.feature.FeatureType featureType) |
static void |
registerPersistent() |
void |
reload()
Tries recover a layer of a possible error.
|
void |
saveToState(org.gvsig.tools.persistence.PersistentState state) |
void |
setEditing(boolean b)
Changes the status of this layer to editable or not.
|
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(java.lang.Object xml) |
void |
setMaxFeaturesInEditionCache(int maxFeatures)
Siempre es un numero mayor de 1000
|
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.
|
void |
update(org.gvsig.tools.observer.Observable observable,
java.lang.Object notification) |
activationChanged, addError, addLayerListener, addLegendListener, allowLinks, callEditionChanged, callLegendChanged, clear, delegate, drawValueChanged, editionChanged, getClassName, getCoordTrans, getDrawVersion, getDynClass, getDynValue, getError, getErrors, getExtendedProperties, getFLayerStatus, getInfoString, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMetadataName, getMinScale, getName, getNumErrors, getParentLayer, getProjection, getProperty, getTocStatusImage, getTransparency, hasChangedForDrawing, hasDynValue, hidesThisArea, implement, invokeDynMethod, invokeDynMethod, isActive, isAvailable, isInTOC, isOk, isVisible, isWithinScale, nameChanged, newComposedLayer, registerMetadata, removeLayerListener, removeLegendListener, reProject, setActive, setAvailable, setCoordTrans, setDynValue, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setProperty, setTocStatusImage, setTransparency, setVisible, updateDrawVersion, visibilityChanged, visibleRequired, wakeUp
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addLayerListener, allowLinks, getCoordTrans, getDrawVersion, getError, getErrors, getExtendedProperties, getFLayerStatus, getInfoString, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMinScale, getName, getNumErrors, getParentLayer, getProperty, getTocStatusImage, isActive, isAvailable, isInTOC, isOk, isVisible, isWithinScale, newComposedLayer, removeLayerListener, setActive, setAvailable, setCoordTrans, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setProperty, setVisible, visibleRequired
clear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValue
addLegendListener, removeLegendListener
protected ILabelingStrategy strategy
protected void bindToDataStore(org.gvsig.fmap.dal.DataStore dataStore) throws LoadLayerException
dataStore
- LoadLayerException
protected void cleanLoadOptions()
public FLayer cloneLayer() throws java.lang.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
java.lang.Exception
- any exception produced during the cloning of this layer.protected void doDispose() throws org.gvsig.tools.exception.BaseException
doDispose
in class org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.tools.exception.BaseException
public void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale) throws org.gvsig.fmap.dal.exception.ReadException
draw
in interface FLayer
image
- g
- viewPort
- cancel
- scale
- ReadDriverException
org.gvsig.fmap.dal.exception.ReadException
- if fails the driver used in this method.FLayer.print(Graphics2D, ViewPort, Cancellable, double, PrintAttributes)
public void drawLabels(java.awt.image.BufferedImage image, java.awt.Graphics2D g, ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, double dpi) throws org.gvsig.fmap.dal.exception.ReadException
ILabelable
drawLabels
in interface ILabelable
org.gvsig.fmap.dal.exception.ReadException
public static org.gvsig.fmap.geom.primitive.Envelope fromViewPortCRSToSourceCRS(FLayer lyr, org.gvsig.fmap.geom.primitive.Envelope env)
lyr
- env
- public static org.gvsig.fmap.geom.Geometry fromViewPortCRSToSourceCRS(FLayer lyr, org.gvsig.fmap.geom.Geometry geo, boolean clone)
lyr
- geo
- clone
- public org.gvsig.fmap.dal.DataStore getDataStore()
getDataStore
in interface SingleLayer
public org.gvsig.fmap.dal.feature.FeatureStore getFeatureStore()
getFeatureStore
in interface VectorLayer
public org.gvsig.fmap.geom.primitive.Envelope getFullEnvelope() throws org.gvsig.fmap.dal.exception.ReadException
FLayer
getFullEnvelope
in interface FLayer
org.gvsig.fmap.dal.exception.ReadException
- if fails the driver used in this method.public org.gvsig.fmap.geom.type.GeometryType getGeometryType() throws org.gvsig.fmap.dal.exception.ReadException
getGeometryType
in interface Classifiable
org.gvsig.fmap.dal.exception.ReadException
- if there is an error getting the geometry typepublic org.gvsig.tools.dynobject.DynObjectSet getInfo(org.gvsig.fmap.geom.primitive.Point p, double tolerance) throws LoadLayerException, org.gvsig.fmap.dal.exception.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
org.gvsig.fmap.dal.exception.DataException
public org.gvsig.tools.dynobject.DynObjectSet getInfo(java.awt.Point p, double tolerance, org.gvsig.tools.task.Cancellable cancel) throws LoadLayerException, org.gvsig.fmap.dal.exception.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.org.gvsig.fmap.dal.exception.DataException
- TODOpublic org.gvsig.tools.dynobject.DynObjectSet getInfo(java.awt.Point p, double tolerance, org.gvsig.tools.task.Cancellable cancel, boolean fast) throws LoadLayerException, org.gvsig.fmap.dal.exception.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.org.gvsig.fmap.dal.exception.DataException
- TODOpublic ILabelingStrategy getLabelingStrategy()
ILabelable
getLabelingStrategy
in interface ILabelable
ILabelingStrategy
public ILegend getLegend()
getLegend
in interface Classifiable
public java.util.Set getMetadataChildren()
getMetadataChildren
in interface org.gvsig.metadata.Metadata
public java.lang.Object getMetadataID() throws org.gvsig.metadata.exceptions.MetadataException
getMetadataID
in interface org.gvsig.metadata.Metadata
org.gvsig.metadata.exceptions.MetadataException
public int getShapeType() throws org.gvsig.fmap.dal.exception.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
org.gvsig.fmap.dal.exception.ReadException
Geometry
,
Constant
public SpatialCache getSpatialCache()
public java.lang.String getTocImageIcon()
FLayer
getTocImageIcon
in interface FLayer
getTocImageIcon
in class FLyrDefault
null
if there isn't anypublic org.gvsig.fmap.geom.type.GeometryType getTypeVectorLayer() throws org.gvsig.fmap.dal.exception.DataException, org.gvsig.tools.locator.LocatorException, org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException, org.gvsig.fmap.geom.type.GeometryTypeNotValidException
org.gvsig.fmap.dal.exception.DataException
org.gvsig.tools.locator.LocatorException
org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException
org.gvsig.fmap.geom.type.GeometryTypeNotValidException
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 boolean isLabeled()
ILabelable
isLabeled
in interface ILabelable
protected boolean isOnePoint(java.awt.geom.AffineTransform graphicsTransform, ViewPort viewPort, double dpi, CartographicSupport csSym, org.gvsig.fmap.geom.Geometry geom, int[] xyCoords)
public boolean isPropertiesMenuVisible()
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 void legendCleared(LegendClearEvent event)
legendCleared
in interface LegendContentsChangedListener
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
FLayer.reload()
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
loadFromState
in interface org.gvsig.tools.persistence.Persistent
loadFromState
in class FLyrDefault
org.gvsig.tools.persistence.exception.PersistenceException
public void print(java.awt.Graphics2D g, ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.dal.exception.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 joborg.gvsig.fmap.dal.exception.ReadException
- if fails the driver used in this method.FLayer.draw(BufferedImage, Graphics2D, ViewPort, Cancellable, double)
public void printLabels(java.awt.Graphics2D g, ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.dal.exception.ReadException
printLabels
in interface ILabelable
org.gvsig.fmap.dal.exception.ReadException
protected void putLoadLegend() throws LegendLayerException
LegendLayerException
protected void putLoadSelection()
public org.gvsig.fmap.dal.feature.FeatureSet queryByEnvelope(org.gvsig.fmap.geom.primitive.Envelope envelope, org.gvsig.fmap.dal.feature.FeatureType featureType) throws org.gvsig.fmap.dal.exception.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.org.gvsig.fmap.dal.exception.DataException
public org.gvsig.fmap.dal.feature.FeatureSet queryByEnvelope(org.gvsig.fmap.geom.primitive.Envelope envelope, org.gvsig.fmap.dal.feature.FeatureType featureType, java.lang.String[] names) throws org.gvsig.fmap.dal.exception.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.org.gvsig.fmap.dal.exception.DataException
public org.gvsig.fmap.dal.feature.FeatureSet queryByGeometry(org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.FeatureType featureType) throws org.gvsig.fmap.dal.exception.DataException
org.gvsig.fmap.dal.exception.DataException
public org.gvsig.fmap.dal.feature.FeatureSet queryByPoint(org.gvsig.fmap.geom.primitive.Point point, double tol, org.gvsig.fmap.dal.feature.FeatureType featureType) throws org.gvsig.fmap.dal.exception.DataException
org.gvsig.fmap.dal.exception.DataException
public static void registerPersistent()
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()
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
saveToState
in interface org.gvsig.tools.persistence.Persistent
saveToState
in class FLyrDefault
org.gvsig.tools.persistence.exception.PersistenceException
public void setEditing(boolean b) throws StartEditionLayerException
FLayer
Changes the status of this layer to editable or not.
One layer is editable if user can modify its information with graphical tools.
setEditing
in interface FLayer
setEditing
in class FLyrDefault
b
- the boolean to be setStartEditionLayerException
FLayer.isEditing()
public void setIsLabeled(boolean isLabeled)
ILabelable
setIsLabeled
in interface ILabelable
public void setLabelingStrategy(ILabelingStrategy strategy)
ILabelable
setLabelingStrategy
in interface ILabelable
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.protected void setLoadLegend(IVectorLegend legend)
protected void setLoadSelection(java.lang.Object xml)
public void setMaxFeaturesInEditionCache(int maxFeatures)
maxFeatures
- public boolean symbolChanged(SymbolLegendEvent e)
LegendContentsChangedListener
symbolChanged
in interface LegendContentsChangedListener
e
- SymbolLegendEventpublic java.lang.String toString()
toString
in class FLyrDefault
public void update(org.gvsig.tools.observer.Observable observable, java.lang.Object notification)
update
in interface org.gvsig.tools.observer.Observer
Copyright © 2013 gvSIG Association. All rights reserved.