Package breadboards
Class GDieImage
- java.lang.Object
-
- breadboards.GObject
-
- breadboards.GImage
-
- breadboards.GDieImage
-
-
Field Summary
Fields Modifier and Type Field Description static int
DIE_HEIGHT
The height of the die image displayedstatic int
DIE_WIDTH
The width of the die image displayedstatic int
NUM_FACES
The number of faces associated with the die (a standard die has 6 faces)
-
Constructor Summary
Constructors Constructor Description GDieImage(int value)
Create a new die image, that displays the given value on its face, and is positioned at (0,0)GDieImage(int value, double x, double y)
Create a new die image, that displays the given value on its face, and is positioned at (x,y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
displayValue(int value)
change the image of this die to show a particular value-
Methods inherited from class breadboards.GImage
contains, createRGBPixel, createRGBPixel, draw, getAlpha, getBlue, getBounds, getFromResource, getGreen, getHeight, getImage, getPixelArray, getRed, getWidth, saveImage, saveImage, setImage, setImage
-
Methods inherited from class breadboards.GObject
addMouseListener, addMouseMotionListener, getBreadboard, getLocation, getMouseListeners, getMouseMotionListeners, getParent, getX, getY, isVisible, move, movePolar, removeMouseListener, removeMouseMotionListener, sendBackward, sendForward, sendToBack, sendToFront, setLocation, setParent, setVisible, setX, setY, updateBreadboard
-
-
-
-
Field Detail
-
DIE_HEIGHT
public static final int DIE_HEIGHT
The height of the die image displayed- See Also:
- Constant Field Values
-
DIE_WIDTH
public static final int DIE_WIDTH
The width of the die image displayed- See Also:
- Constant Field Values
-
NUM_FACES
public static final int NUM_FACES
The number of faces associated with the die (a standard die has 6 faces)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GDieImage
public GDieImage(int value)
Create a new die image, that displays the given value on its face, and is positioned at (0,0)- Parameters:
value
- the value to be displayed on the die face- Throws:
java.lang.RuntimeException
- when value is not between 1 and NUM_FACES==6
-
GDieImage
public GDieImage(int value, double x, double y)
Create a new die image, that displays the given value on its face, and is positioned at (x,y)- Parameters:
value
- the value to be displayed on the die facex
- the x-coordinate of the upper left corner of the die face imagey
- the y-coordinate of the upper left corner of the die face image- Throws:
java.lang.RuntimeException
- when value is not between 1 and NUM_FACES==6
-
-