com.croftsoft.apps.tag3d
Class Tag3DStateManager

java.lang.Object
  extended by com.croftsoft.apps.tag3d.Tag3DStateManager
All Implemented Interfaces:
StateListener, StateMulticaster

public class Tag3DStateManager
extends Object
implements StateListener, StateMulticaster

Bidirectional routing of Transform3DState updates.

Version:
1999-02-07
Author:
David W. Croft

Field Summary
protected  String id
           
protected  Map stateMap
           
protected  StateMulticaster stateMulticaster
           
protected  Tag3DWorld tag3DWorld
           
 
Constructor Summary
Tag3DStateManager(StateMulticaster stateMulticaster, Tag3DWorld tag3DWorld, String id)
          Establishes the objects for bidirectional communication.
Tag3DStateManager(Tag3DWorld tag3DWorld, String id)
          this ( new QueuedStateMulticaster ( ), tag3DWorld, id );
 
Method Summary
 boolean addStateListener(StateListener stateListener)
           
 boolean removeStateListener(StateListener stateListener)
           
 void setupRemote(String remoteName)
          Sets up this Tag3DStateManager object to use a remote StateMulticaster and subscribes itself as a remote StateListener.
 void stateListen(State state)
          Handles Transform3DState update events from the StateMulticaster.
 void update(State state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stateMap

protected Map stateMap

stateMulticaster

protected StateMulticaster stateMulticaster

tag3DWorld

protected Tag3DWorld tag3DWorld

id

protected String id
Constructor Detail

Tag3DStateManager

public Tag3DStateManager(StateMulticaster stateMulticaster,
                         Tag3DWorld tag3DWorld,
                         String id)
Establishes the objects for bidirectional communication.

Parameters:
stateMulticaster - All of Tag3DStateManager StateMulticaster interface method calls are relayed to the StateMulticaster implementation provided by this argument.
tag3DWorld - Updated when the State events are received via the StateListener method.
id - The unique identifier for this particular client.

Tag3DStateManager

public Tag3DStateManager(Tag3DWorld tag3DWorld,
                         String id)
this ( new QueuedStateMulticaster ( ), tag3DWorld, id );

Method Detail

stateListen

public void stateListen(State state)
Handles Transform3DState update events from the StateMulticaster. Updates the appropriate transformGroup in the stateMap as keyed by the State key. If the key does not exist in the stateMap, updates the tag3DWorld with a newly created transformGroup and adds it to the stateMap.

Specified by:
stateListen in interface StateListener

update

public void update(State state)
Specified by:
update in interface StateMulticaster

addStateListener

public boolean addStateListener(StateListener stateListener)
Specified by:
addStateListener in interface StateMulticaster

removeStateListener

public boolean removeStateListener(StateListener stateListener)
Specified by:
removeStateListener in interface StateMulticaster

setupRemote

public void setupRemote(String remoteName)
Sets up this Tag3DStateManager object to use a remote StateMulticaster and subscribes itself as a remote StateListener.

If the remote StateMulticaster cannot be contacted, an attempt will be made to establish this Tag3DStateManager object as the remote StateMulticaster.

Parameters:
remoteName - The RMI URL of the remote StateMulticaster.

CroftSoft Javadoc

CroftSoft Apps Javadoc (2008-09-28 21:15:07)