net.sf.freecol.client.gui
Class ImageLibrary

java.lang.Object
  extended by net.sf.freecol.client.gui.ImageLibrary

public final class ImageLibrary
extends java.lang.Object

Holds various images that can be called upon by others in order to display certain things.


Field Summary
private  java.util.EnumMap<Tension.Level,java.awt.Image> alarmChips
           
private  java.util.EnumMap<Tension.Level,java.awt.Image> alarmChipsUnvisited
           
static int BEACH_STYLES
           
private static java.lang.String beachDirectory
           
private  java.util.List<javax.swing.ImageIcon> beaches
           
private static java.lang.String beachName
           
private  java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> border1
           
private  java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> border2
           
private static java.lang.String borderName
           
private  java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> coast1
           
private  java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> coast2
           
private  java.util.Map<java.awt.Color,java.awt.Image> colorChips
           
static java.lang.String DARKNESS
           
private  java.lang.String dataDirectory
           
static java.lang.String DELETE
           
private static java.lang.String deltaName
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> deltas
           
private  java.util.Map<java.awt.Color,java.awt.Image> expertMissionChips
           
private static java.lang.String extension
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> forests
           
private static java.lang.String large
           
private static java.util.logging.Logger logger
           
static java.lang.String LOST_CITY_RUMOUR
           
private  java.util.Map<java.awt.Color,java.awt.Image> missionChips
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> overlay1
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> overlay2
           
private static java.lang.String path
           
static java.lang.String PLOWED
           
static int RIVER_STYLES
           
private static java.lang.String riverDirectory
           
private static java.lang.String riverName
           
private  java.util.List<javax.swing.ImageIcon> rivers
          A ArrayList of Image objects.
private  float scalingFactor
          The scaling factor used when creating this ImageLibrary.
private static java.lang.String small
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> terrain1
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> terrain2
           
private static java.lang.String terrainDirectory
           
static java.lang.String TILE_OWNED_BY_INDIANS
           
static java.lang.String TILE_TAKEN
           
private static java.lang.String tileName
           
private static java.lang.String unexploredDirectory
           
private static java.lang.String unexploredName
           
static java.lang.String UNIT_SELECT
           
 
Constructor Summary
  ImageLibrary()
          The constructor to use.
  ImageLibrary(java.lang.String freeColHome)
          A constructor that takes a directory as FreeCol's home.
