games.strategy.triplea.image
Class UnitImageFactory

java.lang.Object
  extended by games.strategy.triplea.image.UnitImageFactory

public class UnitImageFactory
extends java.lang.Object

Version:
1.0
Author:
Sean Bridges

Field Summary
static int UNIT_ICON_HEIGHT
          Height of all icons.
static int UNIT_ICON_WIDTH
          Width of all icons.
 
Constructor Summary
UnitImageFactory()
          Creates new IconImageFactory
 
Method Summary
 java.lang.String getBaseImageName(UnitType type, PlayerID id, GameData data, boolean damaged)
           
 java.awt.Image getHighlightImage(UnitType type, PlayerID player, GameData data, boolean damaged)
           
 javax.swing.ImageIcon getIcon(UnitType type, PlayerID player, GameData data, boolean damaged)
          Return a icon image for a unit.
 java.awt.Image getImage(UnitType type, PlayerID player, GameData data, boolean damaged)
          Return the appropriate unit image.
 double getScaleFactor()
          Return the unit scaling factor
 int getUnitImageHeight()
          Return the height of scaled units
 int getUnitImageWidth()
          Return the width of scaled units
 void setResourceLoader(ResourceLoader loader, double scaleFactor)
           
 void setScaleFactor(double scaleFactor)
          Set the unitScaling factor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIT_ICON_WIDTH

public static final int UNIT_ICON_WIDTH
Width of all icons. You probably want getUnitImageWidth(), which takes scale factor into account.

See Also:
Constant Field Values

UNIT_ICON_HEIGHT

public static final int UNIT_ICON_HEIGHT
Height of all icons. You probably want getUnitImageHeight(), which takes scale factor into account.

See Also:
Constant Field Values
Constructor Detail

UnitImageFactory

public UnitImageFactory()
Creates new IconImageFactory

Method Detail

setResourceLoader

public void setResourceLoader(ResourceLoader loader,
                              double scaleFactor)

setScaleFactor

public void setScaleFactor(double scaleFactor)
Set the unitScaling factor


getScaleFactor

public double getScaleFactor()
Return the unit scaling factor


getUnitImageWidth

public int getUnitImageWidth()
Return the width of scaled units


getUnitImageHeight

public int getUnitImageHeight()
Return the height of scaled units


getImage

public java.awt.Image getImage(UnitType type,
                               PlayerID player,
                               GameData data,
                               boolean damaged)
Return the appropriate unit image.


getHighlightImage

public java.awt.Image getHighlightImage(UnitType type,
                                        PlayerID player,
                                        GameData data,
                                        boolean damaged)

getIcon

public javax.swing.ImageIcon getIcon(UnitType type,
                                     PlayerID player,
                                     GameData data,
                                     boolean damaged)
Return a icon image for a unit.


getBaseImageName

public java.lang.String getBaseImageName(UnitType type,
                                         PlayerID id,
                                         GameData data,
                                         boolean damaged)