Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.swing
Class StatusLabelSync  view StatusLabelSync download StatusLabelSync.java

java.lang.Object
  extended byjava.lang.Thread
      extended byjavatools.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 Class Summary
 
Nested classes inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  java.text.MessageFormat formatter
           
private  java.util.ResourceBundle javatoolsBundle
           
private  java.util.HashMap name2message
           
private  javax.swing.JLabel statusLabel
           
private  boolean stoppedExternally
           
private  java.lang.Object[] tempArray
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StatusLabelSync()
          Creates a new instance of StatusLabelSync
 
Method Summary
private  void doShowLabel()
           
 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
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

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()