|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.pipeline.graphics.GraphicsListenerMulticaster
public class GraphicsListenerMulticaster
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 {
GraphicsResizeListener nodeListener = null;
public void addNodeListener(GraphicsResizeListener l) {
nodeListener = NodeListenerMulticaster.add(nodeListener, l);
}
public void removeNodeListener(GraphicsResizeListener l) {
nodeListener = NodeListenerMulticaster.remove(nodeListener, l);
}
public void fireFieldChanged(int index) {
if(nodeListener != null) {
nodeListener.fieldChanged(index);
}
}
Constructor Summary | |
---|---|
GraphicsListenerMulticaster(GraphicsResizeListener a,
GraphicsResizeListener b)
Creates an event multicaster instance which chains listener-a with listener-b. |
Method Summary | |
---|---|
static GraphicsResizeListener |
add(GraphicsResizeListener a,
GraphicsResizeListener b)
Adds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener. |
void |
graphicsDeviceResized(int x,
int y,
int width,
int height)
Notification that the graphics output device has changed dimensions to the given size. |
GraphicsResizeListener |
remove(GraphicsResizeListener oldl)
Removes a listener from this multicaster and returns the resulting multicast listener. |
static GraphicsResizeListener |
remove(GraphicsResizeListener l,
GraphicsResizeListener 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GraphicsListenerMulticaster(GraphicsResizeListener a, GraphicsResizeListener 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 GraphicsResizeListener remove(GraphicsResizeListener oldl)
oldl
- the listener to be removedpublic static void setErrorReporter(org.j3d.util.ErrorReporter reporter)
reporter
- The instance to use or nullpublic static GraphicsResizeListener add(GraphicsResizeListener a, GraphicsResizeListener b)
a
- input-method-listener-ab
- input-method-listener-bpublic static GraphicsResizeListener remove(GraphicsResizeListener l, GraphicsResizeListener oldl)
l
- component-listener-loldl
- the component-listener being removedpublic void graphicsDeviceResized(int x, int y, int width, int height)
graphicsDeviceResized
in interface GraphicsResizeListener
x
- The lower left x coordinate for the viewy
- The lower left y coordinate for the viewwidth
- The width of the viewport in pixelsheight
- The height of the viewport in pixels
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |