kinetic
Class KineticRectangle

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

public class KineticRectangle
extends KineticObject

creates a rectangle that can be used in the engine and be drawn on the screen

See Also:
Serialized Form

Field Summary
 double absoluteX
          global coordinate x
 double absoluteY
          global coordinate y
protected  java.awt.geom.Rectangle2D original_bounds
          local coordinate space bounding box
protected  java.awt.geom.GeneralPath transformed_bounds
          global coordinate space bounding box
 kinetic.KineticProperty xSize
          horizontal dimension
 kinetic.KineticProperty ySize
          vertical dimension
 
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
KineticRectangle()
          creates a new instance of a KineticRectangle
KineticRectangle(java.lang.String n, double del, double dur)
          creates a new instance
 
Method Summary
 boolean contains(java.awt.Point p)
          hits test
 void draw(java.awt.Graphics2D g2)
          main draw routine
 void draw(java.awt.Graphics2D g2, java.awt.geom.AffineTransform ax)
          main draw routin when affinte transform is provided
 double getAbsoluteX()
          get global coordinate x
 double getAbsoluteY()
          get global coordinate y
 java.awt.geom.Rectangle2D getBounds()
          gets global coordinate boundin box
 double getHeight()
          get width of global coordinate BBox
 double getWidth()
          get width of global coordinate BBox
 void setSize(double width, double height)
          set size
 
Methods inherited from class kinetic.KineticObject
addProperty, addTimeFilter, clear, getDelay, getDuration, getMaxDuration, getName, getPropertyList, getTimeFilterList, handleMouseEvent, initialize, onUpdate, PrepareVariables, reset, setColor, setColor, setColor, setDelay, setDuration, setMode, setName, setOrientation, setPosition, setRotation, setScale, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

original_bounds

protected java.awt.geom.Rectangle2D original_bounds
local coordinate space bounding box


transformed_bounds

protected java.awt.geom.GeneralPath transformed_bounds
global coordinate space bounding box


absoluteX

public double absoluteX
global coordinate x


absoluteY

public double absoluteY
global coordinate y


xSize

public kinetic.KineticProperty xSize
horizontal dimension


ySize

public kinetic.KineticProperty ySize
vertical dimension

Constructor Detail

KineticRectangle

public KineticRectangle()
creates a new instance of a KineticRectangle


KineticRectangle

public KineticRectangle(java.lang.String n,
                        double del,
                        double dur)
creates a new instance

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

draw

public void draw(java.awt.Graphics2D g2)
main draw routine

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

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.AffineTransform ax)
main draw routin when affinte transform is provided

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

getBounds

public java.awt.geom.Rectangle2D getBounds()
gets global coordinate boundin box

Returns:
global coordinate bbox

setSize

public void setSize(double width,
                    double height)
set size

Parameters:
width - width
height - height

contains

public boolean contains(java.awt.Point p)
hits test

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

getWidth

public double getWidth()
get width of global coordinate BBox

Returns:
width

getHeight

public double getHeight()
get width of global coordinate BBox

Returns:
height

getAbsoluteX

public double getAbsoluteX()
get global coordinate x

Returns:
x position

getAbsoluteY

public double getAbsoluteY()
get global coordinate y

Returns:
y position