anl.aida.viz3d
Class StackItem

java.lang.Object
  extended by anl.aida.viz3d.StackItem
All Implemented Interfaces:
java.lang.Comparable<StackItem>

public class StackItem
extends java.lang.Object
implements java.lang.Comparable<StackItem>

An item in a StackDisplay.


Field Summary
private  StackDrawable drawable
           
private static float MAX_ROT
           
private static float MAX_X
           
private static float MAX_Z
           
private  float rotation
           
private  float x
           
private  float z
           
 
Constructor Summary
StackItem(StackDrawable drawable)
          Creates a stack item that will draw the specified drawable.
 
Method Summary
 int compareTo(StackItem o)
           
 void dispose()
          Dispose of any resources this StackItem may be holding.
 void draw(javax.media.opengl.GL gl, float xOff, float zOff)
          Draws this StackItem.
 long getSortingIndex()
          Gets an index for this StackItem that can be used to sort this item with respect to other items.
 void init()
          Initializes this StackItem.
 boolean isMoving()
          Gets whether or not this slice is currently moving.
 boolean moveOff()
          Moves this StackItem off the stack.
 boolean moveOn()
          Moves this StackItem onto the stack.
 void putOffStack()
          Puts this StackItem completely off the stack.
 void putOnStack()
          Puts this StackItem completely on the stack.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_X

private static float MAX_X

MAX_Z

private static float MAX_Z

MAX_ROT

private static float MAX_ROT

rotation

private float rotation

x

private float x

z

private float z

drawable

private StackDrawable drawable
Constructor Detail

StackItem

public StackItem(StackDrawable drawable)
Creates a stack item that will draw the specified drawable.

Parameters:
drawable - the drawable to draw
Method Detail

init

public void init()
Initializes this StackItem. This may be called multiple times during the life of this stack item in response to OpenGL context changes.


dispose

public void dispose()
Dispose of any resources this StackItem may be holding.


getSortingIndex

public long getSortingIndex()
Gets an index for this StackItem that can be used to sort this item with respect to other items.

Returns:
an sorting index for this StackItem

putOffStack

public void putOffStack()
Puts this StackItem completely off the stack.


putOnStack

public void putOnStack()
Puts this StackItem completely on the stack.


isMoving

public boolean isMoving()
Gets whether or not this slice is currently moving. A moving StackItem is neither fully on or off the stack.

Returns:
whether or not this slice is currently moving.

moveOff

public boolean moveOff()
Moves this StackItem off the stack.

Returns:
true if this item is completely off the stack and will move no further, otherwise false.

moveOn

public boolean moveOn()
Moves this StackItem onto the stack.

Returns:
true if this item is completely on the stack and will move no further, otherwise false.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

draw

public void draw(javax.media.opengl.GL gl,
                 float xOff,
                 float zOff)
Draws this StackItem.

Parameters:
gl -
zOff - the z offset for this StackItem
xOff - the x offset for this StackItem

compareTo

public int compareTo(StackItem o)
Specified by:
compareTo in interface java.lang.Comparable<StackItem>