public interface FLayer extends Projected, Persistent, Metadata, Disposable, ExtendedPropertiesSupport
Projected| Modifier and Type | Field and Description |
|---|---|
static String |
METADATA_CRS |
static String |
METADATA_DEFINITION_DESCRIPTION |
static String |
METADATA_DEFINITION_NAME |
static String |
METADATA_NAME |
| Modifier and Type | Method and Description |
|---|---|
void |
addError(BaseException 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(BufferedImage image,
Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale)
Draws the layer using a buffer.
|
ICoordTrans |
getCoordTrans()
Returns the transformation coordinates.
|
long |
getDrawVersion() |
BaseException |
getError(int i)
Returns the specified error.
|
List |
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.
|
String |
getInfoString()
Returns an string with the information of this layer.
|
LayerListener[] |
getLayerListeners()
Returns all
LayerListeners of this layer as an array. |
URI[] |
getLink(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.
|
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. |
String |
getTocImageIcon()
Returns the image icon that will be shown in the TOC next to this layer.
|
Image |
getTocStatusImage()
Returns the image icon that will be shown in the TOC next to this layer, according its status.
|
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(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(Exception 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(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, reProjectloadFromState, saveToStategetMetadataChildren, getMetadataID, getMetadataNameclear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValuedisposegetExtendedProperties, getProperty, setPropertystatic final String METADATA_DEFINITION_NAME
static final String METADATA_DEFINITION_DESCRIPTION
static final String METADATA_CRS
static final 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(String name)
name - the string that is to be this layer's namegetName()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(BufferedImage image, 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(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)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()
LayerListeners 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)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()BaseException getError(int i)
i - index of the error >= 0 && < getNumErrorsgetNumErrors(),
getErrors()void addError(BaseException exception)
exception - a BaseException with the information of the errorgetNumErrors(),
getError(int),
getErrors()void setError(Exception ex)
List 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 falseisVisible(),
setVisible(boolean)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 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.
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 supportedComposedLayerImage 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 - StartEditionLayerExceptionboolean allowLinks()
AbstractLinkProperties getLinkProperties()
URI[] getLink(Point2D point, double tolerance) throws ReadException
point - tolerance - ReadException