javatools.swing
Class StatusLabelSync

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javatools.swing.StatusLabelSync
All Implemented Interfaces:
java.lang.Runnable, RunningRunnable

public class StatusLabelSync
extends java.lang.Thread
implements 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();


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StatusLabelSync()
          Creates a new instance of StatusLabelSync
 
Method Summary
 void removeMessage(java.lang.String threadName)
          Removes the message previously set.
 void run()
          Thread's run method.
 void setMessage(java.lang.String threadName, java.lang.String message)
          Sets the message to be displayed.
 void setStatusLabel(javax.swing.JLabel pStatusLabel)
          Sets the status label in which messages will be displayed.
 void stopAll()
          Stops the thread.
 void wakeUp()
          Effectively shows the string of the status label.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatusLabelSync

public StatusLabelSync()
Creates a new instance of StatusLabelSync

Method Detail

run

public void run()
Thread's run method.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

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.

Parameters:
pStatusLabel - The label to use.

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.

Parameters:
threadName - The message group.
message - The message to be displayed.

removeMessage

public void removeMessage(java.lang.String threadName)
Removes the message previously set.

Parameters:
threadName - The message group.

wakeUp

public void wakeUp()
Effectively shows the string of the status label.

Specified by:
wakeUp in interface RunningRunnable