A B C D E G H I K L M O P R S U X Y

A

addPoint(Point) - Method in class DrawableShape

PRE: A valid Point object
POST: Add a new point to the point list.
addShape(DrawableShape) - Method in class DrawPadDoc

PRE: A valid DrawableShape object
POST: Add a shape to the list

B

backBufferGraphics - Variable in class DrawPadView
Graphic context associate with the back image buffer
backBufferImage - Variable in class DrawPadView
Back Image buffer for drawing
bChangingColor - Variable in class DrawPadView
A flag to indicate whether we are changing the shape's color
bDrawingShape - Variable in class DrawPadView
A flag to indicate whether a shape is being draw
bFill - Variable in class DrawableShape
Flag to indicate the shape is to be filled or not
BORDER_WIDTH - Variable in class DrawPadView
Constant for the border width
bSelected - Variable in class DrawableShape
Flag to indicate if the shape has been selected
bSelectedPointBox - Variable in class DrawPadDoc
A flag to indicate if we have selected a point box in the selected shape
bSelectedPointBox - Variable in class DrawPadView
A flag to indicate whether a point box for a shape has been selected
bSelectedShape - Variable in class DrawPadView
A flag to indicate whether a shape is selected in the list

C

color - Variable in class DrawableShape
Color for the shape
colorList - Variable in class DrawPadView
An Array of color that is available
copyClone() - Method in class DrawableShape

PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
copyClone() - Method in class Ellipse

PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
copyClone() - Method in class Line

PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
copyClone() - Method in class Point

PRE: None
POST: Creat a new copy of a Point instance
copyClone() - Method in class Polygon

PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
copyClone() - Method in class Rectangle

PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
copySelectedShape() - Method in class DrawPadDoc

PRE: NoneBR> POST: If an shape was selected, this class will save a copy of it
copyShape - Variable in class DrawPadDoc
A copied of a shape
currentShape - Variable in class DrawPadView
Current shape object for before adding to DrawPadDoc

D

deleteSelectedShape() - Method in class DrawPadDoc

PRE: None
POST: Delete the selected shape from the list if there is one selected
DOUBLE_IMAGE_SIZE - Variable in class DrawPadView
Constant for 2 * image size in pixel.
DrawableShape - class DrawableShape.
CLASS: DrawableShape
PURPOSE: Serve as a super class for other shape, force the subclass to have method for drawing and editing.
IMPORT: java.awt.Graphics, java.awt.Color, java.util.Vector, Point
EXPORT: None, This is an abstract class with partial implementation.
DrawableShape() - Constructor for class DrawableShape
 
drawAllShapes(Graphics) - Method in class DrawPadDoc

PRE: A valid Graphics object
POST: Draw all the shape in the list.
drawBorder(Graphics) - Method in class DrawPadView

PRE: Valid Graphic object.
POST: Draw the border for the drawing area
drawColorBar(Graphics) - Method in class DrawPadView

PRE: Valid Graphic object.
POST: Draw the color bar to the given Graphics object
drawCurrentColor(Graphics) - Method in class DrawPadView

PRE: Valid Graphic object.
POST: Draw the color that we are using right now
drawHeight - Variable in class DrawPadView
Drawing area height.
drawOptionBar(Graphics) - Method in class DrawPadView

PRE: Valid Graphic object.
POST: Draw the option bar to the given Graphics object
drawPadDoc - Variable in class DrawPadView
Keep track of all the shape and for the editing methods
DrawPadDoc - class DrawPadDoc.
CLASS: DrawPadDoc
PURPOSE: This class keep track of all the shapes and provide methods to manipulate them
IMPORT: java.awt.Graphics, java.util.Vector, java.awt.Color, DrawableShape, Point
EXPORT: New Class|DrawPadDoc
New Method|DrawPadDoc, addShape, copySelectedShape, deleteSelectedShape, drawAllShapes, getSelectedShapeColor, moveSelectedPointBox, moveSelectedShapeToBack, moveSelectedShapeToFront, moveShape, pasteShape, selectNextShape, selectPointBox, selectedPreviousShape, selectShape, setSelectedShapeColor, setShapeEndPoint, unSelectShape
DrawPadDoc() - Constructor for class DrawPadDoc

