com.croftsoft.core.animation.animator
Class IconRowAnimator

java.lang.Object
  extended by com.croftsoft.core.animation.animator.IconRowAnimator
All Implemented Interfaces:
ComponentAnimator, ComponentPainter, ComponentUpdater

public final class IconRowAnimator
extends Object
implements ComponentAnimator

Displays a quantity as a row of icons.

Useful for display number of remaining lives, ammo, population, etc. If the area to display the icons is too small, the icon spacing will be adjusted so that icons overlap each other to fit.

Since:
2003-03-28
Version:
2003-03-28
Author:
David Wallace Croft

Constructor Summary
IconRowAnimator(Icon icon, int count, JComponent component)
          Draws the icon row at the bottom left of the component.
IconRowAnimator(Icon icon, int count, Rectangle rectangle)
          Draws the icon row in the rectangle.
 
Method Summary
 int getCount()
           
 Icon getIcon()
           
 void getRectangle(Rectangle rectangle)
           
 void paint(JComponent component, Graphics2D graphics)
           
 void setCount(int count)
           
 void setIcon(Icon icon)
           
 void setRectangle(Rectangle rectangle)
           
 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

IconRowAnimator

public IconRowAnimator(Icon icon,
                       int count,
                       Rectangle rectangle)
Draws the icon row in the rectangle.


IconRowAnimator

public IconRowAnimator(Icon icon,
                       int count,
                       JComponent component)
Draws the icon row at the bottom left of the component.

Method Detail

getCount

public int getCount()

getIcon

public Icon getIcon()

getRectangle

public void getRectangle(Rectangle rectangle)

setCount

public void setCount(int count)

setIcon

public void setIcon(Icon icon)

setRectangle

public void setRectangle(Rectangle rectangle)

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)