anl.aida.viz3d
Class StackRenderer2

java.lang.Object
  extended by anl.aida.viz3d.VSpatial
      extended by anl.aida.viz3d.StackRenderer2

public class StackRenderer2
extends VSpatial

Renders items in a stack.


Field Summary
private  boolean atBottom
           
private  boolean atTop
           
private  Axis axis
           
private  javax.media.opengl.GLAutoDrawable drawable
           
private  boolean initialized
           
private  StackItemTextFormatter itemFormatter
           
private  java.util.List<StackItem2> items
           
private  StackSorter sorter
           
private  int stackIndex
           
private static float X_INTERVAL
           
private static float Z_INTERVAL
           
 
Fields inherited from class anl.aida.viz3d.VSpatial
appearence, boundingSphere, clientMap, dirty, id, localRotation, localScale, localTrans, parent, visible, worldRotation, worldScale, worldTrans
 
Constructor Summary
StackRenderer2(javax.media.opengl.GLAutoDrawable drawable)
           
StackRenderer2(javax.media.opengl.GLAutoDrawable drawable, StackItemTextFormatter itemFormatter)
           
 
Method Summary
 void addStackItem(StackItem2 item)
          Adds a StackItem to this StackRenderer.
protected  void doDraw(javax.media.opengl.GL gl)
          Does the actual drawing.
protected  BoundingSphere doGetBoundingSphere()
          Gets the actual bounding sphere.
 javax.media.opengl.GLAutoDrawable getDrawable()
          Gets the drawable used by this StackRenderer.
 void intersects(javax.vecmath.Point3f rayOrigin, javax.vecmath.Vector3f rayDirection, Accumulator accumulator)
          Performs an intersection these on this VSpatial with the specified ray.
 void jumpTo(int index, boolean updateDisplay)
          Jumps the top of the stack to the specified index.
 void jumpTo(StackItem2 item, boolean updateDisplay)
          Jumps the top of the stack to the StackItem
protected  void markAsDirty()
           
 void moveOff()
          Moves the current stack item incrementaly off the stack.
 void moveOn()
          Moves the current stack item incrementaly on to the stack.
 void next()
          Pops the current stack item completely off the stack and make the current stack item the next one.
 void prev()
          If the current stack item is current moving onto / off the stack, then this pushes it completely onto the stack.
private  void resetItems()
           
 void updateWorldTransformation()
           
 
Methods inherited from class anl.aida.viz3d.VSpatial
draw, getBoundingSphere, getLocalBoundingSphere, getMaterialAppearence, getParent, getProperty, getTranslation, getWorldToLocalTransform, isVisible, percolateDirtyUp, putProperty, rotate, rotate, scale, setMaterialAppearence, setParent, setVisible, transform, translate, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Z_INTERVAL

private static float Z_INTERVAL

X_INTERVAL

private static float X_INTERVAL

items

private java.util.List<StackItem2> items

stackIndex

private int stackIndex

atTop

private boolean atTop

atBottom

private boolean atBottom

drawable

private javax.media.opengl.GLAutoDrawable drawable

initialized

private boolean initialized

itemFormatter

private StackItemTextFormatter itemFormatter

sorter

private StackSorter sorter

axis

private Axis axis
Constructor Detail

StackRenderer2

public StackRenderer2(javax.media.opengl.GLAutoDrawable drawable)

StackRenderer2

public StackRenderer2(javax.media.opengl.GLAutoDrawable drawable,
                      StackItemTextFormatter itemFormatter)
Method Detail

getDrawable

public javax.media.opengl.GLAutoDrawable getDrawable()
Gets the drawable used by this StackRenderer.

Returns:
the drawable used by this StackRenderer.

addStackItem

public void addStackItem(StackItem2 item)
Adds a StackItem to this StackRenderer.

Parameters:
item - the item to add

resetItems

private void resetItems()

markAsDirty

protected void markAsDirty()
Overrides:
markAsDirty in class VSpatial

updateWorldTransformation

public void updateWorldTransformation()
Overrides:
updateWorldTransformation in class VSpatial

next

public void next()
Pops the current stack item completely off the stack and make the current stack item the next one.


prev

public void prev()
If the current stack item is current moving onto / off the stack, then this pushes it completely onto the stack. If it is not moving, then the previous item is pushed onto the stack.


moveOff

public void moveOff()
Moves the current stack item incrementaly off the stack. If the movement takes the item completely off the stack then this increments the stack index.


moveOn

public void moveOn()
Moves the current stack item incrementaly on to the stack. If the movement takes the item completely on to the stack then this decrements the stack index.


jumpTo

public void jumpTo(StackItem2 item,
                   boolean updateDisplay)
Jumps the top of the stack to the StackItem

Parameters:
item - the item to jump to
updateDisplay - whether or not to update the display as the stack pops / pushes to the specified index

jumpTo

public void jumpTo(int index,
                   boolean updateDisplay)
Jumps the top of the stack to the specified index.

Parameters:
index - the index to jump to.
updateDisplay - whether or not to update the display as the stack pops / pushes to the specified index

doDraw

protected void doDraw(javax.media.opengl.GL gl)
Description copied from class: VSpatial
Does the actual drawing.

Specified by:
doDraw in class VSpatial

doGetBoundingSphere

protected BoundingSphere doGetBoundingSphere()
Description copied from class: VSpatial
Gets the actual bounding sphere. This is called by getBoundingSphere once the worldTransforms have been updated.

Overrides:
doGetBoundingSphere in class VSpatial
Returns:
this VSpatial's BoundingSphere.

intersects

public void intersects(javax.vecmath.Point3f rayOrigin,
                       javax.vecmath.Vector3f rayDirection,
                       Accumulator accumulator)
Description copied from class: VSpatial
Performs an intersection these on this VSpatial with the specified ray. If the intersection passes, this VSpatial should be added to the Accumulator.

Specified by:
intersects in class VSpatial
Parameters:
rayOrigin - the ray's origin
rayDirection - the ray's direction
accumulator - the accumulator to add the VSpatial to