kinetic
Class Sequence

java.lang.Object
  |
  +--kinetic.KineticObject
        |
        +--kinetic.Sequence
All Implemented Interfaces:
java.io.Serializable

public class Sequence
extends KineticObject

core organizational object itneh engine. Sequence are used to build the animation hierachies that allow you to break down a complex piece. Each Sequence contains a "cast" list which are of KineticObjects. This means this list can contain KineticStrings or other Sequences. Each Seqeunces perform geometric transofmarions and well as temporal transfomrations before updating or drawing it's children. Sequences propagate time updates and draw requests. Sequences are alos used to temporal culling. This is important for long a complex pieces. Once a KineticObject is completed with and no longer visible, unless it is wrapped in a sequence that has terminated it will continue ot be hit on redraw requests. All objects within a sequence are drawn until the sequence has ended. Subsequences should be used minimize touching words that are no longer visible. Wrapping every word in it's own sequence can be beneficial in many cases but is not necessary.

See Also:
Serialized Form

Field Summary
 java.util.ArrayList cast
          cast list
 
Fields inherited from class kinetic.KineticObject
alpha, blue, BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT, delay, duration, green, lastUpdateTime, MIDDLE_CENTER, MIDDLE_LEFT, MIDDLE_RIGHT, mode, name, orientation, parent, properties, red, rotation, selected, timeFilters, TOP_CENTER, TOP_LEFT, TOP_RIGHT, visible, x, xScale, xShear, y, yScale, yShear
 
Constructor Summary
Sequence()
          create a new instance of a sequence
Sequence(java.lang.String n, double delayVal, double dur)
          create a new instance of sequence with parameters
 
Method Summary
 void addCastMember(kinetic.KineticObject obj)
          add a new cast member to the cast list
 void clear()
          empty the cast list and time fitlers
 boolean contains(java.awt.Point p)
          hit test - currently always return true since seuqence have no visual bounds
 void draw(java.awt.Graphics2D g2)
          drawing routine with out and affine transform - a new transofrm is created and the main drawing routine is called
 void draw(java.awt.Graphics2D g2, java.awt.geom.AffineTransform ax)
          main drawing routine
 void expandDurationToFitChildren()
          utility function to expand the duration of the sequence to fit the duration of all of it's children (the result of getMaxDuration) automatically.
 kinetic.KineticObject getCastMember(int i)
          access a particular cast member
 int getCastSize()
          get cast list size
 double getMaxDuration()
          gets maximum or unprecessed value of duration.
 void reset()
          reset internal variables and cast members
 void setMode(int newMode)
          set mode
 void update(double time)
          updates cast members
 
Methods inherited from class kinetic.KineticObject
addProperty, addTimeFilter, getDelay, getDuration, getName, getPropertyList, getTimeFilterList, handleMouseEvent, initialize, onUpdate, PrepareVariables, setColor, setColor, setColor, setDelay, setDuration, setName, setOrientation, setPosition, setRotation, setScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cast

public java.util.ArrayList cast
cast list

Constructor Detail

Sequence

public Sequence()
create a new instance of a sequence


Sequence

public Sequence(java.lang.String n,
                double delayVal,
                double dur)
create a new instance of sequence with parameters

Parameters:
n - Sequence name
delayVal - time until this sequence starts - ms
dur - duration of this sequence
Method Detail

draw

public void draw(java.awt.Graphics2D g2)
drawing routine with out and affine transform - a new transofrm is created and the main drawing routine is called

Overrides:
draw in class KineticObject
Parameters:
g2 - graphics handle

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.AffineTransform ax)
main drawing routine

Specified by:
draw in class KineticObject
Parameters:
g2 - graphics handle
ax - current affine transform

addCastMember

public void addCastMember(kinetic.KineticObject obj)
add a new cast member to the cast list

Parameters:
obj - instance of a KineticObject

clear

public void clear()
empty the cast list and time fitlers

Overrides:
clear in class KineticObject

update

public void update(double time)
updates cast members

Overrides:
update in class KineticObject
Parameters:
time - input time

getCastSize

public int getCastSize()
get cast list size

Returns:
cast size

getCastMember

public kinetic.KineticObject getCastMember(int i)
access a particular cast member

Parameters:
i - cast index
Returns:
cast member

contains

public boolean contains(java.awt.Point p)
hit test - currently always return true since seuqence have no visual bounds

Specified by:
contains in class KineticObject
Parameters:
p - hit point
Returns:
returns true if it contains the point

reset

public void reset()
reset internal variables and cast members

Overrides:
reset in class KineticObject

setMode

public void setMode(int newMode)
set mode

Overrides:
setMode in class KineticObject
Parameters:
newMode - new mode

expandDurationToFitChildren

public void expandDurationToFitChildren()
utility function to expand the duration of the sequence to fit the duration of all of it's children (the result of getMaxDuration) automatically. NOTE: there is a possibility that the sequence duration will be set to POSITIVE_INFINITY if one of the children has this value. This may cause problems when trying to play the animation using the supplied animation thread in KTEngine.


getMaxDuration

public double getMaxDuration()
gets maximum or unprecessed value of duration. NOTE: This function may return POSITIVE_INFINITY if any node in the sub tree has this value.

Overrides:
getMaxDuration in class KineticObject
Returns:
maximum duration of this object or any object in the subtree