|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.gui.ArenaImages
Manages the icon sets used for the GUI. For each icon set an instance of this class can be created.
| Inner Class Summary | |
class |
ArenaImages.CardImage
Class for rendering the value number into existing card image |
private class |
ArenaImages.RobotFilenameFilter
Class for finding the robot images in a directory |
class |
ArenaImages.RobotImages
Datastructure to keep the possible images for robots |
| Field Summary | |
private int |
arenaSize
the arena size |
private java.awt.Image[] |
cardColors
Images for the 4 card values (here used as colors) |
private java.awt.Image[] |
cardColorsTree
Images for the 4 card values for the tree. |
private java.util.Hashtable |
cardImages
To keep track of card images that already have been created. |
private java.awt.Image |
emptyImage
The image for an empty field |
private java.awt.Image |
exitImage
The image for an exit |
private int |
maxHeight
The maximum height of all the images |
private int |
maxWidth
The maximum width of all the images |
private int |
nextRobotImage
Image to be used by getNextRobotImage() |
private ArenaImages.RobotImages[] |
robotImages
Images available for robots |
private java.awt.Image |
teleporterImage
The image for a teleport |
private boolean |
threeDimensional
Are the wall of this arena style three dimensional? |
private java.awt.Image[][][][] |
wall3d
Images for 3d walls |
private java.awt.Image |
wallImage
The image for a 2d wall. |
private java.awt.Image |
wellImage
The image for an energy source |
| Constructor Summary | |
(package private) |
ArenaImages(java.lang.String directoryName,
javax.swing.JFrame frame,
int arenaSize)
Creates a new set of Arena images |
| Method Summary | |
private java.awt.Image |
createImage(java.io.File directory,
java.lang.String name,
javax.swing.JFrame frame)
Creates an image in specified directory of specified name. |
private java.awt.Image |
createImage(java.io.File directory,
java.lang.String name,
javax.swing.JFrame frame,
boolean ignoreMaxSize)
This is the original method createImage, and now there is the boolean parameter ignoreMaxSize added. |
private void |
createRobotImages(java.io.File directory,
javax.swing.JFrame frame)
Creates images to be used by the individual robot implementations. |
java.awt.Image |
getCardImage(int value,
int color)
Get image for card with specified value and color. |
java.awt.Image |
getCardTreeImage(int value,
int color)
This method does the same as getCardImage, but it generates crads only
for the tree, that is in a size of 20. |
java.awt.Image |
getImageForField(Field field)
Returns an image matching the item on a field. |
int |
getMaxHeight()
Returns the maximum height of all images this object knows |
int |
getMaxWidth()
Returns the maximum width of all images this object knows |
ArenaImages.RobotImages |
getNextRobotImages()
Returns images for robots. |
private int |
hasWall(Field field)
Checks whether the specified field contains a wall. |
boolean |
is3D()
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private boolean threeDimensional
private java.awt.Image emptyImage
private java.awt.Image wallImage
private java.awt.Image wellImage
private java.awt.Image teleporterImage
private java.awt.Image exitImage
private int arenaSize
private int maxWidth
private int maxHeight
private java.awt.Image[][][][] wall3d
private java.awt.Image[] cardColors
private java.awt.Image[] cardColorsTree
private ArenaImages.RobotImages[] robotImages
private int nextRobotImage
private java.util.Hashtable cardImages
| Constructor Detail |
ArenaImages(java.lang.String directoryName,
javax.swing.JFrame frame,
int arenaSize)
directoryName - Name of directory to scan for imagesframe - Frame of the application (for getToolkit())| Method Detail |
private java.awt.Image createImage(java.io.File directory,
java.lang.String name,
javax.swing.JFrame frame)
directory - Dir in which the image should bename - file name of imageframe - Frame of the application (for getToolkit())
private java.awt.Image createImage(java.io.File directory,
java.lang.String name,
javax.swing.JFrame frame,
boolean ignoreMaxSize)
ignoreMaxSize added. By calling this method with
this parameter set false, the method will act like it acted originally,
i. e. it verifies if the image is larger than the maxWidth or maxHeight.
This verification is useful to draw all images non-cut. But it is not
useful, when specifying the statusrobot, which is much larger
than any other image. So it was necessary to be able to ignore
these size-verifications.
Note:
The original method call with less parameter has been left
so it is not necessary to change all code.
directory - Dir in which the image should bename - file name of imageframe - Frame of the application (for getToolkit())ignoreMaxSize - true if you want to ignore the size-verification,
false otherwise.
private void createRobotImages(java.io.File directory,
javax.swing.JFrame frame)
directory - Directory to be scannedframe - Frame of the application (for getTollkit())private int hasWall(Field field)
field - Field to checkpublic java.awt.Image getImageForField(Field field)
field - Field to get Image forpublic ArenaImages.RobotImages getNextRobotImages()
public int getMaxWidth()
public int getMaxHeight()
public java.awt.Image getCardImage(int value,
int color)
value - Card value as defined in Card objectcolor - Color value as defined in Card object
public java.awt.Image getCardTreeImage(int value,
int color)
getCardImage, but it generates crads only
for the tree, that is in a size of 20.value - Card value as defined in Card objectcolor - Color value as defined in Card objectpublic boolean is3D()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||