com.croftsoft.apps.mars.view
Class ModelAnimator

java.lang.Object
  extended by com.croftsoft.apps.mars.view.ModelAnimator
All Implemented Interfaces:
ComponentAnimator, ComponentPainter, ComponentUpdater
Direct Known Subclasses:
AmmoDumpAnimator, TankAnimator

public class ModelAnimator
extends Object
implements ComponentAnimator

The view for a Model.

Since:
2003-04-01
Version:
2003-04-17
Author:
David Wallace Croft

Field Summary
protected  Color color
           
protected  ModelAccessor modelAccessor
           
protected  Rectangle newRepaintRectangle
           
protected  Rectangle oldRepaintRectangle
           
protected  boolean previouslyActive
           
 
Constructor Summary
ModelAnimator(ModelAccessor modelAccessor)
           
ModelAnimator(ModelAccessor modelAccessor, Color color)
           
 
Method Summary
protected  void getRepaintRectangle(Rectangle repaintRectangle)
           
protected  boolean isUpdated()
           
 void paint(JComponent component, Graphics2D graphics)
           
 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
 

Field Detail

modelAccessor

protected final ModelAccessor modelAccessor

oldRepaintRectangle

protected final Rectangle oldRepaintRectangle

newRepaintRectangle

protected final Rectangle newRepaintRectangle

color

protected Color color

previouslyActive

protected boolean previouslyActive
Constructor Detail

ModelAnimator

public ModelAnimator(ModelAccessor modelAccessor,
                     Color color)

ModelAnimator

public ModelAnimator(ModelAccessor modelAccessor)
Method Detail

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

getRepaintRectangle

protected void getRepaintRectangle(Rectangle repaintRectangle)

isUpdated

protected boolean isUpdated()

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)