Aviatrix3D
2.1.0

org.j3d.aviatrix3d.pipeline.graphics
Class SurfaceInfoListenerMulticaster

java.lang.Object
  extended by org.j3d.aviatrix3d.pipeline.graphics.SurfaceInfoListenerMulticaster
All Implemented Interfaces:
SurfaceInfoListener

public class SurfaceInfoListenerMulticaster
extends java.lang.Object
implements SurfaceInfoListener

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);
   }
 }
 

Version:
$Revision: 3.1 $
Author:
Justin Couch

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

SurfaceInfoListenerMulticaster

public SurfaceInfoListenerMulticaster(SurfaceInfoListener a,
                                      SurfaceInfoListener b)
Creates an event multicaster instance which chains listener-a with listener-b. Input parameters a and b should not be null, though implementations may vary in choosing whether or not to throw NullPointerException in that case.

Parameters:
a - listener-a
b - listener-b
Method Detail

remove

public SurfaceInfoListener remove(SurfaceInfoListener oldl)
Removes a listener from this multicaster and returns the resulting multicast listener.

Parameters:
oldl - the listener to be removed

setErrorReporter

public 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. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

add

public static SurfaceInfoListener add(SurfaceInfoListener a,
                                      SurfaceInfoListener b)
Adds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener.

Parameters:
a - input-method-listener-a
b - input-method-listener-b

remove

public static SurfaceInfoListener remove(SurfaceInfoListener l,
                                         SurfaceInfoListener oldl)
Removes the old component-listener from component-listener-l and returns the resulting multicast listener.

Parameters:
l - component-listener-l
oldl - the component-listener being removed

surfaceInfoChanged

public void surfaceInfoChanged(OutputDevice surface,
                               SurfaceInfo info)
Notification that the graphics output device has changed GL context and this is the collection of new information.

Specified by:
surfaceInfoChanged in interface SurfaceInfoListener
Parameters:
surface - The output surface that caused the new info
info - The collected set of information known

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org