de.uni_paderborn.robots.gui
Class ArenaImages

java.lang.Object
  |
  +--de.uni_paderborn.robots.gui.ArenaImages

public class ArenaImages
extends java.lang.Object

This class organizes the images used by the arena. The class is realized as a singleton.


Field Summary
private  java.awt.Image arenaDesignerLogo
          ArenaDesigner logo
private static ArenaImages arenaImages
          instance to the object of this class
private  java.awt.image.BufferedImage[][] cardsAloneBig
          array with card images (big)
private  java.awt.image.BufferedImage[][] cardsAloneSmall
          array with card images (small)
private  java.awt.image.BufferedImage[][] cardsBig
          array with card images (big)
private  java.awt.image.BufferedImage[][] cardsSmall
          array with card images (small)
private  java.awt.image.BufferedImage exitBig
          image for exit (big)
private  java.awt.image.BufferedImage exitSmall
          image for exit (small)
private  java.awt.image.BufferedImage floorBig
          image for floor (big)
private  java.awt.image.BufferedImage floorSmall
          image for floor (small)
private  java.awt.image.BufferedImage grayFloorBig
          image for gray floor (wormhole mode) (big)
private  java.awt.image.BufferedImage grayFloorSmall
          image for gray floor (wormhole mode) (small)
private  java.awt.Image robomaniaLogo
          robomania logo
private  java.awt.image.BufferedImage robotFieldBig
          image for robot field (big)
private  java.awt.image.BufferedImage robotFieldSmall
          image for robot field (small)
private  java.awt.image.BufferedImage[][] robotsBig
          array with robot images (big)
private  java.awt.image.BufferedImage[][] robotsSmall
          array with robot images (small)
static int TOOLBAR_CONTINUE_GAME
          continue game icon
static int TOOLBAR_DEBUG
          debug icon
static int TOOLBAR_DELETE_ROBOT
          delete robot icon
static int TOOLBAR_DISQUALIFY_ROBOT
          disqualify robot icon
static int TOOLBAR_EXIT_GAME
          reset game icon
static int TOOLBAR_LOAD_ARENA
          load arena icon
static int TOOLBAR_LOAD_ROBOT
          load robot icon
static int TOOLBAR_LOAD_ROBOTLIST
          load robotlist icon
static int TOOLBAR_PAUSE_GAME
          pause game icon
static int TOOLBAR_RESET_GAME
          exit game icon
static int TOOLBAR_SAVE_ROBOTLIST
          save robotlist icon
static int TOOLBAR_START_GAME
          start game icon
static int TOOLBAR_STEP
          step icon
static int TOOLBAR_STOP_GAME
          abort game icon
private  java.awt.image.BufferedImage[] toolbarIcons
          icons for toolbar
private  java.awt.image.BufferedImage[] wallBig
          image for wall (big)
private  java.awt.image.BufferedImage[] wallSmall
          image for wall (small)
private  java.awt.image.BufferedImage wellBig
          image for well (big)
private  java.awt.image.BufferedImage wellSmall
          image for well (small)
private  java.awt.image.BufferedImage wormholeBig
          image for wormhole (big)
private  java.awt.image.BufferedImage wormholeSmall
          image for wormhole (small)
 
Constructor Summary
private ArenaImages(java.awt.Component component)
          Constructor, loads image data from disk and computes the other images.
 
Method Summary
 java.awt.Image getAloneCardImage(int value, int color, boolean big)
          Returns an image for a card without the floor.
 java.awt.Image getArenaDesignerLogo()
          Returns arena Designer logo.
static ArenaImages getArenaImages(java.awt.Component component)
          Returns an instance of the class ArenaImages.
 java.awt.Image getCardImage(int value, int color, boolean big)
          Returns an image for a card.
 java.awt.Image getExitImage(boolean big)
          Returns an image for the exit.
 java.awt.Image getFloorImage(boolean big)
          Returns an image for the floor.
 java.awt.Image getGrayFloorImage(boolean big)
          Returns an image for gray floor (wormhole mode).
 java.awt.Image getImageForItem(Item item, boolean zoom)
          Returns an appropriate image for the given item.
 java.awt.Image getRobomaniaLogo()
          Returns robomania logo.
 java.awt.Image getRobotFieldImage(boolean big)
          Returns an image for a robot field.
 java.awt.Image getRobotImage(int number, int direction, boolean big)
          Returns an image for a robot.
 java.awt.Image getToolbarIcon(int type)
          Returns an icon for the toolbar.
 java.awt.Image getWallImage(int type, boolean big)
          Returns an image for a wall.
 java.awt.Image getWellImage(boolean big)
          Returns an image for a well.
 java.awt.Image getWormholeImage(boolean big)
          Returns an image for a wormhole.
