com.croftsoft.apps.sprite
Class SpriteAnimator

java.lang.Object
  extended by com.croftsoft.apps.sprite.SpriteAnimator
All Implemented Interfaces:
SpriteConstants, Clock, ComponentAnimator, ComponentPainter, ComponentUpdater

public final class SpriteAnimator
extends Object
implements Clock, ComponentAnimator, SpriteConstants

Directs the AnimatedComponent.

Since:
2002-02-15
Version:
$Date: 2008/04/19 21:31:00 $
Author:
David Wallace Croft

Field Summary
 
Fields inherited from interface com.croftsoft.apps.sprite.SpriteConstants
BACKGROUND_IMAGE_FILENAME, CLOUD_IMAGE_FILENAME, CURSOR_IMAGE_FILENAME, DEFAULT_FRAME_RATE, DEFAULT_SPRITE_VELOCITY, FRAME_ICON_FILENAME, FRAME_SIZE, FRAME_TITLE, IMPACT_IMAGE_FILENAME, INFO, LOOK_LEFT_IMAGE_FILENAME, LOOK_RIGHT_IMAGE_FILENAME, MOUSE_IMAGE_FILENAME, MOUSE_PRESSED_IMAGE_FILENAME, NORMAL_IMAGE_FILENAME, SHUTDOWN_CONFIRMATION_PROMPT, TITLE, VERSION
 
Constructor Summary
SpriteAnimator(BufferStrategy bufferStrategy)
           
 
Method Summary
 long currentTimeNanos()
           
 AnimatedComponent getAnimatedComponent()
           
 void initialize()
           
 void paint(JComponent component, Graphics2D graphics)
           
 void setLoopGovernor(boolean useFixedDelay, double frequency)
           
 void setOnlySpriteRegions(boolean onlySpriteRegions)
           
 void setOnlySpriteUpdates(boolean onlySpriteUpdates)
           
 void setPaintBackground(boolean paintBackground)
           
 void setPaintBricks(boolean paintBricks)
           
 void setPaintClouds(boolean paintClouds)
           
 void setPaintFogNight(boolean paintFogNight)
           
 void setPaintSprites(boolean paintSprites)
           
 void setSpriteVelocity(double spriteVelocity)
           
 void setUseDoubleBuffering(boolean useDoubleBuffering)
           
 void setUseSwingRepaintCollector(boolean useSwingRepaintCollector)
           
 void setUseSystemClock(boolean useSystemClock)
           
 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
 

Constructor Detail

SpriteAnimator

public SpriteAnimator(BufferStrategy bufferStrategy)
Method Detail

initialize

public void initialize()
                throws IOException
Throws:
IOException

getAnimatedComponent

public AnimatedComponent getAnimatedComponent()

setSpriteVelocity

public void setSpriteVelocity(double spriteVelocity)

setPaintBackground

public void setPaintBackground(boolean paintBackground)

setPaintBricks

public void setPaintBricks(boolean paintBricks)

setPaintSprites

public void setPaintSprites(boolean paintSprites)

setPaintClouds

public void setPaintClouds(boolean paintClouds)

setPaintFogNight

public void setPaintFogNight(boolean paintFogNight)

setOnlySpriteUpdates

public void setOnlySpriteUpdates(boolean onlySpriteUpdates)

setOnlySpriteRegions

public void setOnlySpriteRegions(boolean onlySpriteRegions)

setUseSystemClock

public void setUseSystemClock(boolean useSystemClock)

setLoopGovernor

public void setLoopGovernor(boolean useFixedDelay,
                            double frequency)

setUseSwingRepaintCollector

public void setUseSwingRepaintCollector(boolean useSwingRepaintCollector)

setUseDoubleBuffering

public void setUseDoubleBuffering(boolean useDoubleBuffering)

currentTimeNanos

public long currentTimeNanos()
Specified by:
currentTimeNanos in interface Clock

update

public void update(JComponent component)
Description copied from interface: com.croftsoft.core.animation.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 Apps Javadoc (2008-09-28 21:15:07)