All Packages Class Hierarchy This Package Previous Next Index
Class java.lancs.BasicGraphics
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----java.awt.Frame
|
+----java.lancs.BasicGraphics
- public class BasicGraphics
- extends Frame
- implements ActionListener
-
FILLED_OVAL
- definition of a filled-in oval
-
FILLED_RECTANGLE
- definition of a filled-in rectangle
-
FILLED_TRIANGLE
- definition of a filled-in triangle
-
OVAL
- definition of an oval shape
-
RECTANGLE
- definition of a rectangle shape
-
TRIANGLE
- definition of a triangle shape
-
BasicGraphics()
- constructor to lay out the window
-
actionPerformed(ActionEvent)
- handles button depression events, etc.
-
draw()
- draws the window on the screen with the specified shapes
-
setColour(Color)
- set the colour of the shape that you want to draw
-
setDimensions(int, int, int, int)
- set the dimensions of the shape that you want to draw
-
setShape(int)
- set the type of shape that you want to draw
RECTANGLE
public static final int RECTANGLE
- definition of a rectangle shape
OVAL
public static final int OVAL
- definition of an oval shape
TRIANGLE
public static final int TRIANGLE
- definition of a triangle shape
FILLED_RECTANGLE
public static final int FILLED_RECTANGLE
- definition of a filled-in rectangle
FILLED_OVAL
public static final int FILLED_OVAL
- definition of a filled-in oval
FILLED_TRIANGLE
public static final int FILLED_TRIANGLE
- definition of a filled-in triangle
BasicGraphics
public BasicGraphics()
- constructor to lay out the window
actionPerformed
public void actionPerformed(ActionEvent event)
- handles button depression events, etc.
setShape
public void setShape(int shape)
- set the type of shape that you want to draw
- Parameters:
- shape - e.g. BasicGraphics.RECTANGLE
setDimensions
public void setDimensions(int x,
int y,
int w,
int h)
- set the dimensions of the shape that you want to draw
- Parameters:
- x - x-coordinate of the top left hand corner of the bounding
rectangle
- y - y-coordinate of the top left hand corner of the bounding
rectangle
- w - width of the bounding rectangle
- h - height of the bounding rectangle
setColour
public void setColour(Color colour)
- set the colour of the shape that you want to draw
- Parameters:
- colour - the Color type (Color.red, Color.blue, etc.)
draw
public void draw()
- draws the window on the screen with the specified shapes
All Packages Class Hierarchy This Package Previous Next Index