kinetic
Class KineticObject

java.lang.Object
  |
  +--kinetic.KineticObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
KineticRectangle, KineticString, Sequence

public abstract class KineticObject
extends java.lang.Object
implements java.io.Serializable

base class for all drawing objects in the engine

See Also:
Serialized Form

Field Summary
 kinetic.KineticProperty alpha
          alpha channel value
 kinetic.KineticProperty blue
          blue color channel value
static int BOTTOM_CENTER
          justification option
static int BOTTOM_LEFT
          justification option
static int BOTTOM_RIGHT
          justification option
 kinetic.Delay delay
          accessor pointer to the common delay all seqeunces have
 kinetic.KineticProperty duration
          sequence duration - this is used for temporal culling
 kinetic.KineticProperty green
          green color channel value
protected  double lastUpdateTime
          stores that last tim ethis object was updated
static int MIDDLE_CENTER
          justification option
static int MIDDLE_LEFT
          justification option
static int MIDDLE_RIGHT
          justification option
protected  int mode
          utility varliable for mode switching - currently unused
 java.lang.String name
          name of this object
protected  int orientation
          centerpoint justification
protected  kinetic.KineticObject parent
          stores the paraent object if it exists
protected  java.util.ArrayList properties
          list of properties for this object
 kinetic.KineticProperty red
          red color channel value
 kinetic.KineticProperty rotation
          rotation property
protected  boolean selected
          slection flag for editting
protected  java.util.ArrayList timeFilters
          list of time filters
static int TOP_CENTER
          justification option
static int TOP_LEFT
          justification option
static int TOP_RIGHT
          justification option
protected  boolean visible
          flag for visibility
 kinetic.KineticProperty x
          x position property
 kinetic.KineticProperty xScale
          horizontal scale
 kinetic.KineticProperty xShear
          horizontal shear
 kinetic.KineticProperty y
          y position property
 kinetic.KineticProperty yScale
          vertical scale
 kinetic.KineticProperty yShear
          vertical shear
 
Constructor Summary
KineticObject()
          creates a new instance of a kinetic object
KineticObject(java.lang.String n, double del, double dur)
          creates a new instance of a kinetic object
 
Method Summary
protected  void addProperty(kinetic.KineticProperty p)
          utility function for registering a new property onto this object
 void addTimeFilter(kinetic.TimeFilter tf)
          add a new time filter
 void clear()
          Called when all animation data is to be erased.
abstract  boolean contains(java.awt.Point p)
          used for hit testing purposes
 void draw(java.awt.Graphics2D g2)
          called when this object is requested to be drawn
abstract  void draw(java.awt.Graphics2D g2, java.awt.geom.AffineTransform ax)
          called when this object is requested to be drawn, provides a transformation matrix from parent
 double getDelay()
          get delay
 double getDuration()
          get duration
 double getMaxDuration()
          gets maximum or unprocessed value of duration
 java.lang.String getName()
          gets the name of this object
 java.util.ArrayList getPropertyList()
          gets the list of properties in this object
 java.util.ArrayList getTimeFilterList()
          gets the list of timefilters for this object
 void handleMouseEvent(java.awt.event.MouseEvent e, boolean button_event, double time, java.awt.Graphics2D g2)
          used to support interactive capabilites
 void initialize()
          initializes and registers internal variables
 void onUpdate(double time)
          called when the update is finished and provides a method of doing more processing
 double PrepareVariables(double time)
          prepare all properties with the filtered value of time
 void reset()
          called to reset internal variables used in this object
 void setColor(java.awt.Color c)
          set color, alpha = 1.0
 void setColor(double r, double g, double b)
          set color, alpha = 1.0
 void setColor(double r, double g, double b, double a)
          set color with alpha
 void setDelay(double delayVal)
          set delay
 void setDuration(double d)
          set duration
 void setMode(int newMode)
          set the current mode
 void setName(java.lang.String n)
          sets the name of this object
 void setOrientation(int orient)
          sets orientation
 void setPosition(double x_val, double y_val)
          set position
 void setRotation(double rot)
          set rotation
 void setScale(double x_val, double y_val)
          set scale
 void update(double time)
          updates this object with the new time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected kinetic.KineticObject parent
stores the paraent object if it exists


properties

protected java.util.ArrayList properties
list of properties for this object


timeFilters

protected java.util.ArrayList timeFilters
list of time filters


x

public kinetic.KineticProperty x
x position property


y

public kinetic.KineticProperty y
y position property


rotation

public kinetic.KineticProperty rotation
rotation property


xScale

public kinetic.KineticProperty xScale
horizontal scale


yScale

public kinetic.KineticProperty yScale
vertical scale


xShear

public kinetic.KineticProperty xShear
horizontal shear


yShear

public kinetic.KineticProperty yShear
vertical shear


red

public kinetic.KineticProperty red
red color channel value


green

public kinetic.KineticProperty green
green color channel value


blue

public kinetic.KineticProperty blue
blue color channel value


alpha

public kinetic.KineticProperty alpha
alpha channel value


duration

public kinetic.KineticProperty duration
sequence duration - this is used for temporal culling


delay

