public interface ILcdGXYAsynchronousPaintQueue
paint(java.awt.Graphics, com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousLayerWrapper, int, com.luciad.view.gxy.ILcdGXYView)
method is called.
Unless stated otherwise, all methods should be called in the Event Dispatch Thread (AWT thread, Swing thread).
Modifier and Type | Method and Description |
---|---|
void |
addGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
Registers an
ILcdGXYAsynchronousPaintListener to be informed of asynchronous painting events. |
ILcdGXYView |
getGXYAsynchronousView(ILcdGXYAsynchronousLayerWrapper aWrapper,
int aMode,
ILcdGXYView aGXYView)
Returns the view on which the asynchronous paint requests are actually
executed.
|
void |
invokeAndWait(Runnable aRunnable)
Executes the given
Runnable synchronously, but without interfering with the paint thread. |
void |
invokeLater(Runnable aRunnable)
Executes the given
Runnable in the paint thread and returns immediately. |
void |
invokeLaterInEDT(Runnable aRunnable)
Executes the given
Runnable in the event dispatch thread and returns immediately. |
boolean |
isEmpty()
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)
Paints an image of the painted layers using the given graphics.
|
void |
removeGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
Stops informing the given
ILcdGXYAsynchronousPaintListener of asynchronous painting events. |
void |
reset()
Clears all cached images and paint requests.
|
void paint(Graphics aGraphics, ILcdGXYAsynchronousLayerWrapper aWrapper, int aMode, ILcdGXYView aGXYView)
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).
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.ILcdGXYView getGXYAsynchronousView(ILcdGXYAsynchronousLayerWrapper aWrapper, int aMode, ILcdGXYView aGXYView)
aGXYView
- the original view for which asynchronous paints are meant to be displayed. Paints
for unsupported views are executed synchronously.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)
.void reset() throws InterruptedException
InterruptedException
- when the thread is interrupted while waiting for the asynchronous paint
to completeboolean isEmpty()
void invokeLater(Runnable aRunnable)
Runnable
in the paint thread and returns immediately.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.void invokeLaterInEDT(Runnable aRunnable)
Runnable
in the event dispatch thread and returns immediately.aRunnable
- the Runnable
to execute.void invokeAndWait(Runnable aRunnable) throws InterruptedException
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).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 completevoid addGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
ILcdGXYAsynchronousPaintListener
to be informed of asynchronous painting events.
These events will be thrown in the asynchronous painting thread.aListener
- the listener that should be notifiedvoid removeGXYAsynchronousPaintListener(ILcdGXYAsynchronousPaintListener aListener)
ILcdGXYAsynchronousPaintListener
of asynchronous painting events.aListener
- the listener that should no longer be notified.