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
    • 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 returns TASK_REJECTED instead of a task ID value.
        Parameters:
        mapContent - the map content holding the layers to be rendered
        renderer - the renderer to use
        graphics - the graphics object to draw into
        listener - 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 are null
        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 returns TASK_REJECTED instead of a task ID value.
        Parameters:
        mapContent - the map content holding the layers to be rendered
        operands - operands for each of the sub-tasks composing this task
        listener - 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 are null
        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 whether shutdown() has been called.
        Returns:
        true if the executor has been shut down