|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.Debug.OnlyDoLastTriggered
This class uses the
SwingUtilities.invokeLater(java.lang.Runnable) method to ensure
that a piece of code is only run once after all events have been
processed.
To use it, you have to create a subclass with an implementation
of doIt(Object, Throwable) which receives two parameters
containing all necessary information about the original situation
the method was triggered.
Then you can use trigger(Object) to trigger the code,
which will be called only once (for your last call to trigger).
| Constructor Summary | |
Debug.OnlyDoLastTriggered()
|
|
| Method Summary | |
protected abstract void |
doIt(java.lang.Object param,
java.lang.Throwable originalStack)
The code that should be processed after it has been triggered. |
void |
trigger(java.lang.Object param)
This method is called to trigger a call to the method doIt(Object, Throwable), which will be called by the
last entry of the event queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Debug.OnlyDoLastTriggered()
| Method Detail |
public final void trigger(java.lang.Object param)
doIt(Object, Throwable), which will be called by the
last entry of the event queue.
param - This parameter is application defined and will be
passed to the implementation of doIt(Object, Throwable)
protected abstract void doIt(java.lang.Object param,
java.lang.Throwable originalStack)
param - The parameter that has been passed to the
method trigger(Object)originalStack - A Throwable representing the
stack at the time the call has been
triggered, because at the time this method
is called the stack will only include the
event queue.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||