ifs.util
Class Progress

java.lang.Object
  extended by ifs.util.Progress

public class Progress
extends Object

Progress bar.

Single instance class for recording the current state. It also allows recursive storing/restoring of the progress.

Use:

Version:
1.0
Author:
Tomáš Müller

Method Summary
 void addProgressListener(ProgressListener listener)
          Adds progress listener
static Progress getInstance()
          Progress instance
 String getPhase()
          Current phase
 long getProgress()
          Current progress
 long getProgressMax()
          Maximum of current progress
 String getStatus()
          Current status
 void incProgress()
          Increment current progress
 void removeProgressListener(ProgressListener listener)
          Remove progress listener
 void restore()
          Resore the progress from the heap memory
 void save()
          Save current progress to the heap memory
 void setPhase(String phase)
          Sets current phase.
 void setPhase(String phase, long progressMax)
          Sets current phase
 void setProgress(long progress)
          Update progress bar.
 void setStatus(String status)
          Sets current status
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Progress getInstance()
Progress instance


getStatus

public String getStatus()
Current status


setStatus

public void setStatus(String status)
Sets current status


getPhase

public String getPhase()
Current phase


setPhase

public void setPhase(String phase,
                     long progressMax)
Sets current phase

Parameters:
phase - phase name
progressMax - maximum of progress bar

setPhase

public void setPhase(String phase)
Sets current phase. Maximum of progress bar is set to 100.

Parameters:
phase - phase name

setProgress

public void setProgress(long progress)
Update progress bar.

Parameters:
progress - progress between 0 and progressMax

getProgress

public long getProgress()
Current progress


getProgressMax

public long getProgressMax()
Maximum of current progress


incProgress

public void incProgress()
Increment current progress


addProgressListener

public void addProgressListener(ProgressListener listener)
Adds progress listener


removeProgressListener

public void removeProgressListener(ProgressListener listener)
Remove progress listener


save

public void save()
Save current progress to the heap memory


restore

public void restore()
Resore the progress from the heap memory



Copyright © 2005 Tomáš Müller