NCSA Portfolio

ncsa.j3d.ui.events
Class EventManager

java.lang.Object
  |
  +--ncsa.j3d.ui.events.EventManager

public class EventManager
extends java.lang.Object
implements PortfolioEventReceiver

This object is designed to manage groups of objects that report events to the NCSA Portfolio framework. And further to load and configure devices written to the Java3d InputDevice spec. It is expected that these are entered in the portfolio.properties file.


Method Summary
 void addBehavior(javax.media.j3d.Behavior b)
          adds a behavior into the Group of events to be received and also adds this to the scene graph.
 void addEvent(PortfolioEvent event)
          adds an object into the event manager and checks to see what type it is.
 void addEventReceiver(PortfolioEventReceiver er)
          This method causes a event receiver to be added in the list of objects that will receive events.
 void addEventSource(java.lang.Object object)
          This function simply retains a reference to the object that will sending events to us.
static EventManager instance()
          This class uses the Singleton design pattern.
 void loadInputDevices()
          This method forces the portfolio.properties file to be parsed and all of the Java3d InputDevices to be configured and loaded.
 void loadInputSources()
          This method forces the portfolio.properties file to be parsed and all of the Portfolio device drivers to be loaded and configured.
 boolean notify(java.util.EventObject event)
          This is the method that events that the event manager is holding can report events.
 void removeBehavior(javax.media.j3d.Behavior b)
          Removes a behavior from the scene graph.
 void setBranchGroup(javax.media.j3d.BranchGroup bg)
          Allows for the one time specification of the BranchGroup we will add our behaviors in.
 void setHeadIndex()
          Causes the HeadIndex in the PhysicalEnvironment to be set to the HeadIndex entry in the portfolio.properties file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static EventManager instance()
This class uses the Singleton design pattern. So think of this as an access to the only instance of the EventManager.

loadInputSources

public void loadInputSources()
This method forces the portfolio.properties file to be parsed and all of the Portfolio device drivers to be loaded and configured. These drivers will report events through the PortfolioEventReceiver interface.

loadInputDevices

public void loadInputDevices()
This method forces the portfolio.properties file to be parsed and all of the Java3d InputDevices to be configured and loaded. These drivers will report events through the path defined by the Java3d InputDevice spec.

setHeadIndex

public void setHeadIndex()
Causes the HeadIndex in the PhysicalEnvironment to be set to the HeadIndex entry in the portfolio.properties file.

addEventReceiver

public void addEventReceiver(PortfolioEventReceiver er)
This method causes a event receiver to be added in the list of objects that will receive events.
Parameters:
er - The PortfolioEventReceiver to be added.

setBranchGroup

public void setBranchGroup(javax.media.j3d.BranchGroup bg)
Allows for the one time specification of the BranchGroup we will add our behaviors in.
Parameters:
bg - The BranchGroup to add our behaviors to.

notify

public boolean notify(java.util.EventObject event)
This is the method that events that the event manager is holding can report events. Please note that they are NOT required to report events here; They could be reporting events elsewhere(directly) to save a little bit of processing power. Any events that are sent here are by default reported to the receiver.
Specified by:
notify in interface PortfolioEventReceiver
Parameters:
e - The Event to report.

addEvent

public void addEvent(PortfolioEvent event)
adds an object into the event manager and checks to see what type it is.
Parameters:
event - The event to add

addBehavior

public void addBehavior(javax.media.j3d.Behavior b)
adds a behavior into the Group of events to be received and also adds this to the scene graph.
Parameters:
Behavior - The behavior to be added.

addEventSource

public void addEventSource(java.lang.Object object)
This function simply retains a reference to the object that will sending events to us. This is to be used when the event sender is NOT a Behavior.
Parameters:
object - The object to track.

removeBehavior

public void removeBehavior(javax.media.j3d.Behavior b)
Removes a behavior from the scene graph.
Parameters:
b - The behavior to be removed.

NCSA Portfolio

NCSA Portfolio, Copyright 1997-1999, National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, All Rights Reserved