java.lang.Object
java.lang.Thread
javatools.swing.StatusLabelSync
- All Implemented Interfaces:
- java.lang.Runnable, javatools.util.RunningRunnable
- public class StatusLabelSync
- extends java.lang.Thread
- implements javatools.util.RunningRunnable
It is a thread to control messages displayed into a status label. Use this
sequence of commands:
StatusLabelSync sync = new StatusLabelSync();
sync.setStatusLabel(myOwnJLabel);
sync.start();
-- repeat
sync.setMessage(theMessageGroup, theMessageToBeDisplayed);
// make what you need
sync.removeMessage(theMessageGroup);
-- return to repeat while you need it.
sync.stopAll();
- Version:
- 0.1.8
| Nested classes inherited from class java.lang.Thread |
java.lang.Thread.UncaughtExceptionHandler |
|
Constructor Summary |
StatusLabelSync()
Creates a new instance of StatusLabelSync |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, 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 |
statusLabel
private javax.swing.JLabel statusLabel
name2message
private java.util.HashMap name2message
stoppedExternally
private boolean stoppedExternally
formatter
private java.text.MessageFormat formatter
javatoolsBundle
private java.util.ResourceBundle javatoolsBundle
tempArray
private java.lang.Object[] tempArray
StatusLabelSync
public StatusLabelSync()
- Creates a new instance of StatusLabelSync
run
public void run()
- Thread's run method.
- Specified by:
run in interface java.lang.Runnable
stopAll
public void stopAll()
- Stops the thread.
setStatusLabel
public void setStatusLabel(javax.swing.JLabel pStatusLabel)
- Sets the status label in which messages will be displayed.
setMessage
public void setMessage(java.lang.String threadName,
java.lang.String message)
- Sets the message to be displayed. It will be displayed only if the message is
lonely, otherwise a message of the type "X concurrent operations under execution"
will be displayed.
removeMessage
public void removeMessage(java.lang.String threadName)
- Removes the message previously set.
wakeUp
public void wakeUp()
- Effectively shows the string of the status label.
- Specified by:
wakeUp in interface javatools.util.RunningRunnable
doShowLabel
private void doShowLabel()