net.sourceforge.olduvai.accordiondrawer
Class SplitTransition

java.lang.Object
  extended by net.sourceforge.olduvai.accordiondrawer.SplitTransition

public class SplitTransition
extends java.lang.Object

A class that helps compute coordinates for smooth animated transitions. This is a simple container class that stores a beginning relative position, an ending relative position and uses a straightforward (linear) equation to transition between them in a specified number of steps. These objects are created and enqueued in the SplitAxis class. They are read out of the queue from the drawFrame method of AccordionDrawer.

Author:
Tamara Munzner, Serdar Tasiran, Li Zhang, Yunhong Zhou
See Also:
AccordionDrawer, SplitAxis

Field Summary
private  int curStep
          Current step of transition, between 0 and maxStep - 1.
private  double endRelative
          Ending relative position of this split line, between SplitLine.getOpBound() and SplitLine.getParent().
private  SplitLine index
          Pointer to split line that is moving.
private  int maxStep
          Maximum step number, the total number of linear steps this line is taking, indexed by curStep.
private  double startRelative
          Starting relative position of this split line, between SplitLine.getOpBound() and SplitLine.getParent().
 
Constructor Summary
SplitTransition(SplitLine index, double endRelative, int numSteps)
          Create a split transition.
 
Method Summary
 boolean done()
          Test to see if the transitions are done for index.
 void end()
          Finalization of transition, verification of correct relative location of a jump cut is made, or round-off errors.
 void incr()
          Update the curStep by one, used before move().
 void move()
          Do a single step of movement in the relative space of the splitline index.
 java.lang.String toString()
          Debugging output function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

index

private SplitLine index
Pointer to split line that is moving.


curStep

private int curStep
Current step of transition, between 0 and maxStep - 1.


maxStep

private int maxStep
Maximum step number, the total number of linear steps this line is taking, indexed by curStep.


startRelative

private double startRelative
Starting relative position of this split line, between SplitLine.getOpBound() and SplitLine.getParent().


endRelative

private double endRelative
Ending relative position of this split line, between SplitLine.getOpBound() and SplitLine.getParent().

Constructor Detail

SplitTransition

public SplitTransition(SplitLine index,
                       double endRelative,
                       int numSteps)
Create a split transition.

Parameters:
index - split line to move. Value of startRelative is stored here.
endRelative - Final relative position of the line. Sets endRelative.
numSteps - Number of steps in the linear transition.
Method Detail

move

public void move()
Do a single step of movement in the relative space of the splitline index. (curStep/maxStep) * (endRelative - startRelative) + startRelative


incr

public void incr()
Update the curStep by one, used before move().


done

public boolean done()
Test to see if the transitions are done for index.

Returns:
true if this line has no more transitions, and is now at its final position endRelative.

end

public void end()
Finalization of transition, verification of correct relative location of a jump cut is made, or round-off errors.


toString

public java.lang.String toString()
Debugging output function.

Overrides:
toString in class java.lang.Object
Returns:
String that represents this transition, at it's current position.