Lightspeed view
.public class TLcdGXYLspAsynchronousPaintQueue extends Object implements ILcdGXYAsynchronousPaintQueue
ILcdGXYAsynchronousPaintQueue
paints TLcdGXYLspAsynchronousLayerWrapper
instances asynchronously, using off-screen image buffers.
It behaves similarly to TLcdGXYAsynchronousPaintQueue, except that it uses a
TLcdGXYLspAsynchronousLayerWrapper's Lightspeed layer when appropriate (i.e. when painting
the layer's body representation). See TLcdGXYLspAsynchronousLayerWrapper
for more
information on using a Lightspeed layer to speed up rendering in an ILcdGXYView
.TLcdGXYLspAsynchronousLayerWrapper
Constructor and Description |
---|
TLcdGXYLspAsynchronousPaintQueue(ILcdGXYView aView)
Deprecated.
Creates a new asynchronous paint queue for the given view.
|
Modifier and Type | Method and Description |
---|---|
void |
addGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
Deprecated.
Registers an
ILcdGXYAsynchronousPaintListener to be informed of asynchronous painting events. |
ILcdGXYView |
getGXYAsynchronousView(ILcdGXYAsynchronousLayerWrapper aWrapper,
int aMode,
ILcdGXYView aGXYView)
Deprecated.
Returns the view on which the asynchronous paint requests are actually
executed.
|
ILcdGXYView |
getGXYView()
Deprecated.
Returns the view for which this painter paints asynchronously.
|
int |
getPriority()
Deprecated.
Returns the current thread priority of the internal painting thread.
|
void |
invokeAndWait(Runnable aRunnable)
Deprecated.
Executes the given
Runnable synchronously, but without interfering with the paint thread. |
void |
invokeLater(Runnable aRunnable)
Deprecated.
Executes the given
Runnable in the paint thread and returns immediately. |
void |
invokeLaterInEDT(Runnable aRunnable)
Deprecated.
Executes the given
Runnable in the event dispatch thread and returns immediately. |
boolean |
isEmpty()
Deprecated.
Returns true if the paint queue is not painting and it has no paint requests to finish.
|
void |
paint(Graphics aGraphics,
ILcdGXYAsynchronousLayerWrapper aWrapper,
int aMode,
ILcdGXYView aGXYView)
Deprecated.
Paints an image of the painted layers using the given graphics.
|
void |
removeGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
Deprecated.
Stops informing the given
ILcdGXYAsynchronousPaintListener of asynchronous painting events. |
void |
reset()
Deprecated.
Clears all cached images and paint requests.
|
void |
setPriority(int aPriority)
Deprecated.
Sets the thread priority to be used by the internal painting thread.
|
public TLcdGXYLspAsynchronousPaintQueue(ILcdGXYView aView)
TLcdGXYViewJPanel
,
TLcdGXYViewJPanelLightWeight
, and
TLcdGXYViewBufferedImage
views.
This view must be painted in the event dispatch thread.aView
- the view for which to paint asynchronouslypublic ILcdGXYView getGXYView()
public void paint(Graphics aGraphics, ILcdGXYAsynchronousLayerWrapper aWrapper, int aMode, ILcdGXYView aGXYView)
ILcdGXYAsynchronousPaintQueue
Note that the paint queue is free to decide if it will execute the paint synchronously or asynchronously (e.g. when confronted with unsupported views).
paint
in interface ILcdGXYAsynchronousPaintQueue
aGraphics
- the graphics to use for paintingaWrapper
- the asynchronous layer wrapper that should be paintedaMode
- the mode indicating what should be painted, see ILcdGXYLayer.paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYView)
.aGXYView
- the view for which the layer should be painted.public boolean isEmpty()
ILcdGXYAsynchronousPaintQueue
isEmpty
in interface ILcdGXYAsynchronousPaintQueue
public ILcdGXYView getGXYAsynchronousView(ILcdGXYAsynchronousLayerWrapper aWrapper, int aMode, ILcdGXYView aGXYView)
ILcdGXYAsynchronousPaintQueue
getGXYAsynchronousView
in interface ILcdGXYAsynchronousPaintQueue
aWrapper
- the asynchronous layer wrapper that would be paintedaMode
- the mode indicating what should be painted, see ILcdGXYLayer.paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYView)
.aGXYView
- the original view for which asynchronous paints are meant to be displayed. Paints
for unsupported views are executed synchronously.public void invokeAndWait(Runnable aRunnable) throws InterruptedException
ILcdGXYAsynchronousPaintQueue
Runnable
synchronously, but without interfering with the paint thread.
This call blocks until all
asynchronous paints and runnables have been processed, and the Runnable
returns.
The invocation is executed in the view's paint thread (typically the EDT).invokeAndWait
in interface ILcdGXYAsynchronousPaintQueue
aRunnable
- the Runnable
to execute. The run
method should take care
when waiting for another thread: if that thread in turn waits for asynchronous painting to complete,
a deadlock will occur.InterruptedException
- when the thread is interrupted while waiting for the execution
to completepublic void invokeLater(Runnable aRunnable)
ILcdGXYAsynchronousPaintQueue
Runnable
in the paint thread and returns immediately.invokeLater
in interface ILcdGXYAsynchronousPaintQueue
aRunnable
- the Runnable
to execute. The run
method should take care
when waiting for another thread: if that thread in turn waits for asynchronous painting to complete,
a deadlock will occur.public void invokeLaterInEDT(Runnable aRunnable)
ILcdGXYAsynchronousPaintQueue
Runnable
in the event dispatch thread and returns immediately.invokeLaterInEDT
in interface ILcdGXYAsynchronousPaintQueue
aRunnable
- the Runnable
to execute.public void addGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
ILcdGXYAsynchronousPaintQueue
ILcdGXYAsynchronousPaintListener
to be informed of asynchronous painting events.
These events will be thrown in the asynchronous painting thread.addGXYAsynchronousPaintListener
in interface ILcdGXYAsynchronousPaintQueue
aListener
- the listener that should be notifiedpublic void removeGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
ILcdGXYAsynchronousPaintQueue
ILcdGXYAsynchronousPaintListener
of asynchronous painting events.removeGXYAsynchronousPaintListener
in interface ILcdGXYAsynchronousPaintQueue
aListener
- the listener that should no longer be notified.public int getPriority()
public void setPriority(int aPriority)
aPriority
- the new priority of the internal painting threadpublic void reset() throws InterruptedException
ILcdGXYAsynchronousPaintQueue
reset
in interface ILcdGXYAsynchronousPaintQueue
InterruptedException
- when the thread is interrupted while waiting for the asynchronous paint
to complete