Lightspeed view
.public class TLcdGXYLspAsynchronousLayerWrapper extends TLcdGXYAsynchronousLayerWrapper
TLcdGXYAsynchronousLayerWrapper
, except that it uses
a Lightspeed layer for the body
representation of the layer's
visualization.
This can be useful when you cannot use a Lightspeed view, but you do want to speed up rendering
in your ILcdGXYView
, for example when painting many objects or complex
visualizations such as density or hypsometry data.
The body's visualization is delegated to the given Lightspeed layer. Hence, the layer should
have the same model as the original layer, and it should have an appropriate painter configured
for rendering the bodies of the model's shapes.
All other visualization (labels, selection) and
interaction is delegated to the original ILcdGXYLayer
.
This wrapper needs a special Lightspeed-capable paint queue: TLcdGXYLspAsynchronousPaintQueue
.
Typically it is used as follows:
ILcdGXYLayer originalLayer = ... // original, slow GXY layer
ILspLayer fastLayer = ... // fast Lightspeed layer, only used for rendering
TLcdGXYLspAsynchronousLayerWrapper wrapper = new TLcdGXYLspAsynchronousLayerWrapper( originalLayer, fastLayer );
wrapper.setGXYAsynchronousPaintQueue( new TLcdGXYLspAsynchronousPaintQueue( map ) );
map.addGXYLayer( wrapper );
TLcdGXYLspAsynchronousPaintQueue
,
Serialized FormConstructor and Description |
---|
TLcdGXYLspAsynchronousLayerWrapper(ILcdGXYLayer aDecoratedLayer,
ILspLayer aLayer)
Deprecated.
Creates a layer decorator that delegates painting to an asynchronous paint queue.
|
TLcdGXYLspAsynchronousLayerWrapper(ILcdGXYLayer aDecoratedLayer,
ILspLayer aLayer,
ILcdGXYAsynchronousPaintQueue aQueue)
Deprecated.
Creates a layer decorator that delegates painting to an asynchronous paint queue.
|
Modifier and Type | Method and Description |
---|---|
ILcdGXYLayerChangeTracker |
getAsynchronousGXYLayerChangeTracker()
Deprecated.
Returns a state change synchronizer for the wrapped layer.
|
ILspLayer |
getLspLayer()
Deprecated.
|
void |
invokeAndWaitOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
Deprecated.
Executes the given layer runnable so that the invocation does not interfere with the
asynchronous painting.
|
void |
invokeLaterOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
Deprecated.
Executes the given layer runnable so that the invocation does not interfere with the
asynchronous painting.
|
void |
invokeLaterOnGXYAndLspLayerInEDT(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
Deprecated.
Executes the given layer runnable so that the invocation does not interfere with the
asynchronous painting.
|
void |
invokeNowOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
Deprecated.
Executes the given layer runnable so that the invocation does not interfere with state
synchronization.
|
void |
setGXYAsynchronousPaintQueue(ILcdGXYAsynchronousPaintQueue aQueue)
Deprecated.
Sets the paint queue to delegate asynchronous paint requests to.
|
addPropertyChangeListener, addSelectionListener, applyOnInteract, clearSelection, fireCollectedSelectionChanges, firePropertyChangeEvent, getBounds, getGXYAsynchronousPaintQueue, getGXYEditor, getGXYLabelPainter, getGXYLayer, getGXYPainter, getGXYPen, getIcon, getLabel, getLabelMapScaleRange, getLabelScaleRange, getMapScaleRange, getModel, getModelXYWorldTransfoClass, getScaleRange, getSelectionCount, getSynchronousGXYLayerChangeTracker, invokeAndWaitOnGXYLayer, invokeLaterOnGXYLayer, invokeLaterOnGXYLayerInEDT, invokeNowOnGXYLayer, isAsynchronous, isEditable, isEditableSupported, isLabeled, isLabeledSupported, isSelectable, isSelectableSupported, isSelected, isTraceOn, isVisible, paint, removePropertyChangeListener, removeSelectionListener, selectedObjects, selectObject, setAsynchronous, setEditable, setIcon, setLabel, setLabeled, setSelectable, setTraceOn, setVisible, stopPainting
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create
getSelectedObjects
public TLcdGXYLspAsynchronousLayerWrapper(ILcdGXYLayer aDecoratedLayer, ILspLayer aLayer)
setGXYAsynchronousPaintQueue(com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousPaintQueue)
For thread safety, the given layers should operate synchronously. Hence, a
TLcdGXYLspAsynchronousLayerWrapper
should not wrap another
ILcdGXYAsynchronousLayerWrapper
.aDecoratedLayer
- a synchronous layer that will be delegated to for everything except body visualization.
State changes are propagated to and from the wrapper.aLayer
- a synchronous layer for the visualization of the shape's bodies.
Wrapper state changes are propagated to this layer.public TLcdGXYLspAsynchronousLayerWrapper(ILcdGXYLayer aDecoratedLayer, ILspLayer aLayer, ILcdGXYAsynchronousPaintQueue aQueue)
aDecoratedLayer
- will be delegated to for everything except body visualization.aLayer
- layer for the visualization of the shape's bodies. Wrapper state changes are propagated
to this layer.aQueue
- the paint queue that handles the asynchronous paint calls.public void setGXYAsynchronousPaintQueue(ILcdGXYAsynchronousPaintQueue aQueue)
ILcdGXYAsynchronousLayerWrapper
setGXYAsynchronousPaintQueue
in interface ILcdGXYAsynchronousLayerWrapper
setGXYAsynchronousPaintQueue
in class TLcdGXYAsynchronousLayerWrapper
aQueue
- the asynchronous paint queue responsible for executing the paint calls.public ILcdGXYLayerChangeTracker getAsynchronousGXYLayerChangeTracker()
ILcdGXYAsynchronousLayerWrapper
getAsynchronousGXYLayerChangeTracker
in interface ILcdGXYAsynchronousLayerWrapper
getAsynchronousGXYLayerChangeTracker
in class TLcdGXYAsynchronousLayerWrapper
public ILspLayer getLspLayer()
public void invokeLaterOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
Executes the given layer runnable so that the invocation does not interfere with the asynchronous painting. The invocation is executed in the asynchronous paint thread if the layer is painted asynchronously, and in the event dispatch thread otherwise. The method always returns immediately.
The invocation should take care when waiting for another thread: if that thread in turn waits for asynchronous painting to complete, a deadlock will occur.
To avoid concurrency problems with property change listeners, layer property changes will be fired on the event dispatch thread, not on the asynchronous paint thread.
aRunnable
- the invocation to run. The invocation will pass the original Lightspeed and GXY layer.public void invokeAndWaitOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable) throws InterruptedException
aRunnable
- the invocation to run. The invocation will pass the original Lightspeed and GXY layer.InterruptedException
- when the thread is interrupted while waiting for the asynchronous painting to completepublic void invokeNowOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
aRunnable
- the invocation to run. The invocation will pass the original Lightspeed and GXY layer.public void invokeLaterOnGXYAndLspLayerInEDT(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
aRunnable
- the invocation to run. The invocation will pass the original Lightspeed and GXY layer.