Class LetsDrawShapes
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----LetsDrawShapes
- public class LetsDrawShapes
- extends Applet
Applet to allow user to draw circle,square,rectangle,oval,arc,freehand or Change Color
- Version:
- Java 1.1.4
- Author:
- Larry Healy CIS 525 Assignment 3
-
LetsDrawShapes()
-
-
addMyButton()
- Add the action buttons - 8 Buttons
-
init()
- Intialize applet, Includes MouseListener(change colorStatus), MouseMotionListener(DrawYourOwn)
Intialize shape dimensions and draw buttons via addMyButton
-
paint(Graphics)
- Paint the object and fill it as defined by button actions and repaint method
-
selectMyColor(Graphics)
- Select the color depending upon the color status dictated by the mouse click
LetsDrawShapes
public LetsDrawShapes()
init
public void init()
- Intialize applet, Includes MouseListener(change colorStatus), MouseMotionListener(DrawYourOwn)
Intialize shape dimensions and draw buttons via addMyButton
- Returns:
- None
- Overrides:
- init in class Applet
selectMyColor
public void selectMyColor(Graphics g)
- Select the color depending upon the color status dictated by the mouse click
- Parameters:
- g - Graphics - the current graphic object in display
- Returns:
- color is set for curent object
paint
public void paint(Graphics g)
- Paint the object and fill it as defined by button actions and repaint method
- Parameters:
- g - Graphics - the current graphic object in display
- Returns:
- selected graphic is drawn with color is set for curent object by button action
set to the default size
- Overrides:
- paint in class Container
addMyButton
public void addMyButton()
- Add the action buttons - 8 Buttons
- Returns:
- buttons are displayed that are functional and waiting to be pressed and processed by actionListener