org.moyoman.client.reference.util
Class RealizedThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.moyoman.client.reference.util.RealizedThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DebugPanel$1

public abstract class RealizedThread
extends Thread

Provides a thread that waits until a component is realized, then performs a specified action. In this case, realized means when the component has non-zero dimensions. The action is specified by a subclass overriding the method realized().

Since:
v0.16
Version:
v0.16
Author:
Jeffrey M. Thompson

Field Summary
protected  Component _component
          The component on which we're waiting.
private  int _sleepTimeMillis
          The sleep time between checks in milliseconds.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RealizedThread(Component component)
          Construct this object with the given parameter.
RealizedThread(Component component, int sleepTimeMillis)
          Construct this object with the given parameter.
 
Method Summary
abstract  void realized()
          Action to perform when the component is realized.
 void run()
          Wait for the component to be realized, the call realized().
 
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
 

Field Detail

_component

protected Component _component
The component on which we're waiting.


_sleepTimeMillis

private int _sleepTimeMillis
The sleep time between checks in milliseconds.

Constructor Detail

RealizedThread

public RealizedThread(Component component)
Construct this object with the given parameter.

Parameters:
component - The component on which we're waiting.
Since:
v0.16

RealizedThread

public RealizedThread(Component component,
                      int sleepTimeMillis)
Construct this object with the given parameter.

Parameters:
component - The component on which we're waiting.
sleepTimeMillis - The sleep time between checks in milliseconds.
Since:
v0.16
Method Detail

realized

public abstract void realized()
Action to perform when the component is realized. Subclasses need to override this method.

Since:
v0.16

run

public void run()
Wait for the component to be realized, the call realized().

Specified by:
run in interface Runnable
Overrides:
run in class Thread
Since:
v0.16