|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectchemaxon.jchem.file.ProgressWriter
Class to display the progress of some operation. This class can be used standalone, or as an ancestor for custom progress reporter classes.
| Nested Class Summary | |
static interface |
ProgressWriter.Logger
Interface for retreiving messages for events (especially errors) which were suppressed during execution. |
| Field Summary | |
static int |
ERROR
Log level error |
static int |
INFO
Log level info |
protected long |
max
The maximum value -- the higher end of the progress value. |
protected long |
min
The minimum value -- the lower end of the progress value. |
protected java.lang.String |
note
The additional note that is displayed along with the progress message. |
static int |
WARNING
Log level warning |
| Constructor Summary | |
ProgressWriter(java.lang.String note,
long min,
long max)
Constructs a object displaying progress and starts monitoring the elapsed time. |
|
| Method Summary | |
void |
addLogger(ProgressWriter.Logger logger)
Adds a ProgressWriter.Logger to retreive suppressed (error) messages. |
void |
calcExpTime()
Recalculates expected time. |
void |
close()
Indicate that the operation is complete. |
java.lang.String |
getExpTimeString()
Returns text for displaying the expected remaining time. |
long |
getMaximum()
Returns the maximum value -- the higher end of the progress value. |
long |
getMinimum()
Returns the minimum value -- the lower end of the progress value. |
java.lang.String |
getNote()
Returns the additional note that is displayed along with the progress message. |
long |
getProgress()
Return the current value of the monitored progress. |
long |
getRemainingDays()
Returns the "days" part of the remaining time. |
long |
getRemainingHours()
Returns the "hours" part of the remaining time. |
long |
getRemainingMinutes()
Returns the "minutes" part of the remaining time. |
long |
getRemainingSeconds()
Returns the "seconds" part of the remaining time. |
boolean |
isCanceled()
Indicates, if the progress was canceled. |
void |
log(int severity,
java.lang.String message,
java.lang.Throwable t)
Log a message which needs to be retreived for a "suppressed" event during execution. |
void |
setCanceled(boolean value)
Specifies, if the progress was canceled. |
void |
setMaximum(long m)
Specifies the maximum value. |
void |
setMinimum(long m)
Specifies the minimum value. |
void |
setNote(java.lang.String note)
Specifies the additional note that is displayed along with the progress message. |
void |
setProgress(long nv)
Indicate the progress of the operation being monitored. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ERROR
public static final int WARNING
public static final int INFO
protected long min
protected long max
protected java.lang.String note
| Constructor Detail |
public ProgressWriter(java.lang.String note,
long min,
long max)
note - a short note describing the state of the
operation. As the operation progresses, you can call
setNote to change the note displayed. This is used,
for example, in operations that iterate through a
list of files to show the name of the file being processed.min - the lower bound of the rangemax - the upper bound of the range| Method Detail |
public void addLogger(ProgressWriter.Logger logger)
ProgressWriter.Logger to retreive suppressed (error) messages.
logger -
public void log(int severity,
java.lang.String message,
java.lang.Throwable t)
ProgressWriter.Loggers added to this ProgressWriter
instance, the message will be passed to those instances. If there is no
ProgressWriter.Logger instance registered, the message is written to the standard
error.
severity - message - t - public long getProgress()
public void setProgress(long nv)
nv - specifies the current value, between the
maximum and minimum specified for this componentsetMinimum(long),
setMaximum(long),
close()public void close()
public long getMinimum()
setMinimum(long)public void setMinimum(long m)
m - specifies the minimum valuegetMinimum()public long getMaximum()
setMaximum(long)public void setMaximum(long m)
m - specifies the maximum valuegetMaximum()public void setNote(java.lang.String note)
note - a String specifying the note to displaygetNote()public java.lang.String getNote()
setNote(java.lang.String)public long getRemainingSeconds()
calcExpTime() should be called before,
to udate calculations.
public long getRemainingMinutes()
calcExpTime() should be called before,
to udate calculations.
public long getRemainingHours()
calcExpTime() should be called before,
to udate calculations.
public long getRemainingDays()
calcExpTime() should be called before,
to udate calculations.
public java.lang.String getExpTimeString()
public void calcExpTime()
getRemainingSeconds(),
getRemainingMinutes(),
getRemainingHours() and
getRemainingDays().
public boolean isCanceled()
true if the progress was canceledpublic void setCanceled(boolean value)
value - set to true to cancel the operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||