Package org.geotools.swing
Interface RenderingExecutor
-
- All Known Implementing Classes:
DefaultRenderingExecutor
public interface RenderingExecutor
Defines the core methods for executors used to run drawing tasks on background threads.- Since:
- 8.0
- Author:
- Michael Bedward
-
-
Field Summary
Fields Modifier and Type Field Description static long
TASK_REJECTED
Value returned by the submit(org.geotools.map.MapContent, org.geotools.renderer.GTRenderer, java.awt.Graphics2D, org.geotools.swing.RenderingExecutorListener) method if a task is rejected by the executor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel(long taskId)
Cancels a specific rendering task.void
cancelAll()
long
getPollingInterval()
Get the interval for polling the result of a rendering taskboolean
isShutdown()
Checks whethershutdown()
has been called.void
setPollingInterval(long interval)
Set the interval for polling the result of a rendering taskvoid
shutdown()
Stops any current rendering tasks and cleans up resources.long
submit(MapContent mapContent, List<RenderingOperands> operands, RenderingExecutorListener listener)
Submits a new rendering task to the executor.long
submit(MapContent mapContent, GTRenderer renderer, Graphics2D graphics, RenderingExecutorListener listener)
Submits a new rendering task to the executor.
-
-
-
Field Detail
-
TASK_REJECTED
static final long TASK_REJECTED
Value returned by the submit(org.geotools.map.MapContent, org.geotools.renderer.GTRenderer, java.awt.Graphics2D, org.geotools.swing.RenderingExecutorListener) method if a task is rejected by the executor.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPollingInterval
long getPollingInterval()
Get the interval for polling the result of a rendering task- Returns:
- polling interval in milliseconds
-
setPollingInterval
void setPollingInterval(long interval)
Set the interval for polling the result of a rendering task- Parameters:
interval
- interval in milliseconds (values<=
0 are ignored)
-
submit
long submit(MapContent mapContent, GTRenderer renderer, Graphics2D graphics, RenderingExecutorListener listener)
Submits a new rendering task to the executor. The specified listener will be notified of task progress. If the task is rejected by the executor for any reason, this method returnsTASK_REJECTED
instead of a task ID value.- Parameters:
mapContent
- the map content holding the layers to be renderedrenderer
- the renderer to usegraphics
- the graphics object to draw intolistener
- the listener to be notified of task progress- Returns:
- either a task ID value (which should be positive and unique across all executors and
rendering tasks) if the task was accepted; or
TASK_REJECTED
- Throws:
IllegalArgumentException
- if any arguments arenull
IllegalStateException
- if called after the executor has been shut down
-
submit
long submit(MapContent mapContent, List<RenderingOperands> operands, RenderingExecutorListener listener)
Submits a new rendering task to the executor. The specified listener will be notified of task progress. If the task is rejected by the executor for any reason, this method returnsTASK_REJECTED
instead of a task ID value.- Parameters:
mapContent
- the map content holding the layers to be renderedoperands
- operands for each of the sub-tasks composing this tasklistener
- the listener to be notified of task progress- Returns:
- either a task ID value (which should be positive and unique across all executors and
rendering tasks) if the task was accepted; or
TASK_REJECTED
- Throws:
IllegalArgumentException
- if any arguments arenull
IllegalStateException
- if called after the executor has been shut down
-
cancel
void cancel(long taskId)
Cancels a specific rendering task.- Parameters:
taskId
- the ID value of the task
-
cancelAll
void cancelAll()
-
shutdown
void shutdown()
Stops any current rendering tasks and cleans up resources. After calling this method the executor is no longer usable.
-
isShutdown
boolean isShutdown()
Checks whethershutdown()
has been called.- Returns:
true
if the executor has been shut down
-
-