com.croftsoft.core.animation.sprite
Class AbstractSprite

java.lang.Object
  extended by com.croftsoft.core.animation.sprite.AbstractSprite
All Implemented Interfaces:
ComponentAnimator, ComponentPainter, ComponentUpdater, Sprite
Direct Known Subclasses:
IconSprite, TextSprite

public abstract class AbstractSprite
extends Object
implements Sprite

An abstract Sprite implementation.

Since:
2002-03-07
Version:
2003-07-12
Author:
David Wallace Croft

Field Summary
protected  ComponentPainter componentPainter
           
protected  ComponentUpdater componentUpdater
           
protected  double heading
           
protected  double velocity
           
protected  double x
           
protected  double y
           
protected  double z
           
 
Constructor Summary
AbstractSprite()
           
AbstractSprite(double x, double y, double z, double heading, double velocity, ComponentUpdater componentUpdater, ComponentPainter componentPainter)
           
 
Method Summary
 void getCollisionBounds(Rectangle collisionBounds)
           
 double getHeading()
           
 double getVelocity()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 void paint(JComponent component, Graphics2D graphics)
           
 void setComponentPainter(ComponentPainter componentPainter)
           
 void setComponentUpdater(ComponentUpdater componentUpdater)
           
 void setHeading(double heading)
           
 void setVelocity(double velocity)
           
 void setX(double x)
           
 void setY(double y)
           
 void setZ(double z)
           
 void update(JComponent component)
          Updates the state of a JComponent and calls repaint() as required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.croftsoft.core.animation.Sprite
getCollisionShape, getPaintBounds
 

Field Detail

x

protected double x

y

protected double y

z

protected double z

heading

protected double heading

velocity

protected double velocity

componentUpdater

protected ComponentUpdater componentUpdater

componentPainter

protected ComponentPainter componentPainter
Constructor Detail

AbstractSprite

public AbstractSprite(double x,
                      double y,
                      double z,
                      double heading,
                      double velocity,
                      ComponentUpdater componentUpdater,
                      ComponentPainter componentPainter)

AbstractSprite

public AbstractSprite()
Method Detail

getX

public double getX()
Specified by:
getX in interface Sprite

getY

public double getY()
Specified by:
getY in interface Sprite

getZ

public double getZ()
Specified by:
getZ in interface Sprite

getHeading

public double getHeading()
Specified by:
getHeading in interface Sprite

getVelocity

public double getVelocity()
Specified by:
getVelocity in interface Sprite

getCollisionBounds

public void getCollisionBounds(Rectangle collisionBounds)
Specified by:
getCollisionBounds in interface Sprite

setX

public void setX(double x)
Specified by:
setX in interface Sprite

setY

public void setY(double y)
Specified by:
setY in interface Sprite

setZ

public void setZ(double z)
Specified by:
setZ in interface Sprite

setHeading

public void setHeading(double heading)
Specified by:
setHeading in interface Sprite

setVelocity

public void setVelocity(double velocity)
Specified by:
setVelocity in interface Sprite

setComponentUpdater

public void setComponentUpdater(ComponentUpdater componentUpdater)

setComponentPainter

public void setComponentPainter(ComponentPainter componentPainter)

update

public void update(JComponent component)
Description copied from interface: ComponentUpdater
Updates the state of a JComponent and calls repaint() as required.

Specified by:
update in interface ComponentUpdater

paint

public void paint(JComponent component,
                  Graphics2D graphics)
Specified by:
paint in interface ComponentPainter

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)