|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecthexIT.Hexagon
A hexagon object represents a particular tile on a board of hexagons. The board type is independent of the implementation found here: hexagons have 6 sides no matter what arrangement they are placed in.
Field Summary | |
static int |
COORDNUM_BOTTOM
|
static int |
COORDNUM_BOTTOMLEFT
|
static int |
COORDNUM_BOTTOMRIGHT
|
static int |
COORDNUM_TOP
|
static int |
COORDNUM_TOPLEFT
|
static int |
COORDNUM_TOPRIGHT
|
Constructor Summary | |
Hexagon(int new_hexX,
int new_hexY)
Creates a hexagon with hexagonal coordinates (new_hexX, new_hexY). |
Method Summary | |
boolean |
equals(java.lang.Object o)
Returns true if the object that's passed-in is a Hexagon and has the same hexagonal coordinates as this Hexagon. |
java.awt.Color |
getBorderColor()
Returns the current border color of this hexagon. |
java.awt.Color |
getFillColor()
Gets the fill color of this hexagon. |
int |
getHexX()
Get this hexagon's hexagonal X coordinate, where the coordinate system is defined by the board that created this hexagon. |
int |
getHexY()
Get this hexagon's hexagonal Y coordinate, where the coordinate system is defined by the board that created this hexagon. |
int |
getMidPixelX()
Get the x coordinate of the pixel at the center of this hexagon. |
int |
getMidPixelY()
Get the y coordinate of the pixel at the center of this hexagon. |
Drawable |
getObj()
Return the object on this hexagon, or null if there is none. |
java.awt.Color |
getOutlineColor()
Gets the outline line color of this hexagon. |
int |
getPixelX(int coord_num)
Get the x coordinate of the pixel attached to the coordinate number of the vertex of this hexagon. |
int |
getPixelY(int coord_num)
Get the y coordinate of the pixel attached to the coordinate number of the vertex of this hexagon. |
boolean |
hasFill()
Returns true if this hexagon has a fill color, false otherwise. |
boolean |
hasOutline()
Returns true if this hexagon has an outline, false otherwise. |
boolean |
isOccupied()
Returns true if there is an object on this hexagon, false otherwise. |
boolean |
isVisible()
Returns true if this hexagon is visible, false otherwise. |
void |
putObj(Drawable newObj)
Places the specified drawable object onto this hex. |
void |
removeFill()
Removes the fill from this hexagon. |
void |
removeObj()
Remove the object on this hexagon. |
void |
removeOutline()
Remove the outline from this hexagon. |
void |
scaleObjImage(int new_width,
int new_height)
Scales the object on this hexagon to the specified new pixel values. |
void |
setBorderColor(java.awt.Color new_color)
Set the border line color of this hexagon. |
void |
setVisible(boolean new_visible)
Toggles the visibility of this hexagon. |
boolean |
surroundsPixel(int x,
int y)
Returns true if the specified pixel with coordinates (x,y) lie inside this hexagon. |
java.lang.String |
toString()
Returns the coordinates string of this hexagon. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int COORDNUM_TOP
public static final int COORDNUM_TOPRIGHT
public static final int COORDNUM_BOTTOMRIGHT
public static final int COORDNUM_BOTTOM
public static final int COORDNUM_BOTTOMLEFT
public static final int COORDNUM_TOPLEFT
Constructor Detail |
public Hexagon(int new_hexX, int new_hexY)
Method Detail |
public int getHexX()
public int getHexY()
public int getPixelX(int coord_num)
public int getPixelY(int coord_num)
public int getMidPixelX()
public int getMidPixelY()
public void putObj(Drawable newObj)
public Drawable getObj()
public boolean isOccupied()
public void scaleObjImage(int new_width, int new_height)
public void removeObj()
public void setBorderColor(java.awt.Color new_color)
public java.awt.Color getBorderColor()
public java.awt.Color getOutlineColor()
public boolean hasOutline()
public void removeOutline()
public boolean surroundsPixel(int x, int y)
public java.awt.Color getFillColor()
public boolean hasFill()
public void removeFill()
public void setVisible(boolean new_visible)
public boolean isVisible()
public boolean equals(java.lang.Object o)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |