public abstract class ALcyAsynchronousPaintFacade extends Object
Whoever creates an ILcdGXYLayer
that is eligible
for asynchronous painting should pass it to the method createGXYAsynchronousLayer(com.luciad.view.gxy.ILcdGXYLayer)
.
Layers returned by this method can be accessed and added to a view just like regular layers.
Depending on the actual facade instance, the original layer will be painted asynchronously or
not. However, the returned layer is not guaranteed to be the same layer as the original
layer. To access the original layer safely, use the method invokeAndWaitOnGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousLayerRunnable)
. This
method can be used for any ILcdGXYLayer
, including synchronously painted layers.
Modifier | Constructor and Description |
---|---|
protected |
ALcyAsynchronousPaintFacade()
Creates a new
ALcyAsynchronousPaintFacade . |
Modifier and Type | Method and Description |
---|---|
abstract ILcdGXYLayer |
createGXYAsynchronousLayer(ILcdGXYLayer aLayer)
Enables the given layer to be painted asynchronously, depending on the facade instance.
|
abstract ILcyGXYLayerOrderManager |
createGXYAsynchronousLayerOrderManager(ILcyGXYLayerOrderManager aManager)
Creates a new layer order manager based on the given one.
|
abstract ILcyLayerStyleProvider |
createGXYAsynchronousLayerStyleProvider(ILcyLayerStyleProvider aLayerStyleProvider,
ILcdFilter aLayerFilter)
Creates a new asynchronous layer style provider based on the given layer style provider.
|
abstract ILcdGXYViewLabelPainter |
createGXYAsynchronousViewLabelPainter(ILcdGXYView aView,
ILcdGXYViewLabelPainter aViewLabelPainter)
Creates a new view label painter based on the given one.
|
abstract ILcdGXYLayer |
createGXYLspAsynchronousLayer(ILspLayer aLspLayer,
ILcdGXYLayer aGXYLayer)
Enables the given layers to be painted asynchronously, depending on the facade instance.
|
abstract void |
invokeAndWaitOnGXYLayer(ILcdGXYLayer aGXYLayer,
ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
Invokes the given runnable for the given layer without interfering with the layer's painting
thread.
|
abstract void |
invokeLaterOnGXYLayer(ILcdGXYLayer aGXYLayer,
ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
Invokes the given runnable for the given layer without interfering with the layer's painting
thread.
|
abstract void |
invokeLaterOnGXYLayerInEDT(ILcdGXYLayer aGXYLayer,
ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
Invokes the given runnable for the given layer without interfering with the layer's painting
thread.
|
abstract void |
invokeNowOnGXYLayer(ILcdGXYLayer aGXYLayer,
ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
Executes the given invocation for the given layer.
|
abstract void |
setupGXYAsynchronousPaintQueueManager(ILcdGXYView aView)
Creates a new paint queue manager for the given view's asynchronous layers.
|
protected ALcyAsynchronousPaintFacade()
ALcyAsynchronousPaintFacade
.public abstract ILcdGXYLayer createGXYAsynchronousLayer(ILcdGXYLayer aLayer)
After calling this method, the given layer may be painted in a painting thread other than the
event dispatch thread. To access the original layer so that the access does not interfere with
the both synchronous and asynchronous painting, use invokeAndWaitOnGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousLayerRunnable)
or invokeLaterOnGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousLayerRunnable)
.
aLayer
- the layer to paint asynchronously. The layer's paint method should take care when
waiting for another thread: if that thread in turn waits for asynchronous
painting to complete, a deadlock will occur.aLayer
.public abstract ILcdGXYLayer createGXYLspAsynchronousLayer(ILspLayer aLspLayer, ILcdGXYLayer aGXYLayer)
Enables the given layers to be painted asynchronously, depending on the facade instance.
Both aLspLayer
and aGXYLayer
should represent the same model.
Depending on whether the used hardware supports Lightspeed rendering, the Lightspeed layer
will be used to render the body
representation of the
visualization. The GXY layer is used for all parts of the visualization that are not taken care
off by the Lightspeed layer (selection, labeling).
After calling this method, the given layers may be painted in a painting thread other than
the event dispatch thread. To access the original GXY layer so that it does not interfere
with both synchronous and asynchronous painting, use invokeAndWaitOnGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousLayerRunnable)
or
invokeLaterOnGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousLayerRunnable)
. The original Lightspeed layer should not be accessed.
aLspLayer
- The Lightspeed layer used to display the body
representation
of the visualizationaGXYLayer
- The GXY layer used to display all other representations of the visualizationaGXYLayer
.public abstract void invokeLaterOnGXYLayer(ILcdGXYLayer aGXYLayer, ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
To avoid concurrency problems with property change listeners, layer property changes will be fired on the event dispatch thread, not on the paint thread.
aGXYLayer
- the layer that will be accessed and/or changed. Any
ILcdGXYLayer
is allowed, but if a layer was used in createGXYAsynchronousLayer(com.luciad.view.gxy.ILcdGXYLayer)
, only the result of the latter method should
be passed, not the original layer.aLayerRunnable
- the runnable to invoke. The runnable will be called with the original
layer of the aforementioned aGXYLayer
. The runnable's
run
method should take care when waiting for another thread:
if that thread in turn waits for the painting thread to stop, a deadlock
will occur.public abstract void invokeLaterOnGXYLayerInEDT(ILcdGXYLayer aGXYLayer, ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
aGXYLayer
- the layer that will be accessed and/or changed. Any
ILcdGXYLayer
is allowed, but if a layer was used in createGXYAsynchronousLayer(com.luciad.view.gxy.ILcdGXYLayer)
, only the result of the latter method should
be passed, not the original layer.aLayerRunnable
- the runnable to invoke. The runnable will be called with the original
layer of the aforementioned aGXYLayer
.public abstract void invokeAndWaitOnGXYLayer(ILcdGXYLayer aGXYLayer, ILcdGXYAsynchronousLayerRunnable aLayerRunnable) throws InterruptedException
aGXYLayer
- the layer that will be accessed and/or changed. Any
ILcdGXYLayer
is allowed, but if a layer was used in createGXYAsynchronousLayer(com.luciad.view.gxy.ILcdGXYLayer)
, only the result of the latter method should
be passed, not the original layer.aLayerRunnable
- the runnable to invoke. The runnable will be called with the original
layer of the aforementioned aGXYLayer
. The runnable's
run
method should take care when waiting for another thread:
if that thread in turn waits for the painting thread to stop, a deadlock
will occur.InterruptedException
- when the thread is interrupted while waiting for the execution to
completepublic abstract void invokeNowOnGXYLayer(ILcdGXYLayer aGXYLayer, ILcdGXYAsynchronousLayerRunnable aLayerRunnable)
aGXYLayer
- the layer that will be accessed and/or changed. Any
ILcdGXYLayer
is allowed, but if a layer was used in createGXYAsynchronousLayer(com.luciad.view.gxy.ILcdGXYLayer)
, only the result of the latter method should
be passed, not the original layer.aLayerRunnable
- the runnable to invoke. The runnable will be called with the original
layer of the aforementioned aGXYLayer
.public abstract ILcyGXYLayerOrderManager createGXYAsynchronousLayerOrderManager(ILcyGXYLayerOrderManager aManager)
aManager
- the manager to delegate to. The new manager will respect the constraints and
behavior of this manager.public abstract ILcdGXYViewLabelPainter createGXYAsynchronousViewLabelPainter(ILcdGXYView aView, ILcdGXYViewLabelPainter aViewLabelPainter)
aView
- the view for which to create a label painteraViewLabelPainter
- an existing view label painterpublic abstract void setupGXYAsynchronousPaintQueueManager(ILcdGXYView aView)
Creates a new paint queue manager for the given view's asynchronous layers.
aView
- the view for which the manager is createdTLcdGXYAsynchronousPaintQueueManager
,
TLcyCompositeAsynchronousPaintHintProvider
public abstract ILcyLayerStyleProvider createGXYAsynchronousLayerStyleProvider(ILcyLayerStyleProvider aLayerStyleProvider, ILcdFilter aLayerFilter)
aLayerStyleProvider
- a given layer style provider.aLayerFilter
- a filter which returns true for layers for which the new layer style
provider should work.