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

Variable Index

 o FILLED_OVAL
definition of a filled-in oval
 o FILLED_RECTANGLE
definition of a filled-in rectangle
 o FILLED_TRIANGLE
definition of a filled-in triangle
 o OVAL
definition of an oval shape
 o RECTANGLE
definition of a rectangle shape
 o TRIANGLE
definition of a triangle shape

Constructor Index

 o BasicGraphics()
constructor to lay out the window

Method Index

 o actionPerformed(ActionEvent)
handles button depression events, etc.
 o draw()
draws the window on the screen with the specified shapes
 o setColour(Color)
set the colour of the shape that you want to draw
 o setDimensions(int, int, int, int)
set the dimensions of the shape that you want to draw
 o setShape(int)
set the type of shape that you want to draw

Variables

 o RECTANGLE
 public static final int RECTANGLE
definition of a rectangle shape

 o OVAL
 public static final int OVAL
definition of an oval shape

 o TRIANGLE
 public static final int TRIANGLE
definition of a triangle shape

 o FILLED_RECTANGLE
 public static final int FILLED_RECTANGLE
definition of a filled-in rectangle

 o FILLED_OVAL
 public static final int FILLED_OVAL
definition of a filled-in oval

 o FILLED_TRIANGLE
 public static final int FILLED_TRIANGLE
definition of a filled-in triangle

Constructors

 o BasicGraphics
 public BasicGraphics()
constructor to lay out the window

Methods

 o actionPerformed
 public void actionPerformed(ActionEvent event)
handles button depression events, etc.

 o setShape
 public void setShape(int shape)
set the type of shape that you want to draw

Parameters:
shape - e.g. BasicGraphics.RECTANGLE
 o 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
 o 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.)
 o draw
 public void draw()
draws the window on the screen with the specified shapes


All Packages  Class Hierarchy  This Package  Previous  Next  Index