private ImageLibrary(java.lang.String dataDirectory, float scalingFactor)
           
 
Method Summary
private  javax.swing.ImageIcon findImage(java.lang.String filePath, java.lang.Class<FreeCol> resourceLocator, boolean doLookup)
          Finds the image file in the given filePath.
 java.awt.Image getAlarmChip(Tension.Level alarm, boolean visited)
          Returns the alarm chip with the given color.
 java.awt.Image getBeachImage(int index)
          Returns the beach image at the given index.
 java.awt.Image getBonusImage(ResourceType type)
           
 java.awt.Image getBonusImage(Tile tile)
          Returns the bonus-image for the given tile.
 javax.swing.ImageIcon getBonusImageIcon(ResourceType type)
          Returns the bonus-ImageIcon at the given index.
 java.awt.Image getBorderImage(TileType type, Map.Direction direction, int x, int y)
          Returns the border terrain-image for the given type.
 java.awt.Image getCoastImage(TileType type, Map.Direction direction, int x, int y)
          Returns the coast terrain-image for the given type.
 java.awt.Image getCoatOfArmsImage(Nation nation)
          Returns the coat-of-arms image for the given Nation.
 javax.swing.ImageIcon getCoatOfArmsImageIcon(Nation nation)
          Returns the coat-of-arms image for the given Nation.
 java.awt.Image getColorChip(java.awt.Color color)
          Returns the color chip with the given color.
 int getCompoundTerrainImageHeight(TileType type)
          Returns the height of the terrain-image including overlays and forests for the given terrain type.
 java.awt.Image getForestImage(TileType type)
          Returns the forest image for a terrain type.
 java.awt.Image getFoundingFatherImage(FoundingFather father)
          Returns the portrait of this Founding Father.
 java.awt.Image getGoodsImage(GoodsType goodsType)
          Returns the goods-image at the given index.
 javax.swing.ImageIcon getGoodsImageIcon(GoodsType goodsType)
          Returns the goods-image for a goods type.
 java.awt.Image getMiscImage(java.lang.String id)
          Returns the image with the given id.
 javax.swing.ImageIcon getMiscImageIcon(java.lang.String id)
          Returns the image with the given id.
 java.awt.Image getMissionChip(java.awt.Color color, boolean expertMission)
          Returns the mission chip with the given color.
 java.awt.Image getMonarchImage(Nation nation)
          Returns the monarch-image for the given tile.
 javax.swing.ImageIcon getMonarchImageIcon(Nation nation)
          Returns the monarch-image icon for the given Nation.
 java.awt.Image getOverlayImage(TileType type, int x, int y)
          Returns the overlay-image for the given type.
 java.awt.Image getRiverImage(int index)
          Returns the river image at the given index.
 java.awt.Image getRiverMouthImage(Map.Direction direction, int magnitude, int x, int y)
          Returns the river mouth terrain-image for the direction and magnitude.
 javax.swing.ImageIcon getScaledBonusImageIcon(ResourceType type, float scale)
           
 javax.swing.ImageIcon getScaledGoodsImageIcon(GoodsType type, float scale)
          Returns the scaled goods-ImageIcon for a goods type.
 javax.swing.ImageIcon getScaledImageIcon(java.awt.Image image, float scale)
          Returns the scaled ImageIcon.
 javax.swing.ImageIcon getScaledImageIcon(javax.swing.ImageIcon inputIcon, float scale)
          Returns the scaled ImageIcon.
 ImageLibrary getScaledImageLibrary(float scalingFactor)
          Gets a scaled version of this ImageLibrary.
 java.awt.Image getScaledTerrainImage(TileType type, float scale)
          Returns the scaled terrain-image for a terrain type (and position 0, 0).
 float getScalingFactor()
          Returns the scaling factor used when creating this ImageLibrary.
 java.awt.Image getSettlementImage(Settlement.SettlementType settlementType)
          Returns the graphics that will represent the given settlement.
 java.awt.Image getSettlementImage(Settlement settlement)
          Returns the graphics that will represent the given settlement.
 java.awt.Image getTerrainImage(TileType type, int x, int y)
          Returns the terrain-image for the given type.
 int getTerrainImageHeight(TileType type)
          Returns the height of the terrain-image for a terrain type.
 int getTerrainImageWidth(TileType type)
          Returns the width of the terrain-image for a terrain type.
 javax.swing.ImageIcon getUnitImageIcon(Unit unit)
          Returns the ImageIcon that will represent the given unit.
 javax.swing.ImageIcon getUnitImageIcon(Unit unit, boolean grayscale)
          Returns the ImageIcon that will represent the given unit.
 javax.swing.ImageIcon getUnitImageIcon(UnitType unitType)
          Returns the ImageIcon that will represent a unit of the given type.
 javax.swing.ImageIcon getUnitImageIcon(UnitType unitType, boolean grayscale)
          Returns the ImageIcon that will represent a unit of the given type.
 javax.swing.ImageIcon getUnitImageIcon(UnitType unitType, Unit.Role role)
          Returns the ImageIcon that will represent a unit of the given type and role.
 javax.swing.ImageIcon getUnitImageIcon(UnitType unitType, Unit.Role role, boolean grayscale)
          Returns the ImageIcon that will represent a unit of the given type and role.
 void init()
          Performs all necessary init operations such as loading of data files.
private  void loadAlarmChip(java.awt.GraphicsConfiguration gc, Tension.Level alarm, boolean visited)
          Generates a alarm chip image and stores it in memory.
private  void loadBeaches(java.awt.GraphicsConfiguration gc, java.lang.Class<FreeCol> resourceLocator, boolean doLookup)
          Loads the beach images from file into memory.
private  void loadColorChip(java.awt.GraphicsConfiguration gc, java.awt.Color c)
          Generates a color chip image and stores it in memory.
private  void loadForests(java.awt.GraphicsConfiguration gc, java.lang.Class<FreeCol> resourceLocator, boolean doLookup)
          Loads the forest images from file into memory.
