public class BoardGeometry
extends java.lang.Object
This is overkill and provides a singleton instance via BoardGeometry.getBoardGeometry().
Modifier and Type | Method | Description |
---|---|---|
java.awt.geom.Ellipse2D |
diskAt(int k,
boolean isDownTriangle) |
location of a piece disk relative to the containing point
|
java.awt.Rectangle |
getBarBounds() |
the bouards of the bar relative to the board.
|
int |
getBarHeight() |
|
int |
getBarWidth() |
return the width of the bar
|
static BoardGeometry |
getBoardGeometry() |
BoardGeometry is a singleton class. |
int |
getBoardHeight() |
|
java.awt.Rectangle |
getBoardRectangle() |
get a rectangle bounding the whole baard
|
int |
getBoardWidth() |
|
double |
getDiskWidth() |
|
java.awt.Rectangle |
getPointRectangle(int pointNumber) |
get the bounding box for a point.
|
int |
getTriangleHeight() |
|
int |
getTriangleWidth() |
public double getDiskWidth()
public int getTriangleWidth()
public int getTriangleHeight()
public int getBarHeight()
public int getBarWidth()
public int getBoardWidth()
public int getBoardHeight()
public java.awt.Rectangle getBoardRectangle()
public static BoardGeometry getBoardGeometry()
BoardGeometry
is a singleton class.
Use this method to get the sole instancepublic java.awt.Rectangle getBarBounds()
public java.awt.Rectangle getPointRectangle(int pointNumber)
pointNumber
- which point?
The top left point is 24,
the top right point is 13
the bottom right point is 12
the bottom left point is 1public java.awt.geom.Ellipse2D diskAt(int k, boolean isDownTriangle)
k
- disk location, where 1 is closest to the edge of the boardisDownTriangle
- true if the point points down