|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.pipeline.graphics.SurfaceInfoListenerMulticaster
public class SurfaceInfoListenerMulticaster
A class which implements efficient and thread-safe multi-cast event dispatching for the events defined in this package.
This class will manage an immutable structure consisting of a chain of event listeners and will dispatch events to those listeners. Because the structure is immutable, it is safe to use this API to add/remove listeners during the process of an event dispatch operation.
An example of how this class could be used to implement a new component which fires resize events:
public myComponent extends Component {
SurfaceInfoListener nodeListener = null;
public void addNodeListener(SurfaceInfoListener l) {
nodeListener = NodeListenerMulticaster.add(nodeListener, l);
}
public void removeNodeListener(SurfaceInfoListener l) {
nodeListener = NodeListenerMulticaster.remove(nodeListener, l);
}
public void fireFieldChanged(int index) {
if(nodeListener != null) {
nodeListener.fieldChanged(index);
}
}
Constructor Summary | |
---|---|
SurfaceInfoListenerMulticaster(SurfaceInfoListener a,
SurfaceInfoListener b)
Creates an event multicaster instance which chains listener-a with listener-b. |
Method Summary | |
---|---|
static SurfaceInfoListener |
add(SurfaceInfoListener a,
SurfaceInfoListener b)
Adds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener. |
SurfaceInfoListener |
remove(SurfaceInfoListener oldl)
Removes a listener from this multicaster and returns the resulting multicast listener. |
static SurfaceInfoListener |
remove(SurfaceInfoListener l,
SurfaceInfoListener oldl)
Removes the old component-listener from component-listener-l and returns the resulting multicast listener. |
static void |
setErrorReporter(org.j3d.util.ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. |
void |
surfaceInfoChanged(OutputDevice surface,
SurfaceInfo info)
Notification that the graphics output device has changed GL context and this is the collection of new information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SurfaceInfoListenerMulticaster(SurfaceInfoListener a, SurfaceInfoListener b)
a
and b
should not be null
, though implementations may vary in
choosing whether or not to throw NullPointerException
in that case.
a
- listener-ab
- listener-bMethod Detail |
---|
public SurfaceInfoListener remove(SurfaceInfoListener oldl)
oldl
- the listener to be removedpublic static void setErrorReporter(org.j3d.util.ErrorReporter reporter)
reporter
- The instance to use or nullpublic static SurfaceInfoListener add(SurfaceInfoListener a, SurfaceInfoListener b)
a
- input-method-listener-ab
- input-method-listener-bpublic static SurfaceInfoListener remove(SurfaceInfoListener l, SurfaceInfoListener oldl)
l
- component-listener-loldl
- the component-listener being removedpublic void surfaceInfoChanged(OutputDevice surface, SurfaceInfo info)
surfaceInfoChanged
in interface SurfaceInfoListener
surface
- The output surface that caused the new infoinfo
- The collected set of information known
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |