com.oxfordmathcenter.breadboards
Class GDieImage

java.lang.Object
  extended by acm.graphics.GObject
      extended by acm.graphics.GImage
          extended by com.oxfordmathcenter.breadboards.GDieImage
All Implemented Interfaces:
acm.graphics.GResizable, acm.graphics.GScalable, java.io.Serializable, java.lang.Cloneable

public class GDieImage
extends acm.graphics.GImage

An extension of GObject that displays as a die face showing a particular value

Author:
paul
See Also:
Serialized Form

Field Summary
static int DIE_HEIGHT
           
static int DIE_WIDTH
           
static int NUM_FACES
           
 
Constructor Summary
GDieImage(int value)
          Create a new die image, that displays a 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 a given value on its face and is positioned at (x,y)
 
Method Summary
 void displayValue(int value)
          change the image of this die to show a particular value
 
Methods inherited from class acm.graphics.GImage
createRGBPixel, createRGBPixel, getAlpha, getBlue, getBounds, getGreen, getImage, getPixelArray, getRed, getSize, paint, saveImage, saveImage, scale, scale, setBounds, setBounds, setImage, setImage, setSize, setSize
 
Methods inherited from class acm.graphics.GObject
addActionListener, addMouseListener, addMouseMotionListener, contains, contains, fireActionEvent, fireActionEvent, getColor, getHeight, getLocation, getParent, getWidth, getX, getY, isVisible, move, movePolar, pause, removeActionListener, removeMouseListener, removeMouseMotionListener, sendBackward, sendForward, sendToBack, sendToFront, setColor, setLocation, setLocation, setParent, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIE_HEIGHT

public static final int DIE_HEIGHT
See Also:
Constant Field Values

DIE_WIDTH

public static final int DIE_WIDTH
See Also:
Constant Field Values

NUM_FACES

public static final int NUM_FACES
See Also:
Constant Field Values
Constructor Detail

GDieImage

public GDieImage(int value)
Create a new die image, that displays a given value on its face and is positioned at (0,0)

Parameters:
value - the value to be displayed on the die face

GDieImage

public GDieImage(int value,
                 double x,
                 double y)
Create a new die image, that displays a given value on its face and is positioned at (x,y)

Parameters:
value - the value to be displayed on the die face
x - the x-coordinate of the upper left corner of the die face image
y - the y-coordinate of the upper left corner of the die face image
Method Detail

displayValue

public void displayValue(int value)
change the image of this die to show a particular value

Parameters:
value - the value to be displayed on the die face