|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swt.graph.ObserverRunnable
This class can be used in an SWT context to implement the
method on custom Observer.update(Observable, Object).
The SWT thread model will not allow modifying SWT objects outside of the
UI-Thread, so custom observers need to execute their update code into this
UI-Thread. This can be done by mean of the Observer
or Display.syncExec(java.lang.Runnable) methods.
For a typical example on how one should use this class, see the implementation of Display.asyncExec(java.lang.Runnable).
It does the following;
public void update(Observable o, Object arg)
{
Runnable thread = new ObserverRunnable(o, arg)
{
public void run()
{
viewScrollingController.updateSliders();
//more code follow ..
}
};
getDisplay().syncExec(thread);
}
For more information, one can refer two the following FAQ entry:
uithread
SwtGraphPanel.update(Observable, Object)
| Constructor Summary | |
protected |
ObserverRunnable(Observable o,
java.lang.Object arg)
Initializes instances of ObserverRunnable with the passed Observable information. |
| Method Summary | |
protected java.lang.Object |
getArg()
Provides access to the additional
arguments. |
protected Observable |
getObservable()
Provides access to the . |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Runnable |
run |
| Constructor Detail |
protected ObserverRunnable(Observable o,
java.lang.Object arg)
Initializes instances of ObserverRunnable with the passed Observable information.
o - an Observablearg - additional arguments from the Observable| Method Detail |
protected java.lang.Object getArg()
Observable additional
arguments.
Observable additional
arguments.protected Observable getObservable()
Observable.
Observable.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||