public static class SplashScreen.SplashProgressMonitor extends SplashScreen.Task implements ProgressMonitor
ProgressMonitor which stores the (sub)tasks in a tree.ProgressMonitor.CancelListener| Modifier and Type | Field and Description |
|---|---|
private SplashScreen.SplashProgressMonitor |
latestSubtask |
private javax.swing.event.ChangeListener |
listener |
private java.lang.String |
name |
private java.util.List<SplashScreen.Task> |
tasks |
ALL_TICKS, DEFAULT_TICKS| Constructor and Description |
|---|
SplashProgressMonitor(java.lang.String name,
javax.swing.event.ChangeListener listener)
Constructs a new
SplashProgressMonitor. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCancelListener(ProgressMonitor.CancelListener listener)
Add listener for user abort action
|
void |
appendLogMessage(java.lang.String message)
Appends a message to the log managed by the progress monitor.
|
void |
beginTask(java.lang.String title)
Starts this progress monitor.
|
void |
beginTask(java.lang.String title,
int ticks)
Starts this progress monitor.
|
void |
cancel()
Abort current operation, usually called when user somehow requested an abort
|
ProgressMonitor |
createSubTaskMonitor(int ticks,
boolean internal)
Creates subtasks monitor.
|
void |
finishTask()
Deprecated.
Use
finishTask(String) instead. |
void |
finishTask(java.lang.String title)
Displays the given task as finished.
|
ProgressTaskId |
getProgressTaskId()
Returns the task ID of the progress dialog
Should be used only by PleaseWaitRunnable
|
int |
getTicks()
Get the current number of work units
|
int |
getTicksCount()
Get the total number of work units
|
java.awt.Component |
getWindowParent()
Return the parent windows of progress dialog
|
void |
indeterminateSubTask(java.lang.String title)
Subtask that will show progress running back and forth
|
void |
invalidate()
Can be used if method receive ProgressMonitor but it's not interested progress monitoring.
|
boolean |
isCanceled()
Returns the state of user aborts
|
void |
removeCancelListener(ProgressMonitor.CancelListener listener)
Remove listener for user abort action
|
void |
setCustomText(java.lang.String text)
Shows additional text
|
void |
setExtraText(java.lang.String text)
Show extra text after normal task title.
|
void |
setProgressTaskId(ProgressTaskId taskId)
Set the task ID of the progress dialog
Should be used only by PleaseWaitRunnable.
|
void |
setTicks(int ticks)
Set the current number of work units
|
void |
setTicksCount(int ticks)
Set the total number of work units
|
void |
subTask(java.lang.String title)
Normal subtask
|
java.lang.StringBuilder |
toHtml(java.lang.StringBuilder sb)
Returns a HTML representation for this task.
|
void |
worked(int ticks)
Increase number of already done work units by ticks
|
toStringprivate final java.lang.String name
private final javax.swing.event.ChangeListener listener
private final java.util.List<SplashScreen.Task> tasks
private SplashScreen.SplashProgressMonitor latestSubtask
public SplashProgressMonitor(java.lang.String name, javax.swing.event.ChangeListener listener)
SplashProgressMonitor.name - namelistener - change listenerpublic java.lang.StringBuilder toHtml(java.lang.StringBuilder sb)
SplashScreen.TasktoHtml in class SplashScreen.Tasksb - a StringBuilder used to build the HTML codesbpublic void beginTask(java.lang.String title)
ProgressMonitorbeginTask in interface ProgressMonitortitle - title text of the taskpublic void beginTask(java.lang.String title, int ticks)
ProgressMonitorbeginTask in interface ProgressMonitortitle - title text of the taskticks - number of work units (see ProgressMonitor.setTicksCount(int ticks))public void setCustomText(java.lang.String text)
ProgressMonitorsetCustomText in interface ProgressMonitortext - custom textpublic void setExtraText(java.lang.String text)
ProgressMonitorsetExtraText in interface ProgressMonitortext - extra textpublic void indeterminateSubTask(java.lang.String title)
ProgressMonitorindeterminateSubTask in interface ProgressMonitortitle - Can be null, in that case task title is not changedpublic void subTask(java.lang.String title)
ProgressMonitorsubTask in interface ProgressMonitortitle - Can be null, in that case task title is not changedpublic ProgressMonitor createSubTaskMonitor(int ticks, boolean internal)
ProgressMonitorcreateSubTaskMonitor in interface ProgressMonitorticks - Number of work units that should be done when subtask finishesinternal - If true then subtask can't modify task title/custom text@Deprecated public void finishTask()
finishTask(String) instead.ProgressMonitorfinishTask in interface ProgressMonitorpublic void finishTask(java.lang.String title)
title - the task titlepublic void invalidate()
ProgressMonitorProgressMonitor.beginTask(String) and ProgressMonitor.finishTask()
This method can be also used in finally section if method expects that some exception
might prevent it from passing progressMonitor away. If ProgressMonitor.beginTask(String) was
already called then this method does nothing.invalidate in interface ProgressMonitorpublic void setTicksCount(int ticks)
ProgressMonitorsetTicksCount in interface ProgressMonitorticks - Number of total work unitspublic int getTicksCount()
ProgressMonitorgetTicksCount in interface ProgressMonitorpublic void setTicks(int ticks)
ProgressMonitorsetTicks in interface ProgressMonitorticks - Number of work units already donepublic int getTicks()
ProgressMonitorgetTicks in interface ProgressMonitorpublic void worked(int ticks)
ProgressMonitorworked in interface ProgressMonitorticks - number of ticks to addpublic boolean isCanceled()
ProgressMonitorisCanceled in interface ProgressMonitortrue if user aborted operationpublic void cancel()
ProgressMonitorcancel in interface ProgressMonitorpublic void addCancelListener(ProgressMonitor.CancelListener listener)
ProgressMonitoraddCancelListener in interface ProgressMonitorlistener - the listener for cancel operationpublic void removeCancelListener(ProgressMonitor.CancelListener listener)
ProgressMonitorremoveCancelListener in interface ProgressMonitorlistener - the listener for cancel operationpublic void appendLogMessage(java.lang.String message)
ProgressMonitorappendLogMessage in interface ProgressMonitormessage - the log message. Ignored if null or white space only.public void setProgressTaskId(ProgressTaskId taskId)
ProgressMonitor<> null then "In background" button will be shownsetProgressTaskId in interface ProgressMonitortaskId - the task IDpublic ProgressTaskId getProgressTaskId()
ProgressMonitorgetProgressTaskId in interface ProgressMonitorpublic java.awt.Component getWindowParent()
ProgressMonitorgetWindowParent in interface ProgressMonitor