private  void loadMissionChip(java.awt.GraphicsConfiguration gc, java.awt.Color c, boolean expertMission)
          Generates a mission chip image and stores it in memory.
private  void loadRiverMouths(java.awt.GraphicsConfiguration gc, java.lang.Class<FreeCol> resourceLocator, boolean doLookup)
          Loads the river mouth images from file into memory.
private  void loadRivers(java.awt.GraphicsConfiguration gc, java.lang.Class<FreeCol> resourceLocator, boolean doLookup)
          Loads the river images from file into memory.
private  void loadTerrain(java.awt.GraphicsConfiguration gc, java.lang.Class<FreeCol> resourceLocator, boolean doLookup)
          Loads the terrain-images from file into memory.
 javax.swing.ImageIcon scaleIcon(javax.swing.ImageIcon icon, float scale)
           
 java.awt.Image scaleImage(java.awt.Image image, float scale)
           
private  java.util.ArrayList<javax.swing.ImageIcon> scaleImages(java.util.List<javax.swing.ImageIcon> input, float scale)
           
private  java.util.Map<java.lang.String,javax.swing.ImageIcon> scaleImages(java.util.Map<java.lang.String,javax.swing.ImageIcon> input, float scale)
           
private  java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> scaleImages2(java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> input, float scale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger

RIVER_STYLES

public static final int RIVER_STYLES
See Also:
Constant Field Values

BEACH_STYLES

public static final int BEACH_STYLES
See Also:
Constant Field Values

UNIT_SELECT

public static final java.lang.String UNIT_SELECT
See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values

PLOWED

public static final java.lang.String PLOWED
See Also:
Constant Field Values

TILE_TAKEN

public static final java.lang.String TILE_TAKEN
See Also:
Constant Field Values

TILE_OWNED_BY_INDIANS

public static final java.lang.String TILE_OWNED_BY_INDIANS
See Also:
Constant Field Values

LOST_CITY_RUMOUR

public static final java.lang.String LOST_CITY_RUMOUR
See Also:
Constant Field Values

DARKNESS

public static final java.lang.String DARKNESS
See Also:
Constant Field Values

path

private static final java.lang.String path

extension

private static final java.lang.String extension

terrainDirectory

private static final java.lang.String terrainDirectory

beachDirectory

private static final java.lang.String beachDirectory

beachName

private static final java.lang.String beachName

tileName

private static final java.lang.String tileName

borderName

private static final java.lang.String borderName

unexploredDirectory

private static final java.lang.String unexploredDirectory

unexploredName

private static final java.lang.String unexploredName

riverDirectory

private static final java.lang.String riverDirectory

riverName

private static final java.lang.String riverName

dataDirectory

private final java.lang.String dataDirectory

deltaName

private static final java.lang.String deltaName
See Also:
Constant Field Values

small

private static final java.lang.String small
See Also:
Constant Field Values

large

private static final java.lang.String large
See Also:
Constant Field Values

rivers

private java.util.List<javax.swing.ImageIcon> rivers
A ArrayList of Image objects.


beaches

private java.util.List<javax.swing.ImageIcon> beaches

terrain1

private java.util.Map<java.lang.String,javax.swing.ImageIcon> terrain1

terrain2

private java.util.Map<java.lang.String,javax.swing.ImageIcon> terrain2

overlay1

private java.util.Map<java.lang.String,javax.swing.ImageIcon> overlay1

overlay2

private java.util.Map<java.lang.String,javax.swing.ImageIcon> overlay2

forests

private java.util.Map<java.lang.String,javax.swing.ImageIcon> forests

deltas

private java.util.Map<java.lang.String,javax.swing.ImageIcon> deltas

border1

private java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> border1

border2

private java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> border2

coast1

private java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> coast1

coast2

private java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> coast2

alarmChips

private java.util.EnumMap<Tension.Level,java.awt.Image> alarmChips

alarmChipsUnvisited

private java.util.EnumMap<Tension.Level,java.awt.Image> alarmChipsUnvisited

colorChips

private java.util.Map<java.awt.Color,java.awt.Image> colorChips

missionChips

private java.util.Map<java.awt.Color,java.awt.Image> missionChips

expertMissionChips

private java.util.Map<java.awt.Color,java.awt.Image> expertMissionChips

scalingFactor

private final float scalingFactor
The scaling factor used when creating this ImageLibrary. The value 1 is used if this object is not a result of a scaling operation.

Constructor Detail

ImageLibrary

public ImageLibrary()
             throws FreeColException
The constructor to use.

Throws:
FreeColException - If one of the data files could not be found.

ImageLibrary

public ImageLibrary(java.lang.String freeColHome)
             throws FreeColException
A constructor that takes a directory as FreeCol's home.

Parameters:
freeColHome - The home of the freecol files.
Throws:
FreeColException - If one of the data files could not be found.

ImageLibrary

private ImageLibrary(java.lang.String dataDirectory,
                     float scalingFactor)
Method Detail

init

public void init()
          throws FreeColException
Performs all necessary init operations such as loading of data files.

Throws:
FreeColException - If one of the data files could not be found. *

getScalingFactor

public float getScalingFactor()
Returns the scaling factor used when creating this ImageLibrary.

Returns:
1 unless getScaledImageLibrary(float) was used to create this object.

getScaledImageLibrary

public ImageLibrary getScaledImageLibrary(float scalingFactor)
                                   throws FreeColException
Gets a scaled version of this ImageLibrary.

Parameters:
scalingFactor - The factor used when scaling. 2 is twice the size of the original images and 0.5 is half.
Returns:
A new ImageLibrary.
Throws:
FreeColException

scaleImage

public java.awt.Image scaleImage(java.awt.Image image,
                                 float scale)

scaleIcon

public javax.swing.ImageIcon scaleIcon(javax.swing.ImageIcon icon,
                                       float scale)

scaleImages

private java.util.Map<java.lang.String,javax.swing.ImageIcon> scaleImages(java.util.Map<java.lang.String,javax.swing.ImageIcon> input,
                                                                          float scale)

scaleImages

private java.util.ArrayList<javax.swing.ImageIcon> scaleImages(java.util.List<javax.swing.ImageIcon> input,
                                                               float scale)

scaleImages2

private java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> scaleImages2(java.util.Map<java.lang.String,java.util.ArrayList<javax.swing.ImageIcon>> input,
                                                                                                float scale)

findImage

private javax.swing.ImageIcon findImage(java.lang.String filePath,
                                        java.lang.Class<FreeCol> resourceLocator,
                                        boolean doLookup)
                                 throws FreeColException
Finds the image file in the given filePath.

Parameters:
filePath - The path to the image file.
doLookup - If true then the resourceLocator is used when searching for the image file.
Returns:
An ImageIcon with data loaded from the image file.
Throws:
FreeColException - If the image could not be found.

loadTerrain

private void loadTerrain(java.awt.GraphicsConfiguration gc,
                         java.lang.Class<FreeCol> resourceLocator,
                         boolean doLookup)
                  throws FreeColException
Loads the terrain-images from file into memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
resourceLocator - The class that is used to locate data files.
doLookup - Must be set to 'false' if the path to the image files has been manually provided by the user. If set to 'true' then a lookup will be done to search for image files from net.sf.freecol, in this case the images need to be placed in net.sf.freecol/images.
Throws:
FreeColException - If one of the data files could not be found.

loadBeaches

private void loadBeaches(java.awt.GraphicsConfiguration gc,
                         java.lang.Class<FreeCol> resourceLocator,
                         boolean doLookup)
                  throws FreeColException
Loads the beach images from file into memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
resourceLocator - The class that is used to locate data files.
doLookup - Must be set to 'false' if the path to the image files has been manually provided by the user. If set to 'true' then a lookup will be done to search for image files from net.sf.freecol, in this case the images need to be placed in net.sf.freecol/images.
Throws:
FreeColException - If one of the data files could not be found.

loadRivers

private void loadRivers(java.awt.GraphicsConfiguration gc,
                        java.lang.Class<FreeCol> resourceLocator,
                        boolean doLookup)
                 throws FreeColException
Loads the river images from file into memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
resourceLocator - The class that is used to locate data files.
doLookup - Must be set to 'false' if the path to the image files has been manually provided by the user. If set to 'true' then a lookup will be done to search for image files from net.sf.freecol, in this case the images need to be placed in net.sf.freecol/images.
Throws:
FreeColException - If one of the data files could not be found.

loadRiverMouths

private void loadRiverMouths(java.awt.GraphicsConfiguration gc,
                             java.lang.Class<FreeCol> resourceLocator,
                             boolean doLookup)
                      throws FreeColException
Loads the river mouth images from file into memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
resourceLocator - The class that is used to locate data files.
doLookup - Must be set to 'false' if the path to the image files has been manually provided by the user. If set to 'true' then a lookup will be done to search for image files from net.sf.freecol, in this case the images need to be placed in net.sf.freecol/images.
Throws:
FreeColException - If one of the data files could not be found.

loadForests

private void loadForests(java.awt.GraphicsConfiguration gc,
                         java.lang.Class<FreeCol> resourceLocator,
                         boolean doLookup)
                  throws FreeColException
Loads the forest images from file into memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
resourceLocator - The class that is used to locate data files.
doLookup - Must be set to 'false' if the path to the image files has been manually provided by the user. If set to 'true' then a lookup will be done to search for image files from net.sf.freecol, in this case the images need to be placed in net.sf.freecol/images.
Throws:
FreeColException - If one of the data files could not be found.

loadColorChip

private void loadColorChip(java.awt.GraphicsConfiguration gc,
                           java.awt.Color c)
Generates a color chip image and stores it in memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
c - The color of the color chip to create.

loadMissionChip

private void loadMissionChip(java.awt.GraphicsConfiguration gc,
                             java.awt.Color c,
                             boolean expertMission)
Generates a mission chip image and stores it in memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
c - The color of the color chip to create.
expertMission - Should be true if the mission chip should represent an expert missionary.

loadAlarmChip

private void loadAlarmChip(java.awt.GraphicsConfiguration gc,
                           Tension.Level alarm,
                           boolean visited)
Generates a alarm chip image and stores it in memory.

Parameters:
gc - The GraphicsConfiguration is needed to create images that are compatible with the local environment.
alarm - The alarm level.
visited - whether the village was visited before.

getFoundingFatherImage

public java.awt.Image getFoundingFatherImage(FoundingFather father)
Returns the portrait of this Founding Father.

Parameters:
father - a FoundingFather value
Returns:
an Image value

getMonarchImage

public java.awt.Image getMonarchImage(Nation nation)
Returns the monarch-image for the given tile.

Parameters:
nation - The nation this monarch rules.
Returns:
the monarch-image for the given nation.

getMonarchImageIcon

public javax.swing.ImageIcon getMonarchImageIcon(Nation nation)
Returns the monarch-image icon for the given Nation.

Parameters:
nation - The nation this monarch rules.
Returns:
the monarch-image for the given nation.

getCoatOfArmsImageIcon

public javax.swing.ImageIcon getCoatOfArmsImageIcon(Nation nation)
Returns the coat-of-arms image for the given Nation.

Parameters:
nation - The nation.
Returns:
the coat-of-arms of this nation

getCoatOfArmsImage

public java.awt.Image getCoatOfArmsImage(Nation nation)
Returns the coat-of-arms image for the given Nation.

Parameters:
nation - The nation.
Returns:
the coat-of-arms of this nation

getBonusImage

public java.awt.Image getBonusImage(Tile tile)
Returns the bonus-image for the given tile.

Parameters:
tile -
Returns:
the bonus-image for the given tile.

getBonusImage

public java.awt.Image getBonusImage(ResourceType type)

getBonusImageIcon

public javax.swing.ImageIcon getBonusImageIcon(ResourceType type)
Returns the bonus-ImageIcon at the given index.

Parameters:
type - The type of the bonus-ImageIcon to return.

getScaledBonusImageIcon

public javax.swing.ImageIcon getScaledBonusImageIcon(ResourceType type,
                                                     float scale)

getScaledTerrainImage

public java.awt.Image getScaledTerrainImage(TileType type,
                                            float scale)
Returns the scaled terrain-image for a terrain type (and position 0, 0).

Parameters:
type - The type of the terrain-image to return.
scale - The scale of the terrain image to return.
Returns:
The terrain-image

getOverlayImage

public java.awt.Image getOverlayImage(TileType type,
                                      int x,
                                      int y)
Returns the overlay-image for the given type.

Parameters:
type - The type of the terrain-image to return.
x - The x-coordinate of the location of the tile that is being drawn.
y - The x-coordinate of the location of the tile that is being drawn.
Returns:
The terrain-image at the given index.

getTerrainImage

public java.awt.Image getTerrainImage(TileType type,
                                      int x,
                                      int y)
Returns the terrain-image for the given type.

Parameters:
type - The type of the terrain-image to return.
x - The x-coordinate of the location of the tile that is being drawn.
y - The x-coordinate of the location of the tile that is being drawn.
Returns:
The terrain-image at the given index.

getBorderImage

public java.awt.Image getBorderImage(TileType type,
                                     Map.Direction direction,
                                     int x,
                                     int y)
Returns the border terrain-image for the given type.

Parameters:
type - The type of the terrain-image to return.
direction - a Direction value
x - The x-coordinate of the location of the tile that is being drawn.
y - The x-coordinate of the location of the tile that is being drawn.
Returns:
The terrain-image at the given index.

getRiverMouthImage

public java.awt.Image getRiverMouthImage(Map.Direction direction,
                                         int magnitude,
                                         int x,
                                         int y)
Returns the river mouth terrain-image for the direction and magnitude.

Parameters:
direction - a Direction value
magnitude - an int value
x - The x-coordinate of the location of the tile that is being drawn (ignored).
y - The x-coordinate of the location of the tile that is being drawn (ignored).
Returns:
The terrain-image at the given index.

getCoastImage

public java.awt.Image getCoastImage(TileType type,
                                    Map.Direction direction,
                                    int x,
                                    int y)
Returns the coast terrain-image for the given type.

Parameters:
type - The type of the terrain-image to return.
direction - a Direction value
x - The x-coordinate of the location of the tile that is being drawn.
y - The x-coordinate of the location of the tile that is being drawn.
Returns:
The terrain-image at the given index.

getRiverImage

public java.awt.Image getRiverImage(int index)
Returns the river image at the given index.

Parameters:
index - The index of the image to return.
Returns:
The image at the given index.

getBeachImage

public java.awt.Image getBeachImage(int index)
Returns the beach image at the given index.

Parameters:
index - The index of the image to return.
Returns:
The image at the given index.

getForestImage

public java.awt.Image getForestImage(TileType type)
Returns the forest image for a terrain type.

Parameters:
type - The type of the terrain-image to return.
Returns:
The image at the given index.

getMiscImage

public java.awt.Image getMiscImage(java.lang.String id)
Returns the image with the given id.

Parameters:
id - The id of the image to return.
Returns:
The image.

getMiscImageIcon

public javax.swing.ImageIcon getMiscImageIcon(java.lang.String id)
Returns the image with the given id.

Parameters:
id - The id of the image to return.
Returns:
The image.

getGoodsImage

public java.awt.Image getGoodsImage(GoodsType goodsType)
Returns the goods-image at the given index.

Parameters:
goodsType - The type of the goods-image to return.
Returns:
The goods-image at the given index.

getGoodsImageIcon

public javax.swing.ImageIcon getGoodsImageIcon(GoodsType goodsType)
Returns the goods-image for a goods type.

Parameters:
goodsType - The type of the goods-image to return.
Returns:
The goods-image at the given index.

getScaledGoodsImageIcon

public javax.swing.ImageIcon getScaledGoodsImageIcon(GoodsType type,
                                                     float scale)
Returns the scaled goods-ImageIcon for a goods type.

Parameters:
type - The type of the goods-ImageIcon to return.
scale - The scale of the goods-ImageIcon to return.
Returns:
The goods-ImageIcon at the given index.

getColorChip

public java.awt.Image getColorChip(java.awt.Color color)
Returns the color chip with the given color.

Parameters:
color - The color of the color chip to return.
Returns:
The color chip with the given color.

getMissionChip

public java.awt.Image getMissionChip(java.awt.Color color,
                                     boolean expertMission)
Returns the mission chip with the given color.

Parameters:
color - The color of the color chip to return.
expertMission - Indicates whether or not the missionary is an expert.
Returns:
The color chip with the given color.

getAlarmChip

public java.awt.Image getAlarmChip(Tension.Level alarm,
                                   boolean visited)
Returns the alarm chip with the given color.

Parameters:
alarm - The alarm level.
Returns:
The alarm chip.

getTerrainImageWidth

public int getTerrainImageWidth(TileType type)
Returns the width of the terrain-image for a terrain type.

Parameters:
type - The type of the terrain-image.
Returns:
The width of the terrain-image at the given index.

getTerrainImageHeight

public int getTerrainImageHeight(TileType type)
Returns the height of the terrain-image for a terrain type.

Parameters:
type - The type of the terrain-image.
Returns:
The height of the terrain-image at the given index.

getCompoundTerrainImageHeight

public int getCompoundTerrainImageHeight(TileType type)
Returns the height of the terrain-image including overlays and forests for the given terrain type.

Parameters:
type - The type of the terrain-image.
Returns:
The height of the terrain-image at the given index.

getSettlementImage

public java.awt.Image getSettlementImage(Settlement.SettlementType settlementType)
Returns the graphics that will represent the given settlement.

Parameters:
settlementType - The type of settlement whose graphics type is needed.
Returns:
The graphics that will represent the given settlement.

getSettlementImage

public java.awt.Image getSettlementImage(Settlement settlement)
Returns the graphics that will represent the given settlement.

Parameters:
settlement - The settlement whose graphics type is needed.
Returns:
The graphics that will represent the given settlement.

getUnitImageIcon

public javax.swing.ImageIcon getUnitImageIcon(Unit unit)
Returns the ImageIcon that will represent the given unit.

Parameters:
unit - The unit whose graphics type is needed.
Returns:
an ImageIcon value

getUnitImageIcon

public javax.swing.ImageIcon getUnitImageIcon(UnitType unitType)
Returns the ImageIcon that will represent a unit of the given type.

Parameters:
unitType - an UnitType value
Returns:
an ImageIcon value

getUnitImageIcon

public javax.swing.ImageIcon getUnitImageIcon(UnitType unitType,
                                              Unit.Role role)
Returns the ImageIcon that will represent a unit of the given type and role.

Parameters:
unitType - an UnitType value
role - a Role value
Returns:
an ImageIcon value

getUnitImageIcon

public javax.swing.ImageIcon getUnitImageIcon(Unit unit,
                                              boolean grayscale)
Returns the ImageIcon that will represent the given unit.

Parameters:
unit - an Unit value
grayscale - a boolean value
Returns:
an ImageIcon value

getUnitImageIcon

public javax.swing.ImageIcon getUnitImageIcon(UnitType unitType,
                                              boolean grayscale)
Returns the ImageIcon that will represent a unit of the given type.

Parameters:
unitType - an UnitType value
grayscale - a boolean value
Returns:
an ImageIcon value

getUnitImageIcon

public javax.swing.ImageIcon getUnitImageIcon(UnitType unitType,
                                              Unit.Role role,
                                              boolean grayscale)
Returns the ImageIcon that will represent a unit of the given type and role.

Parameters:
unitType - an UnitType value
role - a Role value
grayscale - a boolean value
Returns:
an ImageIcon value

getScaledImageIcon

public javax.swing.ImageIcon getScaledImageIcon(javax.swing.ImageIcon inputIcon,
                                                float scale)
Returns the scaled ImageIcon.

Parameters:
inputIcon - an ImageIcon value
scale - The scale of the ImageIcon to return.
Returns:
The scaled ImageIcon.

getScaledImageIcon

public javax.swing.ImageIcon getScaledImageIcon(java.awt.Image image,
                                                float scale)
Returns the scaled ImageIcon.

Parameters:
image - an Image value
scale - The scale of the ImageIcon to return.
Returns:
The scaled ImageIcon.