public interface FLayer extends Projected, Persistent, Metadata, Disposable, ExtendedPropertiesSupport
Projected
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
METADATA_CRS |
static java.lang.String |
METADATA_DEFINITION_DESCRIPTION |
static java.lang.String |
METADATA_DEFINITION_NAME |
static java.lang.String |
METADATA_NAME |
Modifier and Type | Method and Description |
---|---|
void |
addError(java.lang.Throwable exception)
Adds an error reason that describes this layer's wrong status.
|
boolean |
addLayerListener(LayerListener o)
Adds a
LayerListener to the listener list. |
boolean |
allowLinks()
Deprecated.
see https://redmine.gvsig.net/redmine/projects/gvsig-hyperlink
|
FLayer |
cloneLayer()
This method can be used to have a fast cloned layer.
|
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale)
Draws the layer using a buffer.
|
ICoordTrans |
getCoordTrans()
Returns the transformation coordinates.
|
int |
getDefaultTolerance()
Returns layer tolerance in pixels
|
long |
getDrawVersion() |
java.lang.Throwable |
getError(int i)
Returns the specified error.
|
java.util.List<java.lang.Throwable> |
getErrors()
Returns a list with all layer errors.
|
FLayerStatus |
getFLayerStatus()
Returns the status of this layer.
|
Envelope |
getFullEnvelope()
Returns the full extension of the layer node.
|
java.lang.String |
getInfoString()
Returns an string with the information of this layer.
|
LayerListener[] |
getLayerListeners()
Returns all
LayerListener s of this layer as an array. |
java.net.URI[] |
getLink(java.awt.geom.Point2D point,
double tolerance)
Deprecated.
see https://redmine.gvsig.net/redmine/projects/gvsig-hyperlink
|
AbstractLinkProperties |
getLinkProperties()
Deprecated.
see https://redmine.gvsig.net/redmine/projects/gvsig-hyperlink
|
MapContext |
getMapContext()
Returns a reference to the model of this layer, or null if this layer has no model.
|
double |
getMaxScale()
Returns the maximum scale visible.
|
double |
getMinScale()
Returns the minimum scale visible.
|
java.lang.String |
getName()
Returns the name of this layer.
|
int |
getNumErrors()
Returns the number of errors which causes this layer to be in unavailable status.
|
FLayers |
getParentLayer()
Returns the parent
FLayers node of this layer. |
java.lang.String |
getTocImageIcon()
Returns the image icon that will be shown in the TOC next to this layer.
|
java.awt.Image |
getTocStatusImage()
Returns the image icon that will be shown in the TOC next to this layer, according its status.
|
void |
invalidate() |
boolean |
isActive()
Returns if this layer is active or not in TOC.
|
boolean |
isAvailable()
Returns the status of availability of this layer.
|
boolean |
isEditing()
Returns if this layer is editable.
|
boolean |
isInTOC()
Returns if this layer appears in the TOC.
|
boolean |
isOk()
Returns if this layer hasn't got errors.
|
boolean |
isTemporary() |
boolean |
isVisible()
Returns if this layer is visible and available.
|
boolean |
isWithinScale(double scale)
Returns if the value of
scale argument
is within the maximum and minimum scale of this layer. |
boolean |
isWritable()
Returns the writing status of this layer.
|
void |
load()
Executes the initialization operations of this layer.
|
ComposedLayer |
newComposedLayer()
Returns a new instance of
ComposedLayer . |
void |
print(java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties)
Prints this layer according to some properties requested.
|
void |
reload()
Tries recover a layer of a possible error.
|
boolean |
removeLayerListener(LayerListener o)
Removes the
LayerListener argument from this layer. |
void |
setActive(boolean selected)
Changes the status of this layer to active or inactive.
|
void |
setAvailable(boolean available)
Changes the status of availability of this layer.
|
void |
setCoordTrans(ICoordTrans ct)
Inserts the transformation coordinates.
|
void |
setEditing(boolean b)
Deprecated.
Editing status is managed internally by layer, cannot be assigned here.
|
void |
setError(java.lang.Throwable ex) |
void |
setFLayerStatus(FLayerStatus status)
Sets the status of this layer.
|
void |
setInTOC(boolean b)
Sets that this layer appears or not in the TOC.
|
void |
setMaxScale(double maxScale)
Sets the maximum scale visible.
|
void |
setMinScale(double minScale)
Sets the minimum scale visible.
|
void |
setName(java.lang.String name)
Sets a name to this layer.
|
void |
setParentLayer(FLayers root)
Inserts the parent
FLayers node of the layer. |
void |
setProjection(IProjection proj)
Sets the projection to this layer.
|
void |
setTemporary(boolean temporary) |
void |
setVisible(boolean visibility)
Changes the status of this layer to visible or not.
|
boolean |
visibleRequired()
Returns
true if this layer has the visible status enabled. |
getProjection, reProject
loadFromState, saveToState
getMetadataChildren, getMetadataID, getMetadataName
clear, clone, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValue
dispose
getExtendedProperties, getProperty, setProperty
static final java.lang.String METADATA_DEFINITION_NAME
static final java.lang.String METADATA_DEFINITION_DESCRIPTION
static final java.lang.String METADATA_CRS
static final java.lang.String METADATA_NAME
void setActive(boolean selected)
Changes the status of this layer to active or inactive.
One layer is active if is selected in TOC.
selected
- the boolean to be setisActive()
boolean isActive()
Returns if this layer is active or not in TOC.
One layer is active if is selected in TOC.
true
if this layer is active; false
otherwisesetActive(boolean)
void setName(java.lang.String name)
name
- the string that is to be this layer's namegetName()
java.lang.String getName()
setName(String)
void load() throws LoadLayerException
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.
LoadLayerException
- if fails loading the layer.reload()
void setVisible(boolean visibility)
Changes 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
.
visibility
- the boolean to be setisVisible()
,
visibleRequired()
,
isAvailable()
boolean isVisible()
Returns if this layer is visible and available.
One layer is visible if it's check box associated is selected. This means that layer will tried to be painted.
One layer is available if the source of data is on-line.
It's probably that one layer selected hadn't available it's data, for example in a remote service.
true
if this layer is visible and available; false
otherwiseisAvailable()
,
setAvailable(boolean)
,
visibleRequired()
FLayers getParentLayer()
FLayers
node of this layer.null
if hasn't parentsetParentLayer(FLayers)
MapContext getMapContext()
Returns a reference to the model of this layer, or null if this layer has no model.
void setParentLayer(FLayers root)
FLayers
node of the layer.root
- a FLayers
objectgetParentLayer()
Envelope getFullEnvelope() throws ReadException
ReadException
- if fails the driver used in this method.void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale) throws ReadException
image
- an image used to accelerate the screen drawg
- for rendering 2-dimensional shapes, text and images on the Java(tm) platformviewPort
- information for drawing this layercancel
- an object thread that implements the Cancellable
interface, and will allow to cancel the drawscale
- value that represents the scaleReadException
- if fails the driver used in this method.print(Graphics2D, ViewPort, Cancellable, double, PrintAttributes)
void print(java.awt.Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintAttributes properties) throws ReadException
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 getMinScale() and 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.draw(BufferedImage, Graphics2D, ViewPort, Cancellable, double)
void setCoordTrans(ICoordTrans ct)
ct
- transformation coordinatesgetCoordTrans()
ICoordTrans getCoordTrans()
setCoordTrans(ICoordTrans)
int getDefaultTolerance()
boolean addLayerListener(LayerListener o)
LayerListener
to the listener list.o
- a layer listenertrue
if hasn't been any problem during the insertion of the listenergetLayerListeners()
,
removeLayerListener(LayerListener)
LayerListener[] getLayerListeners()
LayerListener
s of this layer as an array.addLayerListener(LayerListener)
,
removeLayerListener(LayerListener)
boolean removeLayerListener(LayerListener o)
LayerListener
argument from this layer.o
- a layer listenertrue
if hasn't been any problem doing this processaddLayerListener(LayerListener)
,
getLayerListeners()
boolean isWithinScale(double scale)
Returns if the value of scale
argument
is within the maximum and minimum scale of this layer.
scale
- the scale > 0true
if the scale
argument is within the range of scales of this layer; false
otherwisesetMinScale(double)
,
setMaxScale(double)
double getMinScale()
setMinScale(double)
double getMaxScale()
setMaxScale(double)
void setMinScale(double minScale)
minScale
- the scale > 0, -1 if not definedgetMinScale()
void setMaxScale(double maxScale)
maxScale
- the scale > 0, -1 if not definedgetMaxScale()
boolean isEditing()
Returns if this layer is editable.
One layer is editable if user can modify its information with graphical tools.
true
if this layer is editable; false
otherwisesetEditing(boolean)
java.lang.String getTocImageIcon()
null
if there isn't anyboolean isInTOC()
Returns if this layer appears in the TOC.
If doesn't appears, remains in the view and in the project.
true
if this layer appears in the TOC; false
otherwisevoid setInTOC(boolean b)
Sets that this layer appears or not in the TOC.
b
- true
if appears in the TOC; false
otherwiseFLayerStatus getFLayerStatus()
FLayerStatus
objectsetFLayerStatus(FLayerStatus)
void setFLayerStatus(FLayerStatus status)
status
- information of the status for this layergetFLayerStatus()
boolean isOk()
Returns if this layer hasn't got errors.
true
if this layer hasn't got errors; false
otherwiseint getNumErrors()
getError(int)
,
getErrors()
java.lang.Throwable getError(int i)
i
- index of the error >= 0 && < getNumErrors
getNumErrors()
,
getErrors()
void addError(java.lang.Throwable exception)
exception
- a BaseException
with the information of the errorgetNumErrors()
,
getError(int)
,
getErrors()
void setError(java.lang.Throwable ex)
java.util.List<java.lang.Throwable> getErrors()
ArrayList
with the errorsgetError(int)
,
getNumErrors()
void setAvailable(boolean available)
Changes the status of availability of this layer.
One layer is available if the source of data is on-line.
available
- the boolean to be setisAvailable()
boolean isAvailable()
Returns the status of availability of this layer.
One layer is available if the source of data is on-line.
true
if the source of data is on-line; false
otherwisesetAvailable(boolean)
,
isVisible()
void reload() throws ReloadLayerException
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.
ReloadLayerException
- if it's thrown a ReadException
or an
IOException
during the load of this layer.load()
boolean visibleRequired()
true
if this layer has the visible status enabled.true
if visible this layer has the visible status enabled, otherwise false
isVisible()
,
setVisible(boolean)
java.lang.String getInfoString()
boolean isWritable()
Returns the writing status of this layer.
One layer is writable if there is a writing driver for this layer.
true
if there is a writing driver for this layer; false
otherwiseFLayer cloneLayer() throws java.lang.Exception
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.
java.lang.Exception
- any exception produced during the cloning of this layer.ComposedLayer newComposedLayer()
Returns a new instance of ComposedLayer
.
This allows make a single draw for a group of layers with the same source.
If this operation isn't applicable for this kind of layer, this method returns null.
By default this operation is not supported.
null
if not supportedComposedLayer
java.awt.Image getTocStatusImage()
void setProjection(IProjection proj)
Sets the projection to this layer.
proj
- information about the new projectionlong getDrawVersion()
boolean isTemporary()
void setTemporary(boolean temporary)
void setEditing(boolean b) throws StartEditionLayerException
b
- StartEditionLayerException
boolean allowLinks()
AbstractLinkProperties getLinkProperties()
java.net.URI[] getLink(java.awt.geom.Point2D point, double tolerance) throws ReadException
point
- tolerance
- ReadException
void invalidate()