de.jreality.scene
Class SceneGraphPathObserver

java.lang.Object
  extended by de.jreality.scene.SceneGraphPathObserver
All Implemented Interfaces:
AppearanceListener, SceneGraphComponentListener, TransformationListener, java.util.EventListener

public class SceneGraphPathObserver
extends java.lang.Object
implements AppearanceListener, TransformationListener, SceneGraphComponentListener

This class observes the given path for changes of the resulting path matrix/effective appearance. Note: this class makes a private copy of the path and therefore doesn't care about changes of the path itself! If the observed path changes, call setPath(myPath) to observe the changed path. TODO: add listeners to changes other than transformation or appearance

Author:
weissman

Constructor Summary
SceneGraphPathObserver()
           
SceneGraphPathObserver(SceneGraphPath path)
           
 
Method Summary
 void addAppearanceListener(AppearanceListener listener)
           
 void addTransformationListener(TransformationListener listener)
           
 void appearanceChanged(AppearanceEvent ev)
           
 void childAdded(SceneGraphComponentEvent ev)
           
 void childRemoved(SceneGraphComponentEvent ev)
           
 void childReplaced(SceneGraphComponentEvent ev)
           
 void dispose()
           
 void removeAppearanceListener(AppearanceListener listener)
           
 void removeTransformationListener(TransformationListener listener)
           
 void setPath(SceneGraphPath newPath)
          TODO: remove only the listeners from nodes that are not part of the new path! calling this method results in changing the observed path.
 void transformationMatrixChanged(TransformationEvent ev)
           
 void visibilityChanged(SceneGraphComponentEvent ev)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneGraphPathObserver

public SceneGraphPathObserver()

SceneGraphPathObserver

public SceneGraphPathObserver(SceneGraphPath path)
Method Detail

setPath

public void setPath(SceneGraphPath newPath)
TODO: remove only the listeners from nodes that are not part of the new path! calling this method results in changing the observed path. TransformationChangedEvents will be generated only if the new given path changes.

Parameters:
newPath -

dispose

public void dispose()

addTransformationListener

public void addTransformationListener(TransformationListener listener)

removeTransformationListener

public void removeTransformationListener(TransformationListener listener)

addAppearanceListener

public void addAppearanceListener(AppearanceListener listener)

removeAppearanceListener

public void removeAppearanceListener(AppearanceListener listener)

appearanceChanged

public void appearanceChanged(AppearanceEvent ev)
Specified by:
appearanceChanged in interface AppearanceListener

transformationMatrixChanged

public void transformationMatrixChanged(TransformationEvent ev)
Specified by:
transformationMatrixChanged in interface TransformationListener

childAdded

public void childAdded(SceneGraphComponentEvent ev)
Specified by:
childAdded in interface SceneGraphComponentListener

childRemoved

public void childRemoved(SceneGraphComponentEvent ev)
Specified by:
childRemoved in interface SceneGraphComponentListener

childReplaced

public void childReplaced(SceneGraphComponentEvent ev)
Specified by:
childReplaced in interface SceneGraphComponentListener

visibilityChanged

public void visibilityChanged(SceneGraphComponentEvent ev)
Specified by:
visibilityChanged in interface SceneGraphComponentListener