VASSAL.build.module.map.boardPicker.board.mapgrid
Class RegularGridNumbering

java.lang.Object
  |
  +--VASSAL.build.AbstractBuildable
        |
        +--VASSAL.build.AbstractConfigurable
              |
              +--VASSAL.build.module.map.boardPicker.board.mapgrid.RegularGridNumbering
All Implemented Interfaces:
AutoConfigurable, Buildable, Configurable, GridNumbering
Direct Known Subclasses:
HexGridNumbering, SquareGridNumbering

public abstract class RegularGridNumbering
extends AbstractConfigurable
implements GridNumbering

Abstract base class for grid numbering classes for hexagonal and rectangular grids


Nested Class Summary
static class RegularGridNumbering.F
           
static class RegularGridNumbering.T
           
 
Nested classes inherited from class VASSAL.build.AutoConfigurable
AutoConfigurable.Util
 
Field Summary
static java.lang.String ALPHABET
           
protected  java.awt.Color color
           
static java.lang.String COLOR
           
protected  char first
           
static java.lang.String FIRST
           
static java.lang.String FONT_SIZE
           
protected  int fontSize
           
static java.lang.String H_LEADING
           
static java.lang.String H_OFF
           
static java.lang.String H_TYPE
           
protected  int hLeading
           
protected  int hOff
           
protected  char hType
           
protected  java.beans.PropertyChangeSupport propSupport
           
protected  java.lang.String sep
           
static java.lang.String SEP
           
static java.lang.String V_LEADING
           
static java.lang.String V_OFF
           
static java.lang.String V_TYPE
           
protected  boolean visible
           
static java.lang.String VISIBLE
           
protected  javax.swing.JComponent visualizer
           
protected  int vLeading
           
protected  int vOff
           
protected  char vType
           
 
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
RegularGridNumbering()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener.
 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
abstract  int getColumn(java.awt.Point p)
           
 Configurer getConfigurer()
          The default Configurer of an AbstractConfigurable class is an instance of AutoConfigurer
static java.lang.String getConfigureTypeName()
           
protected abstract  javax.swing.JComponent getGridVisualizer()
          Return a component that shows how the grid will draw itself
 HelpFile getHelpFile()
           
protected  java.lang.String getName(int rowOrColumn, char type, int leading)
           
protected  java.lang.String getName(int row, int column)
           
abstract  int getRow(java.awt.Point p)
           
 boolean isVisible()
           
 java.lang.String locationName(java.awt.Point pt)
           
 void setAttribute(java.lang.String key, java.lang.Object value)
          Called by the AbstractBuildable.build(org.w3c.dom.Element) method, where value is the String value read by the XML attribute.
 
Methods inherited from class VASSAL.build.AbstractConfigurable
getConfigureComponents, getConfigureName, 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.module.map.boardPicker.board.mapgrid.GridNumbering
draw
 
Methods inherited from interface VASSAL.build.Configurable
removeFrom
 
Methods inherited from interface VASSAL.build.Buildable
add, addTo, build, getBuildElement
 

Field Detail

propSupport

protected java.beans.PropertyChangeSupport propSupport

first

protected char first

sep

protected java.lang.String sep

hType

protected char hType

vType

protected char vType

hLeading

protected int hLeading

vLeading

protected int vLeading

hOff

protected int hOff

vOff

protected int vOff

visible

protected boolean visible

fontSize

protected int fontSize

color

protected java.awt.Color color

visualizer

protected javax.swing.JComponent visualizer

FIRST

public static final java.lang.String FIRST
See Also:
Constant Field Values

SEP

public static final java.lang.String SEP
See Also:
Constant Field Values

H_TYPE

public static final java.lang.String H_TYPE
See Also:
Constant Field Values

V_TYPE

public static final java.lang.String V_TYPE
See Also:
Constant Field Values

H_LEADING

public static final java.lang.String H_LEADING
See Also:
Constant Field Values

V_LEADING

public static final java.lang.String V_LEADING
See Also:
Constant Field Values

H_OFF

public static final java.lang.String H_OFF
See Also:
Constant Field Values

V_OFF

public static final java.lang.String V_OFF
See Also:
Constant Field Values

FONT_SIZE

public static final java.lang.String FONT_SIZE
See Also:
Constant Field Values

