|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--VASSAL.build.AbstractBuildable
|
+--VASSAL.build.AbstractConfigurable
|
+--VASSAL.build.module.map.boardPicker.board.HexGrid
A Hexgrid is a map grid composed of hexes.
| Nested Class Summary |
| Nested classes inherited from class VASSAL.build.module.map.boardPicker.board.MapGrid |
MapGrid.BadCoords |
| Nested classes inherited from class VASSAL.build.AutoConfigurable |
AutoConfigurable.Util |
| Field Summary | |
protected boolean |
alternate
|
protected Board |
board
|
protected java.awt.Color |
color
|
static java.lang.String |
COLOR
|
static java.lang.String |
CORNERS
|
protected boolean |
cornersLegal
|
static java.lang.String |
DOTS_VISIBLE
|
protected boolean |
dotsVisible
|
protected double |
dx
|
static java.lang.String |
DX
|
protected double |
dy
|
static java.lang.String |
DY
|
static java.lang.String |
EDGES
|
protected boolean |
edgesLegal
|
protected GridNumbering |
numbering
|
protected java.awt.Point |
origin
|
protected boolean |
sideways
|
static java.lang.String |
SIDEWAYS
|
protected boolean |
visible
|
static java.lang.String |
VISIBLE
|
static java.lang.String |
X0
|
static java.lang.String |
Y0
|
| Fields inherited from class VASSAL.build.AbstractConfigurable |
changeSupport, config, name |
| Fields inherited from class VASSAL.build.AbstractBuildable |
buildComponents |
| Fields inherited from interface VASSAL.build.Configurable |
NAME_PROPERTY |
| Constructor Summary | |
HexGrid()
|
|
HexGrid(double size,
boolean alt)
|
|
HexGrid(double height,
double width,
boolean alt)
|
|
| Method Summary | |
void |
addTo(Buildable b)
Adds this component to its parent. |
javax.swing.JPanel |
configurePanel()
|
void |
draw(java.awt.Graphics g,
java.awt.Rectangle bounds,
java.awt.Rectangle visibleRect,
double zoom,
boolean reversed)
Draw the grid |
java.lang.Class[] |
getAllowableConfigureComponents()
Return a list of valid sub-component Classes. |
java.lang.String[] |
getAttributeDescriptions()
Return an array of Strings describing the attributes of this object. |
java.lang.String[] |
getAttributeNames()
|
java.lang.Class[] |
getAttributeTypes()
Return the Class for the attributes of this object. |
java.lang.String |
getAttributeValueString(java.lang.String key)
Called by the AbstractBuildable.getBuildElement(org.w3c.dom.Document) method to write the
attributes into an XML element |
VisibilityCondition |
getAttributeVisibility(java.lang.String name)
By default, all attributes are visible |
java.lang.String |
getConfigureName()
The name of this Configurable Object |
Configurer |
getConfigurer()
The default Configurer of an AbstractConfigurable class is an instance of AutoConfigurer |
static java.lang.String |
getConfigureTypeName()
|
GridNumbering |
getGridNumbering()
|
HelpFile |
getHelpFile()
|
double |
getHexSize()
|
double |
getHexWidth()
|
java.awt.Point |
getLocation(java.lang.String hex)
|
java.awt.Point |
getOrigin()
|
protected int |
hexX(int x,
int y)
|
protected int |
hexY(int x,
int y)
|
boolean |
isCornersLegal()
|
boolean |
isEdgesLegal()
|
boolean |
isSideways()
|
boolean |
isVisible()
Whether this grid should be drawn on the map |
java.lang.String |
locationName(java.awt.Point p)
|
int |
range(java.awt.Point p1,
java.awt.Point p2)
|
void |
removeFrom(Buildable b)
Remove this component from its parent |
void |
rotate(java.awt.Point p)
|
void |
rotateIfSideways(java.awt.Point p)
|
void |
setAttribute(java.lang.String key,
java.lang.Object val)
Called by the AbstractBuildable.build(org.w3c.dom.Element) method, where value is the
String value read by the XML attribute. |
void |
setCornersLegal(boolean legal)
|
void |
setEdgesLegal(boolean legal)
|
void |
setGridNumbering(GridNumbering numbering)
|
void |
setHexSize(double size)
|
void |
setHexWidth(double w)
|
void |
setVisible(boolean legal)
|
protected int |
sideX(int x,
int y)
|
protected int |
sideY(int x,
int y)
|
java.awt.Point |
snapTo(java.awt.Point p)
|
java.awt.Point |
snapToHex(java.awt.Point p)
|
java.awt.Point |
snapToHexSide(java.awt.Point p)
|
java.awt.Point |
snapToHexVertex(java.awt.Point p)
|
protected int |
vertexX(int x,
int y)
|
protected int |
vertexY(int x,
int y)
|
| Methods inherited from class VASSAL.build.AbstractConfigurable |
addPropertyChangeListener, getConfigureComponents, remove, setConfigureName |
| Methods inherited from class VASSAL.build.AbstractBuildable |
add, build, getBuildComponents, getBuildElement, getComponents |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface VASSAL.build.Buildable |
add, build, getBuildElement |
| Field Detail |
protected java.awt.Point origin
protected double dx
protected double dy
protected Board board
protected GridNumbering numbering
protected boolean visible
protected boolean dotsVisible
protected boolean edgesLegal
protected boolean cornersLegal
protected java.awt.Color color
protected boolean sideways
public static final java.lang.String X0
public static final java.lang.String Y0
public static final java.lang.String DY
public static final java.lang.String DX
public static final java.lang.String VISIBLE
public static final java.lang.String DOTS_VISIBLE
public static final java.lang.String CORNERS
public static final java.lang.String EDGES
public static final java.lang.String SIDEWAYS
public static final java.lang.String COLOR
protected boolean alternate
| Constructor Detail |
public HexGrid(double height,
double width,
boolean alt)
public HexGrid(double size,
boolean alt)
public HexGrid()
| Method Detail |
public java.lang.String[] getAttributeNames()
getAttributeNames in interface AutoConfigurablegetAttributeNames in class AbstractBuildablepublic java.lang.String[] getAttributeDescriptions()
AbstractConfigurableAbstractBuildable.getAttributeNames()
getAttributeDescriptions in interface AutoConfigurablegetAttributeDescriptions in class AbstractConfigurablepublic java.lang.Class[] getAttributeTypes()
AbstractConfigurableAbstractBuildable.getAttributeNames()
getAttributeTypes in interface AutoConfigurablegetAttributeTypes in class AbstractConfigurablepublic VisibilityCondition getAttributeVisibility(java.lang.String name)
AbstractConfigurable
getAttributeVisibility in interface AutoConfigurablegetAttributeVisibility in class AbstractConfigurablename -
public Configurer getConfigurer()
AbstractConfigurableConfigurer of an AbstractConfigurable class is an instance of AutoConfigurer
getConfigurer in interface ConfigurablegetConfigurer in class AbstractConfigurablepublic boolean isVisible()
MapGrid
isVisible in interface MapGridpublic boolean isEdgesLegal()
public boolean isCornersLegal()
public void setVisible(boolean legal)
public void setEdgesLegal(boolean legal)
public boolean isSideways()
public void setCornersLegal(boolean legal)
public void setHexSize(double size)
public double getHexSize()
public double getHexWidth()
public void setHexWidth(double w)
public void addTo(Buildable b)
Buildable
addTo in interface Buildablepublic void removeFrom(Buildable b)
Configurable
removeFrom in interface Configurablepublic static java.lang.String getConfigureTypeName()
public java.lang.String getConfigureName()
Configurable
getConfigureName in interface ConfigurablegetConfigureName in class AbstractConfigurablepublic HelpFile getHelpFile()
getHelpFile in interface Configurablepublic java.lang.String getAttributeValueString(java.lang.String key)
AutoConfigurableBuildable.getBuildElement(org.w3c.dom.Document) method to write the
attributes into an XML element
getAttributeValueString in interface AutoConfigurablegetAttributeValueString in class AbstractBuildablekey - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
public void setAttribute(java.lang.String key,
java.lang.Object val)
AutoConfigurableBuildable.build(org.w3c.dom.Element) method, where value is the
String value read by the XML attribute.
Can also be called with Object value to set the attribute.
setAttribute in interface AutoConfigurablesetAttribute in class AbstractBuildablekey - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()public java.lang.Class[] getAllowableConfigureComponents()
Configurable
getAllowableConfigureComponents in interface Configurablepublic java.lang.String locationName(java.awt.Point p)
locationName in interface MapGrid
public java.awt.Point getLocation(java.lang.String hex)
throws MapGrid.BadCoords
getLocation in interface MapGridMapGrid.BadCoordspublic java.awt.Point snapTo(java.awt.Point p)
snapTo in interface MapGridpublic java.awt.Point snapToHex(java.awt.Point p)
public java.awt.Point snapToHexSide(java.awt.Point p)
public java.awt.Point snapToHexVertex(java.awt.Point p)
public void rotate(java.awt.Point p)
public void rotateIfSideways(java.awt.Point p)
public int range(java.awt.Point p1,
java.awt.Point p2)
range in interface MapGrid
protected int hexX(int x,
int y)
protected int hexY(int x,
int y)
protected int sideX(int x,
int y)
protected int sideY(int x,
int y)
protected int vertexX(int x,
int y)
protected int vertexY(int x,
int y)
public void draw(java.awt.Graphics g,
java.awt.Rectangle bounds,
java.awt.Rectangle visibleRect,
double zoom,
boolean reversed)
MapGrid
draw in interface MapGridbounds - the boundaries of the grid (in magnified coordinates)zoom - the magnification factorpublic javax.swing.JPanel configurePanel()
public void setGridNumbering(GridNumbering numbering)
public GridNumbering getGridNumbering()
getGridNumbering in interface MapGridpublic java.awt.Point getOrigin()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||