private  void prepareCardImages(java.awt.Image cardGif, java.awt.Image cardAloneGif, java.awt.Image symbols16Gif, java.awt.Image symbols8Gif)
          Prepares the card images.
private  void prepareOtherImages(java.awt.Image floorGif, java.awt.Image wallsGif, java.awt.Image wellGif, java.awt.Image wormholeGif, java.awt.Image exitGif, java.awt.Image robotFieldGif, java.awt.Image grayFloorGif)
          Prepares the other images.
private  void prepareRobotImages(java.awt.Image robots1Gif, java.awt.Image robots2Gif)
          Prepares the robot images.
private  void prepareToolbarIcons(java.awt.Image toolbarGif)
          Prepares the toolbar icons.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

arenaImages

private static ArenaImages arenaImages
instance to the object of this class

TOOLBAR_DEBUG

public static final int TOOLBAR_DEBUG
debug icon

TOOLBAR_DELETE_ROBOT

public static final int TOOLBAR_DELETE_ROBOT
delete robot icon

TOOLBAR_DISQUALIFY_ROBOT

public static final int TOOLBAR_DISQUALIFY_ROBOT
disqualify robot icon

TOOLBAR_CONTINUE_GAME

public static final int TOOLBAR_CONTINUE_GAME
continue game icon

TOOLBAR_LOAD_ARENA

public static final int TOOLBAR_LOAD_ARENA
load arena icon

TOOLBAR_LOAD_ROBOTLIST

public static final int TOOLBAR_LOAD_ROBOTLIST
load robotlist icon

TOOLBAR_LOAD_ROBOT

public static final int TOOLBAR_LOAD_ROBOT
load robot icon

TOOLBAR_PAUSE_GAME

public static final int TOOLBAR_PAUSE_GAME
pause game icon

TOOLBAR_SAVE_ROBOTLIST

public static final int TOOLBAR_SAVE_ROBOTLIST
save robotlist icon

TOOLBAR_START_GAME

public static final int TOOLBAR_START_GAME
start game icon

TOOLBAR_STEP

public static final int TOOLBAR_STEP
step icon

TOOLBAR_STOP_GAME

public static final int TOOLBAR_STOP_GAME
abort game icon

TOOLBAR_RESET_GAME

public static final int TOOLBAR_RESET_GAME
exit game icon

TOOLBAR_EXIT_GAME

public static final int TOOLBAR_EXIT_GAME
reset game icon

robotsBig

private java.awt.image.BufferedImage[][] robotsBig
array with robot images (big)

robotsSmall

private java.awt.image.BufferedImage[][] robotsSmall
array with robot images (small)

cardsBig

private java.awt.image.BufferedImage[][] cardsBig
array with card images (big)

cardsSmall

private java.awt.image.BufferedImage[][] cardsSmall
array with card images (small)

cardsAloneBig

private java.awt.image.BufferedImage[][] cardsAloneBig
array with card images (big)

cardsAloneSmall

private java.awt.image.BufferedImage[][] cardsAloneSmall
array with card images (small)

wormholeBig

private java.awt.image.BufferedImage wormholeBig
image for wormhole (big)

wormholeSmall

private java.awt.image.BufferedImage wormholeSmall
image for wormhole (small)

wallBig

private java.awt.image.BufferedImage[] wallBig
image for wall (big)

wallSmall

private java.awt.image.BufferedImage[] wallSmall
image for wall (small)

wellBig

private java.awt.image.BufferedImage wellBig
image for well (big)

wellSmall

private java.awt.image.BufferedImage wellSmall
image for well (small)

floorBig

private java.awt.image.BufferedImage floorBig
image for floor (big)

floorSmall

private java.awt.image.BufferedImage floorSmall
image for floor (small)

exitBig

private java.awt.image.BufferedImage exitBig
image for exit (big)

exitSmall

private java.awt.image.BufferedImage exitSmall
image for exit (small)

robotFieldBig

private java.awt.image.BufferedImage robotFieldBig
image for robot field (big)

robotFieldSmall

private java.awt.image.BufferedImage robotFieldSmall
image for robot field (small)

grayFloorBig

private java.awt.image.BufferedImage grayFloorBig
image for gray floor (wormhole mode) (big)

grayFloorSmall

private java.awt.image.BufferedImage grayFloorSmall
image for gray floor (wormhole mode) (small)

toolbarIcons

private java.awt.image.BufferedImage[] toolbarIcons
icons for toolbar

robomaniaLogo

private java.awt.Image robomaniaLogo
robomania logo

arenaDesignerLogo

private java.awt.Image arenaDesignerLogo
ArenaDesigner logo
Constructor Detail

ArenaImages