COLOR

public static final java.lang.String COLOR
See Also:
Constant Field Values

VISIBLE

public static final java.lang.String VISIBLE
See Also:
Constant Field Values

ALPHABET

public static final java.lang.String ALPHABET
See Also:
Constant Field Values
Constructor Detail

RegularGridNumbering

public RegularGridNumbering()
Method Detail

getAttributeValueString

public java.lang.String getAttributeValueString(java.lang.String key)
Description copied from interface: AutoConfigurable
Called by the Buildable.getBuildElement(org.w3c.dom.Document) method to write the attributes into an XML element

Specified by:
getAttributeValueString in interface AutoConfigurable
Specified by:
getAttributeValueString in class AbstractBuildable
Parameters:
key - the name of the attribute. Will be one of those listed in AbstractBuildable.getAttributeNames()

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Description copied from interface: AutoConfigurable
Called by the Buildable.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.

Specified by:
setAttribute in interface AutoConfigurable
Specified by:
setAttribute in class AbstractBuildable
Parameters:
key - the name of the attribute. Will be one of those listed in AbstractBuildable.getAttributeNames()

isVisible

public boolean isVisible()
Specified by:
isVisible in interface GridNumbering

getRow

public abstract int getRow(java.awt.Point p)

getColumn

public abstract int getColumn(java.awt.Point p)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: Configurable
Add a PropertyChangeListener. A PropertyChangeEvent should be fired with property name Configurable.NAME_PROPERTY when the value returned from Configurable.getConfigureName() has changed

Specified by:
addPropertyChangeListener in interface Configurable
Overrides:
addPropertyChangeListener in class AbstractConfigurable

getAllowableConfigureComponents

public java.lang.Class[] getAllowableConfigureComponents()
Description copied from interface: Configurable
Return a list of valid sub-component Classes. If a Class appears in this list, then instances of that class may be added to this component from the Configuration Window.

Specified by:
getAllowableConfigureComponents in interface Configurable

getAttributeNames

public java.lang.String[] getAttributeNames()
Specified by:
getAttributeNames in interface AutoConfigurable
Specified by:
getAttributeNames in class AbstractBuildable
Returns:
an array of Strings giving all attributes of this Buildable component that will be written to/read from an XML element

getAttributeDescriptions

public java.lang.String[] getAttributeDescriptions()
Description copied from class: AbstractConfigurable
Return an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object. The order of descriptions should be the same as the order of names in AbstractBuildable.getAttributeNames()

Specified by:
getAttributeDescriptions in interface AutoConfigurable
Specified by:
getAttributeDescriptions in class AbstractConfigurable

getAttributeTypes

public java.lang.Class[] getAttributeTypes()
Description copied from class: AbstractConfigurable
Return the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, Color, and KeyStroke The order of classes should be the same as the order of names in AbstractBuildable.getAttributeNames()

Specified by:
getAttributeTypes in interface AutoConfigurable
Specified by:
getAttributeTypes in class AbstractConfigurable

getGridVisualizer

protected abstract javax.swing.JComponent getGridVisualizer()
Return a component that shows how the grid will draw itself


getAttributeVisibility

public VisibilityCondition getAttributeVisibility(java.lang.String name)
Description copied from class: AbstractConfigurable
By default, all attributes are visible

Specified by:
getAttributeVisibility in interface AutoConfigurable
Overrides:
getAttributeVisibility in class AbstractConfigurable
Parameters:
name -
Returns:

getConfigurer

public Configurer getConfigurer()
Description copied from class: AbstractConfigurable
The default Configurer of an AbstractConfigurable class is an instance of AutoConfigurer

Specified by:
getConfigurer in interface Configurable
Overrides:
getConfigurer in class AbstractConfigurable

getConfigureTypeName

public static java.lang.String getConfigureTypeName()

getHelpFile

public HelpFile getHelpFile()
Specified by:
getHelpFile in interface Configurable
Returns:
a HelpFilte describing how to use and configure this component

getName

protected java.lang.String getName(int row,
                                   int column)

locationName

public java.lang.String locationName(java.awt.Point pt)
Specified by:
locationName in interface GridNumbering

getName

protected java.lang.String getName(int rowOrColumn,
                                   char type,
                                   int leading)