PRE: None
POST: Construct and initialize the DrawPadDoc Object
DrawPadView - class DrawPadView.
CLASS: DrawPadView
PURPOSE: This class handle all the GUI action and this is also the main class for the applet
IMPORT: java.awt.Color, java.applet.Applet, java.awt.Graphics, java.awt.Image, java.awt.event.MouseEvent, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, java.awt.event.KeyEvent, Ellipse, Rectangle, Line, Polygon, DrawableShape, DrawPadDoc, Point
EXPORT: New Class|DrawPadView
New Method| init, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, setSelectedColor, update, drawBorder, drawColorBar, drawCurrentColor, drawOptionBar
DrawPadView() - Constructor for class DrawPadView
 
drawWidth - Variable in class DrawPadView
Drawing area width.

E

Ellipse - class Ellipse.
CLASS: Ellipse
PURPOSE: This class represent one of the shapes that can be drawn -- Ellipse
IMPORT: java.awt.Graphics, java.awt.Color, DrawableShape, Point
EXPORT: New Class|Ellipse
New Method| Ellipse, copyClone, hitTest, hitTestPointBox, paint
Ellipse(Point, Point) - Constructor for class Ellipse

PRE: None
POST: Initialize all the variables needed for Ellipse shape
endPoint - Variable in class DrawPadView
keep track of the last point

G

getColor() - Method in class DrawableShape

PRE: None
POST: Return the color of the shape
getLeastX() - Method in class DrawableShape

PRE: None
POST: Return the least value for x in the point list
getLeastY() - Method in class DrawableShape

PRE: None
POST: Return the least value for y in the point list
getSelectedShapeColor() - Method in class DrawPadDoc

PRE: None
POST: Return the color of the selectedShape color, if no shape is selected, it will return null

H

HALF_IMAGE_SIZE - Variable in class DrawPadView
Constant for half image size in pixel.
hitTest(Point) - Method in class DrawableShape

PRE: A valid Point Object
POST: Check to see if the point hit the shape
hitTest(Point) - Method in class Ellipse

PRE: A valid Point Object
POST: Check to see if the point hit the shape
hitTest(Point) - Method in class Line

PRE: A valid Point Object
POST: Check to see if the point hit the shape
hitTest(Point) - Method in class Polygon

PRE: A valid Point Object
POST: Check to see if the point hit the shape
hitTest(Point) - Method in class Rectangle

PRE: A valid Point Object
POST: Check to see if the point hit the shape
hitTestPointBox(Point) - Method in class DrawableShape

PRE: A valid Point object
POST: Return true if the point hit the Point Box
hitTestPointBox(Point) - Method in class Ellipse

PRE: A valid Point Object
POST: Check to see if the point hit the shape's PointBox if it has been selected
hitTestPointBox(Point) - Method in class Line

PRE: A valid Point Object
POST: Check to see if the point hit the shape's PointBox if it has been selected
hitTestPointBox(Point) - Method in class Polygon

PRE: A valid Point Object
POST: Check to see if the point hit the shape's PointBox if it has been selected
hitTestPointBox(Point) - Method in class Rectangle

PRE: A valid Point Object
POST: Check to see if the point hit the shape's PointBox if it has been selected

I

IMAGE_DOWN - Variable in class DrawPadView
Constant to indicate the image is in down-state
IMAGE_SIZE - Variable in class DrawPadView
Constant for the image size in pixel.
IMAGE_UP - Variable in class DrawPadView
Constant to indicate the image is in up-state
imageDirectory - Variable in class DrawPadView
Constant for the path that the image files is in
imageNames - Variable in class DrawPadView
Name of the option image files (upstate and downstate)
init() - Method in class DrawPadView

