|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mebigfatguy.polycasso.PolygonData
public class PolygonData
a class for holding the information for one polygon, including points, color and alpha level.
Constructor Summary | |
---|---|
PolygonData(java.awt.Color c,
float xpar,
java.awt.Polygon poly)
creates a polygon data structure with required information |
Method Summary | |
---|---|
java.lang.Object |
clone()
clones this polygon data data |
void |
draw(java.awt.Graphics2D g)
draws this polygondata on a specified graphics object |
float |
getAlpha()
gets the transparency of this polygon: 0.0 is transparent, 1.0 is opaque |
java.awt.Color |
getColor()
retrieves the color of this polygon |
java.awt.Polygon |
getPolygon()
retrieve the polygon (points) of this polygondata |
static PolygonData |
randomPoly(java.awt.Dimension size,
int maxPoints)
creates a totally random polygon that is limited by the specified size |
void |
setAlpha(float xpar)
sets the transparency of this polygon: 0.0 is transparent, 1.0 is opaque |
void |
setColor(java.awt.Color newColor)
sets the color of this polygon |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PolygonData(java.awt.Color c, float xpar, java.awt.Polygon poly)
c
- the color of the polygonxpar
- the alpha level of the polygonpoly
- the points of the polygonMethod Detail |
---|
public java.awt.Polygon getPolygon()
public float getAlpha()
public void setAlpha(float xpar)
xpar
- the transparency valuepublic java.awt.Color getColor()
public void setColor(java.awt.Color newColor)
newColor
- the new color to usepublic static PolygonData randomPoly(java.awt.Dimension size, int maxPoints)
size
- the maximum size of the bounding box of the polygonmaxPoints
- the maximum number of points to generate
public java.lang.Object clone()
clone
in class java.lang.Object
public void draw(java.awt.Graphics2D g)
g
- the graphics object on which to draw this polygonpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |