public class DefaultRasterLayer extends FLyrDefault implements RasterLayer, RasterLegendChangedListener, java.util.Observer
Modifier and Type | Class and Description |
---|---|
static class |
DefaultRasterLayer.RegisterPersistence |
FLyrDefault.RegisterMetadata
drawVersion, layerListeners, metadataContainer, properties
METADATA_CRS, METADATA_DEFINITION_DESCRIPTION, METADATA_DEFINITION_NAME, METADATA_NAME
Constructor and Description |
---|
DefaultRasterLayer()
Creates a new DefaultRasterLayer
|
DefaultRasterLayer(RasterStore store,
RasterLegend legend)
Creates a new DefaultRasterLayer
|
Modifier and Type | Method and Description |
---|---|
FLayer |
cloneLayer()
This method can be used to have a fast cloned layer.
|
boolean |
colorInterpretationChanged(RasterLegendEvent e) |
RasterQuery |
createRasterQuery()
Creates a new RasterQuery from the store
|
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale)
Draws the layer using a buffer.
|
RasterQuery |
getBaseQuery()
Returns the BaseQuery
|
DataStore |
getDataStore()
Método que devuelve el DataStore del que saca los datos la capa.
|
Envelope |
getFullEnvelope()
Returns the full extension of the layer node.
|
DynObjectSet |
getInfo(Point p,
double tolerance)
Executes a consultation about information of a point on the layer.
|
DynObjectSet |
getInfo(java.awt.Point p,
double tolerance,
Cancellable cancel)
Executes a consultation about information of a point on the layer.
|
DynObjectSet |
getInfo(java.awt.Point p,
double tolerance,
Cancellable cancel,
boolean fast)
Executes a consultation about information of a point on the layer.
|
java.lang.String |
getInfoString()
Returns an string with the information of this layer.
|
RasterLegend |
getLegend()
Devuelve la Leyenda de la capa.
|
java.util.Set<RasterStore> |
getMetadataChildren()
Returns an unsorted set of child Metadata objects.
|
java.lang.Object |
getMetadataID()
Returns the unique identifier of the Metadata.
|
RasterStore |
getRasterStore()
Returns RasterStore of this layer
|
Statistics |
getStatistics(SimpleTaskStatus status) |
java.lang.String |
getTocImageIcon()
Returns the image icon that will be shown in the TOC next to this layer.
|
void |
legendCleared(LegendClearEvent event) |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
boolean |
operationListChanged(RasterLegendEvent e) |
void |
print(java.awt.Graphics2D g,
ViewPort viewPort,
Cancellable cancel,
double scale,
PrintAttributes properties)
Prints this layer according to some properties requested.
|
void |
recalculateStatistics() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setBaseQuery(RasterQuery baseQuery)
Sets a BaseQuery to be applied to the data in the store
|
void |
setDataStore(DataStore dataStore)
Fija el DataStore asociado a la capa.
|
void |
setLegend(ILegend legend) |
boolean |
symbolChanged(SymbolLegendEvent e)
Invocado cuando se cambia en el legend el símbolo por defecto.
|
void |
update(java.util.Observable observable,
java.lang.Object notification) |
activationChanged, addError, addLayerListener, addLegendListener, allowLinks, callEditionChanged, callLegendChanged, clear, delegate, drawValueChanged, editionChanged, getClassName, getCoordTrans, getDefaultTolerance, 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, invalidate, invokeDynMethod, invokeDynMethod, isActive, isAvailable, isEditing, isInTOC, isOk, isTemporary, isVisible, isWithinScale, isWritable, load, nameChanged, newComposedLayer, reload, removeLayerListener, removeLegendListener, reProject, setActive, setAvailable, setCoordTrans, setDynValue, setEditing, setError, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setProperty, setTemporary, setTocStatusImage, setTransparency, setVisible, toString, updateDrawVersion, updateDrawVersion, visibilityChanged, visibleRequired, wakeUp
dispose, dispose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addLayerListener, allowLinks, getCoordTrans, getDefaultTolerance, getDrawVersion, getError, getErrors, getFLayerStatus, getLayerListeners, getLink, getLinkProperties, getMapContext, getMaxScale, getMinScale, getName, getNumErrors, getParentLayer, getTocStatusImage, invalidate, isActive, isAvailable, isEditing, isInTOC, isOk, isTemporary, isVisible, isWithinScale, isWritable, load, newComposedLayer, reload, removeLayerListener, setActive, setAvailable, setCoordTrans, setEditing, setError, setFLayerStatus, setInTOC, setMaxScale, setMinScale, setName, setParentLayer, setProjection, setTemporary, setVisible, visibleRequired
getProjection, reProject
getMetadataName
clear, clone, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValue
dispose
getExtendedProperties, getProperty, setProperty
public DefaultRasterLayer() throws LoadLayerException
LoadLayerException
public DefaultRasterLayer(RasterStore store, RasterLegend legend)
store
- legend
- public 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 RasterLegend getLegend()
getLegend
in interface RasterLayer
public DataStore getDataStore()
SingleLayer
getDataStore
in interface HasDataStore
getDataStore
in interface SingleLayer
public void setDataStore(DataStore dataStore) throws LoadLayerException
SingleLayer
setDataStore
in interface SingleLayer
dataStore
- a usar en la capa.LoadLayerException
public Envelope getFullEnvelope() throws ReadException
FLayer
getFullEnvelope
in interface FLayer
ReadException
- if fails the driver used in this method.public void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale) throws ReadException
FLayer
draw
in interface FLayer
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.FLayer.print(Graphics2D, ViewPort, Cancellable, double, PrintAttributes)
public void print(java.awt.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 java.util.Set<RasterStore> getMetadataChildren() throws MetadataException
Metadata
getMetadataChildren
in interface Metadata
MetadataException
public java.lang.Object getMetadataID() throws MetadataException
Metadata
getMetadataID
in interface Metadata
MetadataException
public void update(java.util.Observable observable, java.lang.Object notification)
update
in interface java.util.Observer
public RasterStore getRasterStore()
RasterLayer
getRasterStore
in interface RasterLayer
public void setBaseQuery(RasterQuery baseQuery)
RasterLayer
setBaseQuery
in interface RasterLayer
public RasterQuery getBaseQuery()
RasterLayer
getBaseQuery
in interface RasterLayer
public RasterQuery createRasterQuery()
RasterLayer
createRasterQuery
in interface RasterLayer
protected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.dispose()
public DynObjectSet getInfo(java.awt.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(java.awt.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 java.lang.String getTocImageIcon()
FLayer
getTocImageIcon
in interface FLayer
getTocImageIcon
in class FLyrDefault
null
if there isn't anypublic void setLegend(ILegend legend)
setLegend
in interface RasterLayer
public java.lang.String getInfoString()
FLayer
getInfoString
in interface FLayer
getInfoString
in class FLyrDefault
public Statistics getStatistics(SimpleTaskStatus status)
getStatistics
in interface RasterLayer
public void recalculateStatistics()
recalculateStatistics
in interface RasterLayer
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.public boolean symbolChanged(SymbolLegendEvent e)
LegendContentsChangedListener
symbolChanged
in interface LegendContentsChangedListener
e
- SymbolLegendEventpublic void legendCleared(LegendClearEvent event)
legendCleared
in interface LegendContentsChangedListener
public boolean colorInterpretationChanged(RasterLegendEvent e)
colorInterpretationChanged
in interface RasterLegendChangedListener
public boolean operationListChanged(RasterLegendEvent e)
operationListChanged
in interface RasterLegendChangedListener