|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Polygon
rl.common.mapping.PlanetHexagon
public class PlanetHexagon
Title: Legatus
Copyright: Copyright Daniel Cleyne (c) 2004-2006
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
| Field Summary | |
|---|---|
protected java.util.Vector<PlanetHexagon> |
m_Offsets
|
(package private) static long |
serialVersionUID
|
| Fields inherited from class java.awt.Polygon |
|---|
bounds, npoints, xpoints, ypoints |
| Constructor Summary | |
|---|---|
PlanetHexagon()
|
|
PlanetHexagon(int xOffset,
int yOffset)
|
|
| Method Summary | |
|---|---|
void |
addOffset(int xOffset,
int yOffset)
|
void |
addOffset(java.awt.Point offset)
|
void |
draw(java.awt.Graphics comp)
|
void |
draw(java.awt.Graphics comp,
java.lang.String label)
|
boolean |
equals(java.lang.Object o)
|
void |
fill(java.awt.Graphics comp)
|
java.awt.Rectangle |
getBounds()
|
java.awt.Point |
getCenter()
|
static int |
getHeight()
|
java.awt.Point |
getHexSideEndPoint(int hexSide)
|
java.awt.Point |
getHexSideMidPoint(int hexSide)
Returns the point that represents the 'mid' point fo a hex side. |
java.awt.Point |
getHexSideStartPoint(int hexSide)
Returns the point the represents the 'start' point fo a hex side. |
PlanetHexagon |
getOffset(int index)
|
PlanetHexagon |
getOffsetHex(int index)
|
static int |
getWidth()
|
static int |
getXIncrement()
|
static int |
getYIncrement()
|
int |
hashCode()
|
boolean |
isIntersectedBy(int x0,
int y0,
int x1,
int y1)
Returns true if this hex is intersected by the line Changed arguments to int : DC |
(package private) void |
offset(int XOffset,
int YOffset)
|
(package private) void |
offset(java.awt.Point aPoint)
|
void |
removeOffset(int index)
|
java.lang.String |
toString()
|
static int |
turns(int x0,
int y0,
int x1,
int y1,
int x2,
int y2)
From Megamek class IdealHex Tests whether a line intersects a point or the point passes to the left or right of the line. |
| Methods inherited from class java.awt.Polygon |
|---|
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
protected java.util.Vector<PlanetHexagon> m_Offsets
| Constructor Detail |
|---|
public PlanetHexagon()
public PlanetHexagon(int xOffset,
int yOffset)
| Method Detail |
|---|
public java.awt.Rectangle getBounds()
getBounds in interface java.awt.ShapegetBounds in class java.awt.Polygonpublic static int getWidth()
public static int getHeight()
public static int getXIncrement()
public static int getYIncrement()
void offset(java.awt.Point aPoint)
void offset(int XOffset,
int YOffset)
public java.awt.Point getCenter()
public boolean equals(java.lang.Object o)
equals in class java.lang.Object
public boolean isIntersectedBy(int x0,
int y0,
int x1,
int y1)
public static int turns(int x0,
int y0,
int x1,
int y1,
int x2,
int y2)
public java.awt.Point getHexSideStartPoint(int hexSide)
hexSide -
public java.awt.Point getHexSideEndPoint(int hexSide)
public java.awt.Point getHexSideMidPoint(int hexSide)
hexSide -
public void draw(java.awt.Graphics comp)
public void draw(java.awt.Graphics comp,
java.lang.String label)
public void fill(java.awt.Graphics comp)
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void addOffset(java.awt.Point offset)
public void addOffset(int xOffset,
int yOffset)
public void removeOffset(int index)
public PlanetHexagon getOffset(int index)
public PlanetHexagon getOffsetHex(int index)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||