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) |
void |
fireProgressChanged(int progress) |
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) |
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() |
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, yield
private 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)
addProgressListener
in interface IProgressEmitter
public PropertyChangeListener[] getProgressListeners(String propertyName)
getProgressListeners
in interface IProgressEmitter
public void fireProgressChanged(int progress)
fireProgressChanged
in interface IProgressEmitter
public boolean isCancelled(AbstractProcessingTask task)
isCancelled
in interface ICancelable
ICancelable.isCancelled(AbstractProcessingTask)
public boolean isCancelable()
isCancelable
in interface ICancelable
public void setCancelable(boolean isCancelable)
setCancelable
in interface ICancelable
isCancelable
- the isCancelable to setpublic boolean isVirtual()
isVirtual
in interface IProcessingTask
public void setVirtual(boolean virtual)
public void setParentTask(AbstractProcessingTask parentTask)
setParentTask
in interface IProcessingTask
public AbstractProcessingTask getParentTask()
getParentTask
in interface IProcessingTask
Copyright © 2009–2016 Helmut Ahammer, Philipp Kainz. All rights reserved.