|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.fraid.plugin.PaintAlgorithmThread
public abstract class PaintAlgorithmThread
The super class for all graphics algorithms in FrAid.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected boolean |
mFirstTime
|
protected BehaviorBean |
mPlugIn
The plugin we are working with (very important, an algorithm can't do anything without its plugin). |
protected int |
mProgressVar
If you increment this variable within your algorithm loops a progress bar somewhere can show where are we. |
protected long |
mTime
|
protected GraphicsUser |
owner
The user for the image we are generating. |
protected int |
screenHeight
|
protected int |
screenWidth
|
protected int |
state
The current state. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
PaintAlgorithmThread(GraphicsUser aOwner,
BehaviorBean aPlugIn)
Creates a new PaintAlgorithmThread instance. |
|
| Method Summary | |
|---|---|
protected abstract void |
allocateNewImage()
Depending what the underlying image is (BufferedImage or int array) storrage is allocated. |
protected abstract void |
applyAlgorithm()
This is the actual algorithm. |
abstract java.awt.image.BufferedImage |
createImage()
Turns its internal representation to a BufferedImage. |
abstract void |
drawGridLines(DoublePoint aP)
Plots the grid (if there was created one). |
void |
fillModel()
|
GraphicsUser |
getOwner()
Returns the current user of our graphics. |
ProgressStatistics |
getProgressStatistics()
If mProgressVar is used will return some info what progress is being done. |
java.lang.String |
getThreadName()
|
int |
getThreadState()
The current state. |
void |
goToWait()
Effectively suspends the thread. |
void |
goToWork()
If the thread is not working wake it up. |
void |
printDebugMessage(java.lang.String aComment)
|
void |
requestStop()
Allways do this when you close the owning window/user. |
void |
restart(java.awt.Dimension screenSize)
The requirements changed, start over. |
void |
run()
This is all an algorithm does. |
void |
subjectChanged()
Notification that the subject we are plotting changed. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int screenWidth
protected int screenHeight
protected boolean mFirstTime
protected long mTime
protected GraphicsUser owner
protected BehaviorBean mPlugIn
protected volatile int state
ThreadStateprotected volatile int mProgressVar
| Constructor Detail |
|---|
public PaintAlgorithmThread(GraphicsUser aOwner,
BehaviorBean aPlugIn)
PaintAlgorithmThread instance.
aOwner - a GraphicsUser valueaPlugIn - a BehaviourPlugInAdapter value| Method Detail |
|---|
public java.lang.String getThreadName()
public void printDebugMessage(java.lang.String aComment)
public GraphicsUser getOwner()
GraphicsUser valuepublic void goToWait()
public void goToWork()
public void requestStop()
public void restart(java.awt.Dimension screenSize)
screenSize - a Dimension valueprotected abstract void allocateNewImage()
public abstract java.awt.image.BufferedImage createImage()
BufferedImage valuepublic int getThreadState()
int valueThreadStatepublic ProgressStatistics getProgressStatistics()
ProgressStatistics valuepublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic abstract void drawGridLines(DoublePoint aP)
aP - a DoublePoint valuepublic void subjectChanged()
protected abstract void applyAlgorithm()
public void fillModel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||