PRE: None
POST: Initialize all the variables and GUI for the applet

K

keyPressed(KeyEvent) - Method in class DrawPadView

PRE: A valid KeyEvent Object
POST: Perform editing functionality.
keyReleased(KeyEvent) - Method in class DrawPadView

PRE: A valid KeyEvent Object
POST: This method was override from the interface KeyListener.
keyTyped(KeyEvent) - Method in class DrawPadView

PRE: A valid KeyEvent Object
POST: This method was override from the interface KeyListener.

L

Line - class Line.
CLASS: Line
PURPOSE: This class represent one of the shapes that can be drawn -- Line
IMPORT: java.awt.Graphics, java.awt.Color, DrawableShape, Point
EXPORT: New Class|Line
New Method| copyClone, hitTest, hitTestPointBox, paint
Line() - Constructor for class Line
 

M

mouseClicked(MouseEvent) - Method in class DrawPadView

PRE: A valid MouseEvent Object
POST: This method was override from the interface MouseListener.
mouseDragged(MouseEvent) - Method in class DrawPadView

PRE: A valid MouseEvent Object
POST: Show rubber band effect and perform editing functionality.
mouseEntered(MouseEvent) - Method in class DrawPadView

PRE: A valid KeyEvent Object
POST: This method was override from the interface MouseMotionListener.
mouseExited(MouseEvent) - Method in class DrawPadView

PRE: A valid KeyEvent Object
POST: This method was override from the interface MouseMotionListener.
mouseMoved(MouseEvent) - Method in class DrawPadView

PRE: A valid MouseEvent Object
POST: For rubber band effect when drawing object.
mousePressed(MouseEvent) - Method in class DrawPadView

PRE: A valid MouseEvent Object
POST: Set all the flags needed.
mouseReleased(MouseEvent) - Method in class DrawPadView

PRE: A valid MouseEvent Object
POST: Set all the flags needed.
move(int, int) - Method in class DrawableShape

PRE: None
POST: Move the shape offset by the input x and y
movePointBox(int, int) - Method in class DrawableShape

PRE: None
POST: Resize the shape by offset the reference point(s) by the input x and y
moveSelectedPointBox(int, int) - Method in class DrawPadDoc

PRE: None
POST: Move the point box of the selected shape object
moveSelectedShapeToBack() - Method in class DrawPadDoc

PRE: None
POST: Move the selected shape one object to the back.
moveSelectedShapeToFront() - Method in class DrawPadDoc

PRE: None
POST: Move the selected shape one object to the front.
moveShape(int, int) - Method in class DrawPadDoc

PRE: None
POST: Move the selected Shape of the input offsets

O

OPT_ELLIPSE - Variable in class DrawPadView
Constant for Ellipseect Option
OPT_FILLED_ELLIPSE - Variable in class DrawPadView
Constant for Filled Ellipse Option
OPT_FILLED_POLYGON - Variable in class DrawPadView
Constant for Filled Polygon Option
OPT_FILLED_RECTANGLE - Variable in class DrawPadView
Constant for Filled Rectangle Option
OPT_LINE - Variable in class DrawPadView
Constant for Line Option
OPT_POLYGON - Variable in class DrawPadView
Constant for Polygon Option
OPT_RECTANGLE - Variable in class DrawPadView
Constant for Rectangle Option
OPT_SELECT - Variable in class DrawPadView
Constant for Select Option
optionImages - Variable in class DrawPadView
array to contain the images for options

P

paint(Graphics) - Method in class DrawableShape

PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
paint(Graphics) - Method in class DrawPadView

PRE: A valid Graphics Object
POST: Will have drawPadDoc draw all its shape and also draw the current shape if we are doing Add shape.
paint(Graphics) - Method in class Ellipse

PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
paint(Graphics) - Method in class Line

PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
paint(Graphics) - Method in class Polygon

PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
paint(Graphics) - Method in class Rectangle

PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
pasteShape() - Method in class DrawPadDoc

PRE: NoneBR> POST: If there is a copied shape, will add it to the last in the list and place it to the top left corner and return true.
Point - class Point.
CLASS: Point
PURPOSE: This class represent a point that contain an x y components (both int)
IMPORT: None
EXPORT: New Class|Point
New Methods|Point,copyClone
Point(int, int) - Constructor for class Point

PRE: None
POST: Construct and initialize a Point object
pointList - Variable in class DrawableShape
Vector to keep track of the shapes point(s)
Polygon - class Polygon.
CLASS: Polygon
PURPOSE: This class represent one of the shapes that can be drawn -- Polygon
IMPORT: java.awt.Graphics, java.awt.Color, DrawableShape, Point
EXPORT: New Class|Polygon
New Method| copyClone, hitTest, hitTestPointBox, paint
Polygon() - Constructor for class Polygon
 

R

Rectangle - class Rectangle.
CLASS: Rectangle
PURPOSE: This class represent one of the shapes that can be drawn -- Rectangle
IMPORT: java.awt.Graphics, java.awt.Color, DrawableShape, Point
EXPORT: New Class|Rectangle
New Method| Rectangle, copyClone, hitTest, hitTestPointBox, paint
Rectangle(Point, Point) - Constructor for class Rectangle

PRE: None
POST: Initialize all the variables needed for Rectangle shape
removeLastPoint() - Method in class DrawableShape

PRE: None
POST: Remove the last point from the point list (if any)

S

selectedColor - Variable in class DrawPadView
Color that has been selected
selectedOption - Variable in class DrawPadView
Option that has been selected
selectedShape - Variable in class DrawPadDoc
The shape that is being selected
selectNextShape() - Method in class DrawPadDoc

PRE: None
POST: Select the next shape in the list.
selectPointBox(Point) - Method in class DrawPadDoc

PRE: None
POST: Check if the point in the pointbox of the selecetd shape.
selectPreviousShape() - Method in class DrawPadDoc

PRE: None
POST: Select the previous shape in the list.
selectShape(Point) - Method in class DrawPadDoc

PRE: A valid point
POST: Go through the shape list from the top(LIFO) and do hit test on the shape.
setColor(Color) - Method in class DrawableShape

PRE: A valid Color Object
POST: Set the color of the shape from the input
setEndPoint(Point) - Method in class DrawableShape

PRE: A valid Point Object
POST: Set the endPoint of the shape from the input
setFill(boolean) - Method in class DrawableShape

PRE: None
POST: Set the private variable bFill as the input
setSelected(boolean) - Method in class DrawableShape

PRE: None
POST: Set the shape flag to indicate whether it has been selected or not
setSelectedColor(Color) - Method in class DrawPadView

PRE: A valid Color Object
POST: set and update the color bar to the input color
setSelectedShapeColor(Color) - Method in class DrawPadDoc

PRE: A valid Color object
POST: Set the selected Shape's color from the input color object only if there is a selected shape
setShapeEndPoint(Point) - Method in class DrawPadDoc

PRE: A valid Point object
POST: Set the endPoint of the select shape as the input, solely for Resizing
setStartPoint(Point) - Method in class DrawableShape

PRE: A valid Point Object
POST: Set the startPoint of the shape from the input
shapeList - Variable in class DrawPadDoc
A vector list containing shapes

U

unSelectShape() - Method in class DrawPadDoc

PRE: None
POST: Don't keep track of the selected object
update(Graphics) - Method in class DrawPadView

PRE: A valid Graphics Object
POST: Will have drawPadDoc draw all its shape and also draw the current shape if we are doing Add shape.

X

x - Variable in class Point
x component of a point
xPointChange - Variable in class DrawableShape
Reference Point object for resize change(X component)

Y

y - Variable in class Point
y component of a point
yPointChange - Variable in class DrawableShape
Reference Point object for resize change(Y component)

A B C D E G H I K L M O P R S U X Y