public kinetic.Delay delay
accessor pointer to the common delay all seqeunces have


visible

protected boolean visible
flag for visibility


selected

protected boolean selected
slection flag for editting


lastUpdateTime

protected double lastUpdateTime
stores that last tim ethis object was updated


orientation

protected int orientation
centerpoint justification


mode

protected int mode
utility varliable for mode switching - currently unused


BOTTOM_LEFT

public static final int BOTTOM_LEFT
justification option

See Also:
Constant Field Values

BOTTOM_CENTER

public static final int BOTTOM_CENTER
justification option

See Also:
Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT
justification option

See Also:
Constant Field Values

MIDDLE_LEFT

public static final int MIDDLE_LEFT
justification option

See Also:
Constant Field Values

MIDDLE_CENTER

public static final int MIDDLE_CENTER
justification option

See Also:
Constant Field Values

MIDDLE_RIGHT

public static final int MIDDLE_RIGHT
justification option

See Also:
Constant Field Values

TOP_LEFT

public static final int TOP_LEFT
justification option

See Also:
Constant Field Values

TOP_CENTER

public static final int TOP_CENTER
justification option

See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
justification option

See Also:
Constant Field Values

name

public java.lang.String name
name of this object

Constructor Detail

KineticObject

public KineticObject()
creates a new instance of a kinetic object


KineticObject

public KineticObject(java.lang.String n,
                     double del,
                     double dur)
creates a new instance of a kinetic object

Parameters:
n - name
del - delay - ms
dur - dur - ms
Method Detail

initialize

public void initialize()
initializes and registers internal variables


draw

public void draw(java.awt.Graphics2D g2)
called when this object is requested to be drawn

Parameters:
g2 - graphics handle

draw

public abstract void draw(java.awt.Graphics2D g2,
                          java.awt.geom.AffineTransform ax)
called when this object is requested to be drawn, provides a transformation matrix from parent

Parameters:
g2 - graphcis handle
ax - current affine transform

contains

public abstract boolean contains(java.awt.Point p)
used for hit testing purposes

Parameters:
p - location of the hit test point
Returns:
true if it contains the hits object

update

public void update(double time)
updates this object with the new time

Parameters:
time - value of update time - ms

PrepareVariables

public double PrepareVariables(double time)
prepare all properties with the filtered value of time

Parameters:
time - input time
Returns:
processed output time

onUpdate

public void onUpdate(double time)
called when the update is finished and provides a method of doing more processing

Parameters:
time - post-processed input time

clear

public void clear()
Called when all animation data is to be erased. Clears all time filters attached to this object and calls clear() on all properties. Should be overridden if more tasks are neccesary.


setOrientation

public void setOrientation(int orient)
sets orientation

Parameters:
orient - orientation option

setName

public void setName(java.lang.String n)
sets the name of this object

Parameters:
n - new name

getName

public java.lang.String getName()
gets the name of this object

Returns:
name of the object

getPropertyList

public java.util.ArrayList getPropertyList()
gets the list of properties in this object

Returns:
list of internal properties

getTimeFilterList

public java.util.ArrayList getTimeFilterList()
gets the list of timefilters for this object

Returns:
list of time filters

reset

public void reset()
called to reset internal variables used in this object


handleMouseEvent

public void handleMouseEvent(java.awt.event.MouseEvent e,
                             boolean button_event,
                             double time,
                             java.awt.Graphics2D g2)
used to support interactive capabilites

Parameters:
e - mouse event
button_event - true if event was produced by a button
time - timestamps of the event
g2 - graphics handle

setMode

public void setMode(int newMode)
set the current mode

Parameters:
newMode - new mode value

setDelay

public void setDelay(double delayVal)
set delay

Parameters:
delayVal - new delay time -ms

addTimeFilter

public void addTimeFilter(kinetic.TimeFilter tf)
add a new time filter

Parameters:
tf - instance of a time filter

setPosition

public void setPosition(double x_val,
                        double y_val)
set position

Parameters:
x_val - x position
y_val - y position

setScale

public void setScale(double x_val,
                     double y_val)
set scale

Parameters:
x_val - x scale
y_val - y scale

setRotation

public void setRotation(double rot)
set rotation

Parameters:
rot - new rotation

getDuration

public double getDuration()
get duration

Returns:
duration

setDuration

public void setDuration(double d)
set duration

Parameters:
d - new duration

getDelay

public double getDelay()
get delay

Returns:
delay - ms

setColor

public void setColor(double r,
                     double g,
                     double b,
                     double a)
set color with alpha

Parameters:
r - red channel
g - green channel
b - blue channel
a - alpha channel

setColor

public void setColor(double r,
                     double g,
                     double b)
set color, alpha = 1.0

Parameters:
r - red channel
g - green channel
b - blue channel

setColor

public void setColor(java.awt.Color c)
set color, alpha = 1.0

Parameters:
c - an instance of java.awt.Color

addProperty

protected void addProperty(kinetic.KineticProperty p)
utility function for registering a new property onto this object

Parameters:
p - the KineticProperty to be added

getMaxDuration

public double getMaxDuration()
gets maximum or unprocessed value of duration

Returns:
the maximum unprocessed duration