de.jreality.scene
Class SceneGraphPathObserver

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

public class SceneGraphPathObserver
extends Object
implements TransformationListener, SceneGraphComponentListener

This class observes the given path for changes of the resulting path matrix. 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

Author:
weissman

Constructor Summary
SceneGraphPathObserver()
           
SceneGraphPathObserver(SceneGraphPath path)
           
 
Method Summary
 void addTransformationListener(TransformationListener listener)
           
 void childAdded(SceneGraphComponentEvent ev)
           
 void childRemoved(SceneGraphComponentEvent ev)
           
 void childReplaced(SceneGraphComponentEvent ev)
           
 void dispose()
           
 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)

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