|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--harmonic.mz.manager.ProgressManager
This is the unit that proceedures talk to to report progress. As the progress state changes this class notifies ProgressListener.
| Nested Class Summary | |
static class |
ProgressManager.WorkItem
|
| Constructor Summary | |
ProgressManager()
|
|
| Method Summary | |
void |
addProgressListener(ProgressListener l)
Adds a listener to the progress state |
void |
addThread(java.lang.Thread thread)
If work is started in a new thread, call this to let the user know |
void |
beginWork(java.lang.String key)
This pushes a message onto the progress feedback interface. |
void |
beginWork(java.lang.String key,
java.lang.String msg)
Call through to beginWork(key), then progress(msg) |
void |
endWork(java.lang.String key)
This pops a message from the progress feedback interface. |
long |
getDuration(java.lang.Thread thread)
Handy function that returns for the work item associated with the given thread, System.currentTimeMillis() - workItem.currentItem.startTime |
float |
getProgress(java.lang.Thread thread)
Handy function that returns for the work item associated with the given thread, WorkItem.currentItem.progress |
java.util.Vector |
getThreads()
Return all threads known to progresss manager |
ProgressManager.WorkItem |
getWorkItem(java.lang.Thread thread)
Returns the WorkItem associated with the given thread |
java.lang.String |
getWorkText(java.lang.Thread thread)
Handy function that generates a blank line deliminated string showing the work stack associated with the given thread |
void |
notifyListeners(ProgressEvent e)
Notify registered listeners |
void |
progress(float p)
Report progress the current (most recently pushed) work item, as a percentage. |
void |
progress(java.lang.String msg)
Report progress in the current (most recently pushed) WorkItem. |
void |
removeProgressListener(ProgressListener l)
Removes a listener from the progress state |
void |
removeThread(java.lang.Thread thread)
If work is started in a new thread, call this to let the user know |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ProgressManager()
| Method Detail |
public void addProgressListener(ProgressListener l)
public void removeProgressListener(ProgressListener l)
public void notifyListeners(ProgressEvent e)
public ProgressManager.WorkItem getWorkItem(java.lang.Thread thread)
public java.lang.String getWorkText(java.lang.Thread thread)
public float getProgress(java.lang.Thread thread)
public long getDuration(java.lang.Thread thread)
public void addThread(java.lang.Thread thread)
Sends a ProgressEvent.THREAD_ADDED event
public void removeThread(java.lang.Thread thread)
Sends a ProgressEvent.THREAD_REMOVED event
public java.util.Vector getThreads()
public void beginWork(java.lang.String key,
java.lang.String msg)
public void beginWork(java.lang.String key)
This progress tracking system mirrors they way computer programs get things done: We start with some general task, and then along the way sub-tasks are executed. Any significant task can call beginWork to push a new work item, and then call progress() along the way to let the user know whats going on. The task may call functions that themselves call beginWork.
This sends a ProgressEvent.THREAD_CHANGED, ProgressEvent.THREAD_CHANGED event
public void progress(java.lang.String msg)
This sends a ProgressEvent.THREAD_CHANGED event
public void progress(float p)
This sends a ProgressEvent.THREAD_CHANGED event
public void endWork(java.lang.String key)
This sends a ProgressEvent.THREAD_CHANGED event
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||