|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectm865.shapepack.ShapeFactory
MyFactory
MyFactory class is a factory class which extends the ShapeFactory in the package edu.clemson.mthsc865.shapepack. It adds a Circle shape to the catalog of shapes available from the ShapeFactory superclass.
Field Summary | |
static java.lang.String |
CIRCLE
|
Fields inherited from class m865.shapepack.ShapeFactory |
ELLIPSE, RECTANGLE, SQUARE, theList |
Constructor Summary | |
MyFactory()
The generic MyFactory constructor This constructor adds additional shapes to theList |
Method Summary | |
Shape |
createShape(java.lang.String shapeName,
int x,
int y)
Creates a specified shape with a default color and a bounding box of the default size. |
Shape |
createShape(java.lang.String shapeName,
int x,
int y,
int w,
int h,
java.awt.Color c)
Creates a specified shape |
static void |
main(java.lang.String[] args)
Provides a unit test. |
java.lang.String |
toString()
Overrides: toString in class ShapeFactory |
Methods inherited from class m865.shapepack.ShapeFactory |
getTheList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String CIRCLE
Constructor Detail |
public MyFactory()
Method Detail |
public Shape createShape(java.lang.String shapeName, int x, int y, int w, int h, java.awt.Color c)
createShape
in class ShapeFactory
shapeName
- the name of the shape.x
- the horizontal coordinate of the upper left corner of the bounding box.y
- the vertical coordinate of the upper left corner of the bounding box.w
- the width of the bounding box.h
- the height of the bounding box.c
- the fill color of the shape.
public Shape createShape(java.lang.String shapeName, int x, int y)
createShape
in class ShapeFactory
shapeName
- the name of the shape.x
- the horizontal coordinate of the upper left corner of the bounding box.y
- the vertical coordinate of the upper left corner of the bounding box.
public java.lang.String toString()
toString
in class ShapeFactory
public static void main(java.lang.String[] args)
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |