Class Polygon
java.lang.Object
|
+--DrawableShape
|
+--Polygon
- public class Polygon
- extends DrawableShape
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
Method Summary |
DrawableShape |
copyClone()
PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
|
boolean |
hitTest(Point p)
PRE: A valid Point Object
POST: Check to see if the point hit the shape
|
boolean |
hitTestPointBox(Point p)
PRE: A valid Point Object
POST: Check to see if the point hit the shape's PointBox if it has been
selected
|
void |
paint(java.awt.Graphics g)
PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
|
Methods inherited from class DrawableShape |
addPoint, getColor, getLeastX, getLeastY, move, movePointBox, removeLastPoint, setColor, setEndPoint, setFill, setSelected, setStartPoint |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Polygon
public Polygon()
copyClone
public DrawableShape copyClone()
PRE: None
POST: A new DrawableShape object is copy from the current instance and returned
- Overrides:
copyClone
in class DrawableShape
hitTestPointBox
public boolean hitTestPointBox(Point p)
PRE: A valid Point Object
POST: Check to see if the point hit the shape's PointBox if it has been
selected
- Overrides:
hitTestPointBox
in class DrawableShape
paint
public void paint(java.awt.Graphics g)
PRE: A valid Graphics object to paint on
POST: Current object will be draw using the Graphics object
- Overrides:
paint
in class DrawableShape
hitTest
public boolean hitTest(Point p)
PRE: A valid Point Object
POST: Check to see if the point hit the shape
- Overrides:
hitTest
in class DrawableShape