Class TaskEvent

All Implemented Interfaces:
Serializable

public class TaskEvent extends AWTEvent
An event that describes the life cycle of a task.
Since:
1.0.0
Version:
"1.0.14" - b202111241200L
Author:
Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020 - github.com/jorigin/jcommon (contact@jorigin.org)
See Also:
  • Field Details

    • TASK_STARTED

      public static final int TASK_STARTED
      The task has started.
      See Also:
    • TASK_PROGRESS

      public static final int TASK_PROGRESS
      The task has progressed.
      See Also:
    • TASK_SUSPENDED

      public static final int TASK_SUSPENDED
      The task is suspended.
      See Also:
    • TASK_FINISHED

      public static final int TASK_FINISHED
      The task has finished.
      See Also:
    • TASK_WARNING

      public static final int TASK_WARNING
      The task has produced a warning.
      See Also:
    • TASK_ERROR

      public static final int TASK_ERROR
      The task has produced an error.
      See Also:
    • TASK_INFO

      public static final int TASK_INFO
      The task has produces an information.
      See Also:
  • Constructor Details

    • TaskEvent

      public TaskEvent(Object source, int id)
      Create a new task event.
      Parameters:
      source - the source (task) of the event.
      id - the identifier of the task.
    • TaskEvent

      public TaskEvent(AWTEvent event)
      Create a new task event.
      Parameters:
      event - the original event to copy.
    • TaskEvent

      public TaskEvent(Object source, int id, String name)
      Create a new task event.
      Parameters:
      source - the source (task) of the event.
      id - the identifier of the task.
      name - the name of the task.
    • TaskEvent

      public TaskEvent(Object source, int id, String name, String description)
      Create a new task event.
      Parameters:
      source - the source (task) of the event.
      id - the identifier of the task.
      name - the name of the task.
      description - the description of the event.
    • TaskEvent

      public TaskEvent(Object source, int id, int size)
      Create a new task event.
      Parameters:
      source - the source (task) of the event.
      id - the identifier of the task.
      size - the size of the event in case of progress monitoring. If the event is TASK_STARTED, the size is the size of the task. If the event is TASK_PROGRESS, the size is the actually accomplished part of the task.
    • TaskEvent

      public TaskEvent(Object source, int id, String name, int size)
      Create a new task event.
      Parameters:
      source - the source (task) of the event.
      id - the identifier of the task.
      name - the name of the task.
      size - the size of the event in case of progress monitoring. If the event is TASK_STARTED, the size is the size of the task. If the event is TASK_PROGRESS, the size is the actually accomplished part of the task.
    • TaskEvent

      public TaskEvent(Object source, int id, String name, String description, int size)
      Create a new task event.
      Parameters:
      source - the source (task) of the event.
      id - the identifier of the task.
      name - the name of the task.
      description - the description of the event.
      size - the size of the event in case of progress monitoring. If the event is TASK_STARTED, the size is the size of the task. If the event is TASK_PROGRESS, the size is the actually accomplished part of the task.
  • Method Details

    • getTaskName

      public String getTaskName()
      Get the name of the task attached to this event
      Returns:
      String the name of the task attached to this event
    • getDescription

      public String getDescription()
      Get the description of the task
      Returns:
      String the description of the task
    • getSize

      public int getSize()
      Get the size of the task.
      Returns:
      int the size of the task