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, metadataContainerMETADATA_CRS, METADATA_DEFINITION_DESCRIPTION, METADATA_DEFINITION_NAME, METADATA_NAME| Constructor and Description |
|---|
FLyrVect() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBaseFilter(Evaluator 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()
Devuelve el VectorialAdapater de la capa.
|
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.
|
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, 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, 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, wakeUpdispose, disposeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddError, addLayerListener, getCoordTrans, getDrawVersion, getError, getErrors, getFLayerStatus, getInfoString, 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, visibleRequiredgetProjection, reProjectgetMetadataNameclear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValuedisposegetExtendedProperties, getProperty, setPropertyaddLegendListener, removeLegendListenerprotected ILabelingStrategy strategy
public String getTocImageIcon()
FLayergetTocImageIcon in interface FLayergetTocImageIcon in class FLyrDefaultnull if there isn't anypublic DataStore getDataStore()
getDataStore in interface SingleLayerpublic void setDataStore(DataStore dataStore) throws LoadLayerException
bindToDataStore(DataStore)setDataStore in interface SingleLayerdataStore - LoadLayerExceptionprotected 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 draw(BufferedImage image, 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(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 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 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(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 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 FLyrDefaultException - 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()
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(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, double dpi) throws ReadException
ILabelabledrawLabels in interface ILabelableReadExceptionpublic void printLabels(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(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 FeatureSet queryByGeometry(Geometry geom, FeatureType featureType) throws DataException
geom - featureType - 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, 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 DynObjectSet getInfo(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(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, 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 Set getMetadataChildren()
MetadatagetMetadataChildren in interface Metadatapublic 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 Iterator iterator()