public abstract class ImageProcessingTask extends Thread implements IProgressEmitter, ICancelable, IProcessingTask
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isCancelable
A flag, whether the operator can be cancelled or not.
|
protected AbstractProcessingTask |
parentTask
A reference to the task, an operator is executed in.
|
private PropertyChangeSupport |
pcs
PropertyChangeSupport for the Operator class. |
protected boolean |
virtual
A flag whether or not the processing task uses temporary hard disk
storage for large data formats.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
ImageProcessingTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProgressListener(PropertyChangeListener listener,
String propertyName)
Adds the
IProgressListener for the given property name. |
void |
fireProgressChanged(int progress)
Fire the progress of the operator to any
IProgressListener. |
AbstractProcessingTask |
getParentTask() |
PropertyChangeSupport |
getPcs()
Get the
PropertyChangeSupport for this object. |
abstract long |
getPosition()
This method returns the position on the image processing task, i.e.
|
PropertyChangeListener[] |
getProgressListeners(String propertyName)
List all registered
IProgressListeners for a given property
name. |
abstract long |
getSize()
This method returns the size of the image processing task.
|
boolean |
isCancelable() |
boolean |
isCancelled(AbstractProcessingTask task)
This method should be invoked within long-running operators which shall
be cancelable.
|
abstract boolean |
isFinished()
This method returns true if the task is finished.
|
boolean |
isVirtual()
Returns whether or not the virtual flag has been set at the execution
start of a task.
|
abstract void |
run()
This is the method (inherited from Thread) which will do the bulk
image processing.
|
void |
setCancelable(boolean isCancelable) |
void |
setParentTask(AbstractProcessingTask parentTask) |
void |
setPcs(PropertyChangeSupport pcs)
Set the
PropertyChangeSupport for this object
(should be done in constructor of the implementing class). |
void |
setVirtual(boolean virtual) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate PropertyChangeSupport pcs
PropertyChangeSupport for the Operator class.
Use this variable to emit property changes like status updates from
0 to 100%.protected boolean virtual
protected AbstractProcessingTask parentTask
protected boolean isCancelable
public abstract void run()
public abstract long getSize()
public abstract long getPosition()
public abstract boolean isFinished()
public PropertyChangeSupport getPcs()
PropertyChangeSupport for this object.public void setPcs(PropertyChangeSupport pcs)
PropertyChangeSupport for this object
(should be done in constructor of the implementing class).pcs - the pcs to setpublic void addProgressListener(PropertyChangeListener listener, String propertyName)
IProgressEmitterIProgressListener for the given property name.addProgressListener in interface IProgressEmitterlistener - the IProgressListener to be addedpropertyName - the name of the property declared in the corresponding
PropertyChangeEvent, or null if the
IProgressListener shall receive all events.public PropertyChangeListener[] getProgressListeners(String propertyName)
IProgressEmitterIProgressListeners for a given property
name.getProgressListeners in interface IProgressEmitterpropertyName - the name of the property declared in the corresponding
PropertyChangeEvent, or null if all
IProgressListeners shall be retrieved.IProgressListenerspublic void fireProgressChanged(int progress)
IProgressEmitterIProgressListener.fireProgressChanged in interface IProgressEmitterpublic boolean isCancelled(AbstractProcessingTask task)
isCancelled in interface ICancelableICancelable.isCancelled(AbstractProcessingTask)public boolean isCancelable()
isCancelable in interface ICancelablepublic void setCancelable(boolean isCancelable)
setCancelable in interface ICancelableisCancelable - the isCancelable to setpublic boolean isVirtual()
IProcessingTaskisVirtual in interface IProcessingTasktrue if every item is serialized to the hard disk
and loaded again on demand, false if the entire
processing is performed within the memory.public void setVirtual(boolean virtual)
public void setParentTask(AbstractProcessingTask parentTask)
setParentTask in interface IProcessingTaskpublic AbstractProcessingTask getParentTask()
getParentTask in interface IProcessingTaskCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.