private ArenaImages(java.awt.Component component)
             throws java.util.MissingResourceException
Constructor, loads image data from disk and computes the other images.
Parameters:
component - instance of class java.awt.Component
Throws:
java.util.MissingResourceException - if image data could not be loaded completely
Method Detail

prepareRobotImages

private void prepareRobotImages(java.awt.Image robots1Gif,
                                java.awt.Image robots2Gif)
Prepares the robot images.
Parameters:
robots1Gif - image containing eight robots.
robots2Gif - image containing eight robots.

prepareCardImages

private void prepareCardImages(java.awt.Image cardGif,
                               java.awt.Image cardAloneGif,
                               java.awt.Image symbols16Gif,
                               java.awt.Image symbols8Gif)
Prepares the card images.
Parameters:
cardGif - image containing a card.
cardAloneGif - image containing a card without floor.
symbols16Gif - image containing 4 symbols, 16 x 16.
symbols8Gif - image containing 4 symbols, 8 x 8.

prepareOtherImages

private void prepareOtherImages(java.awt.Image floorGif,
                                java.awt.Image wallsGif,
                                java.awt.Image wellGif,
                                java.awt.Image wormholeGif,
                                java.awt.Image exitGif,
                                java.awt.Image robotFieldGif,
                                java.awt.Image grayFloorGif)
Prepares the other images.
Parameters:
floorGif - floor image
wallsGif - wall image
wellGif - well image
wormholeGif - wormhole image
exitGif - exit image
robotFieldGif - robot field image
grayFloorGif - gray floor image

prepareToolbarIcons

private void prepareToolbarIcons(java.awt.Image toolbarGif)
Prepares the toolbar icons.
Parameters:
toolbarGif - image containing the toolbar icons

getArenaImages

public static ArenaImages getArenaImages(java.awt.Component component)
Returns an instance of the class ArenaImages.
Parameters:
component - instance of class java.awt.Component
Returns:
instance of class ArenaImages

getRobotImage

public java.awt.Image getRobotImage(int number,
                                    int direction,
                                    boolean big)
Returns an image for a robot.
Parameters:
number - number of wanted robot
direction - direction of wanted robot
big - big version of image wanted?
Returns:
an image for a robot or null if robot specified by parameters does not exist

getCardImage

public java.awt.Image getCardImage(int value,
                                   int color,
                                   boolean big)
Returns an image for a card.
Parameters:
value - value of wanted card
color - color of wanted card
big - version of image wanted?
Returns:
an image for a card or null if card specified by parameters does not exist

getAloneCardImage

public java.awt.Image getAloneCardImage(int value,
                                        int color,
                                        boolean big)
Returns an image for a card without the floor.
Parameters:
value - value of wanted card
color - color of wanted card
big - version of image wanted?
Returns:
an image for a card or null if card specified by parameters does not exist

getWormholeImage

public java.awt.Image getWormholeImage(boolean big)
Returns an image for a wormhole.
Parameters:
big - big version of image wanted?
Returns:
an image for a wormhole

getWellImage

public java.awt.Image getWellImage(boolean big)
Returns an image for a well.
Parameters:
big - big version of image wanted?
Returns:
an image for a well

getWallImage

public java.awt.Image getWallImage(int type,
                                   boolean big)
Returns an image for a wall.
Parameters:
type - wall type (0..15)
big - big version of image wanted?
Returns:
an image for a wall

getFloorImage

public java.awt.Image getFloorImage(boolean big)
Returns an image for the floor.
Parameters:
big - big version of image wanted?
Returns:
an image for the floor

getExitImage

public java.awt.Image getExitImage(boolean big)
Returns an image for the exit.
Parameters:
big - big version of image wanted?
Returns:
an image for the exit

getRobotFieldImage

public java.awt.Image getRobotFieldImage(boolean big)
Returns an image for a robot field.
Parameters:
big - big version of image wanted?
Returns:
an image for a robot field

getGrayFloorImage

public java.awt.Image getGrayFloorImage(boolean big)
Returns an image for gray floor (wormhole mode).
Parameters:
big - big version of image wanted?
Returns:
an image for gray floor

getToolbarIcon

public java.awt.Image getToolbarIcon(int type)
Returns an icon for the toolbar.
Parameters:
type - type of icon specified by constant
Returns:
an icon for the toolbar

getRobomaniaLogo

public java.awt.Image getRobomaniaLogo()
Returns robomania logo.
Returns:
robomania logo

getArenaDesignerLogo

public java.awt.Image getArenaDesignerLogo()
Returns arena Designer logo.
Returns:
arena Designer logo

getImageForItem

public java.awt.Image getImageForItem(Item item,
                                      boolean zoom)
Returns an appropriate image for the given item.
Parameters:
item - an item