com.croftsoft.core.animation.painter
Class ScalePainter

java.lang.Object
  extended by com.croftsoft.core.animation.painter.ScalePainter
All Implemented Interfaces:
ComponentPainter

public final class ScalePainter
extends Object
implements ComponentPainter

Scales the image to fit the entire Component. This class differs from StretchPainter in that it scales both width and height by the same factor to prevent distortion. You can override the default scaling by calling setScale().

Since:
2006-04-23
Version:
$Date: 2007/02/25 03:30:11 $
See Also:
StretchPainter
Author:
David Wallace Croft

Constructor Summary
ScalePainter()
           
ScalePainter(Image image)
           
 
Method Summary
 Image getImage()
           
 void paint(JComponent component, Graphics2D graphics)
           
 void setImage(Image image)
           
 void setScale(double scale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScalePainter

public ScalePainter(Image image)

ScalePainter

public ScalePainter()
Method Detail

getImage

public Image getImage()

setImage

public void setImage(Image image)

setScale

public void setScale(double scale)

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)