public class TLspTiledWMSProxyPainter extends Object implements ILspEditableStyledPainter
Painter for visualizing ALcdWMSProxy
objects in a Lightspeed view.
This painter requests data from the WMS in tiles. Typically you should use
TLspWMSLayerBuilder
instead
of using this painter directly. TLspWMSLayerBuilder
automatically creates a layer with a painter,
with the ability to choose between a tiled and non-tiled approach to request data from the WMS.
This painter can be used directly in case a custom tile grid needs to be used
to request tiles from the WMS; this custom tile grid can be set through the constructor.
When painting, the ALcdWMSProxy
object is used to connect and retrieve
the necessary raster data from the WMS. This painter requests the data from the WMS in tiles, using
either a default tile grid or a custom tile grid.
While using tiles usually optimizes performance (more specifically, it allows faster feedback and
the ability to use caching),
there may be some visual artifacts regarding content that is not tied to world coordinates.
For example, logo's may appear multiple times and labels may only be partially visible. You can use the
TLspWMSLayerBuilder
and
non-tiled approach
to avoid these artifacts.
ILspPaintGroupsChangeListener.Callback
Constructor and Description |
---|
TLspTiledWMSProxyPainter()
Creates a new painter with the default settings.
|
TLspTiledWMSProxyPainter(int aLevel0Rows,
int aLevel0Columns,
int aTileWidth,
int aTileHeight,
int aMaxLevels,
ILcdBounds aBounds,
ILcdGeoReference aGeoReference)
Creates a new painter with the given tile grid.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Adds a
PropertyChangeListener
to the list of listeners that must be notified when
any of the properties of this ILspPainter changes. |
void |
commitChanges(Object aEventId)
Called when the changes for a specified event should be committed.
|
boolean |
equals(Object aObj) |
TLspOpenGLProfile |
getRequiredOpenGLProfile()
Returns the minimum required OpenGL profile that a view must support in
order to be compatible with this painter.
|
ILspStyler |
getStyler(TLspPaintState aPaintState)
Returns the styler used by this painter for the given
PaintState . |
int |
hashCode() |
TLspPaintProgress |
paintObjects(ILcdGLDrawable aGLDrawable,
List<TLspPaintGroup> aPaintGroups,
TLspPaintPass aPass,
TLspContext aContext)
Paints the specified groups of objects into a view.
|
void |
prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents,
Object aEventId,
ILspPaintGroupsChangeListener.Callback aCallback)
Called when the paint groups will change.
|
<T> boolean |
query(List<TLspPaintGroup> aPaintGroups,
ALspPaintQuery<T> aQuery,
TLspPaintRepresentationState aPaintRepresentationState,
TLspContext aContext)
Retrieves a set of domain objects and data based on the parameters given by the query.
|
void |
registerLayer(ILspInteractivePaintableLayer aLayer,
TLspPaintRepresentation aPaintRepresentation)
Registers a layer with this painter.
|
void |
removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Removes a
PropertyChangeListener from the list of listeners. |
void |
setStyler(TLspPaintState aPaintState,
ILspStyler aStyler)
Sets the styler used by this object for the given
PaintState . |
String |
toString() |
void |
unregisterLayer(ILspInteractivePaintableLayer aLayer,
TLspPaintRepresentation aPaintRepresentation)
Unregisters a layer from this painter.
|
public TLspTiledWMSProxyPainter()
public TLspTiledWMSProxyPainter(int aLevel0Rows, int aLevel0Columns, int aTileWidth, int aTileHeight, int aMaxLevels, ILcdBounds aBounds, ILcdGeoReference aGeoReference)
aLevel0Rows
- the number of rows at the lowest level of detail.aLevel0Columns
- the number of columns at the lowest level of detail.aTileWidth
- the width of a single tile in pixels.aTileHeight
- the height of a single tile in pixels.aMaxLevels
- the number of levels.aBounds
- the geographical extent of the tile grid, specified according to aGeoReference
.aGeoReference
- the geographical reference of the tile grid.public TLspOpenGLProfile getRequiredOpenGLProfile()
ILspPainter
getRequiredOpenGLProfile
in interface ILspPainter
TLspGLProfile
public TLspPaintProgress paintObjects(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext)
ILspPainter
Paints the specified groups of objects into a view. The objects are partitioned into
TLspPaintGroup
s, which are created by the layer which invoked this painter.
Painters are advised to also implement ILspPaintGroupsChangeListener
,
which allows them to keep track of changes to the supplied list of paint groups. This
way, the painter can exploit temporal coherence and perform its work in the most optimal
way.
This method returns a TLspPaintProgress
which describes the completeness of the
paint operation. If the painter scheduled one or more tasks to be executed asynchronously,
it may return from its paintObjects()
method before having rendered all the objects
it was given. In this case, the returned progress object can describe the amount of work that
has been done and the work that is still remaining.
paintObjects
in interface ILspPainter
aGLDrawable
- the ILcdGLDrawable
in which the objects are to be paintedaPaintGroups
- the objects to be paintedaPass
- the current paint passaContext
- provides context information to the painterTLspPaintProgress
object describing the completeness of the paint operationpublic <T> boolean query(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext)
ILspPainter
query
in interface ILspPainter
aPaintGroups
- the paint groupsaQuery
- the queryaPaintRepresentationState
- the paint representation state for which the query should be
performedaContext
- the contexttrue
if the query completed, false
if it was aborted.public void registerLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation)
ILspPainter
ILspPainter.unregisterLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation)
.registerLayer
in interface ILspPainter
aLayer
- A layer with which this painter will be used.aPaintRepresentation
- The paint representation for which this painter will be used.public void unregisterLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation)
ILspPainter
ILspPainter.registerLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation)
.unregisterLayer
in interface ILspPainter
aLayer
- A layer that needs to be unregisteredaPaintRepresentation
- The paint representation for which this painter was used with
aLayerpublic void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback)
ILspPaintGroupsChangeListener
ILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
method must be invoked when the listener is
ready to commit the changes.
If aEventId
is null
then the changes may be committed immediately. In this case
there will be no call to ILspPaintGroupsChangeListener.commitChanges(Object)
.
Note that it is not mandatory to do this two-phased commit cycle. You may commit or apply the changes immediately, but you still must invoke the callback.
prepareChanges
in interface ILspPaintGroupsChangeListener
aEvents
- the changesaEventId
- the event id or null
aCallback
- the callback or null
public void commitChanges(Object aEventId)
ILspPaintGroupsChangeListener
commitChanges
in interface ILspPaintGroupsChangeListener
aEventId
- the event idpublic void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
ILspPainter
PropertyChangeListener
to the list of listeners that must be notified when
any of the properties of this ILspPainter
changes.addPropertyChangeListener
in interface ILspPainter
aPropertyChangeListener
- the listener that from now on will be notified of all changes
to
properties of this painterpublic void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
ILspPainter
PropertyChangeListener
from the list of listeners.
This listener will no longer be notified of any changes to the properties
of this ILspPainter
removePropertyChangeListener
in interface ILspPainter
aPropertyChangeListener
- the listener that no longer will be notified of any changes to
properties of this painterpublic ILspStyler getStyler(TLspPaintState aPaintState)
ILspPainter
PaintState
. Can return null
in case the painter does not use or expose a styler.getStyler
in interface ILspPainter
aPaintState
- the paint state for which a styler is requestedpublic void setStyler(TLspPaintState aPaintState, ILspStyler aStyler)
ILspEditableStyledPainter
PaintState
.setStyler
in interface ILspEditableStyledPainter
aPaintState
- the paint state for which to set a styleraStyler
- the new styler for the painter