|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Polygon jaige.games.hex.gui.Hexagon
public class Hexagon
A hexagon.
Field Summary |
---|
Fields inherited from class java.awt.Polygon |
---|
bounds, npoints, xpoints, ypoints |
Constructor Summary | |
---|---|
Hexagon()
|
|
Hexagon(int x,
int y,
double radius)
Create a new hexagon. |
|
Hexagon(java.awt.Point center,
double radius)
Create a new hexagon. |
Method Summary | |
---|---|
java.awt.Point |
getCenter()
|
int |
halfHeight()
Get half of the height. |
int |
halfWidth()
Get half of the width. |
int |
height()
Get the height. |
static double |
radiusForHeight(int height)
Get the radius for a hexagon with the given height. |
static double |
radiusForWidth(int width)
Get the radius for a hexagon with the given width. |
void |
scale(double scale)
Scale this hexagon. |
void |
setParameters(int x,
int y,
double radius)
|
void |
setParameters(java.awt.Point center,
double radius)
|
int |
width()
Get the width. |
Methods inherited from class java.awt.Polygon |
---|
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Hexagon()
public Hexagon(int x, int y, double radius)
x
- the x coordinate of the center point.y
- the y coordinate of the center point.radius
- the radius of the hexagon.public Hexagon(java.awt.Point center, double radius)
center
- the center point.radius
- the radius of the hexagon.Method Detail |
---|
public void setParameters(int x, int y, double radius)
public void setParameters(java.awt.Point center, double radius)
public void scale(double scale)
scale
- the scaling factor.public int halfHeight()
public int height()
public int halfWidth()
public int width()
public java.awt.Point getCenter()
public static double radiusForWidth(int width)
public static double radiusForHeight(int height)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |