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, ValidityChecker
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


Inner Class Summary
static class RegularGridNumbering.F
           
static class RegularGridNumbering.LocationFormatConfig
           
static class RegularGridNumbering.R
           
static class RegularGridNumbering.T
           
 
Inner 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
           
protected  FormattedString format
           
static java.lang.String GRID_LOCATION
           
static java.lang.String H_DESCEND
           
static java.lang.String H_DRAW_OFF
           
static java.lang.String H_LEADING
           
static java.lang.String H_OFF
           
static java.lang.String H_TYPE
           
protected  boolean hDescending
           
protected  int hDrawOff
           
protected  int hLeading
           
protected  int hOff
           
protected  char hType
           
static java.lang.String LOCATION_FORMAT
           
protected  java.lang.String locationFormat
           
protected  java.beans.PropertyChangeSupport propSupport
           
static java.lang.String ROTATE_TEXT
           
protected  int rotateTextDegrees
           
protected  java.lang.String sep
           
static java.lang.String SEP
           
static java.lang.String V_DESCEND
           
static java.lang.String V_DRAW_OFF
           
static java.lang.String V_LEADING
           
static java.lang.String V_OFF
           
static java.lang.String V_TYPE
           
protected  boolean vDescending
           
protected  int vDrawOff
           
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, validator
 
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)
           
 java.awt.Point offsetLabelCenter(int x, int y, double zoom)
           
 java.awt.Point offsetLabelCenter(java.awt.Point p, double zoom)
           
 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, validate
 
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

hDescending

protected boolean hDescending

vDescending

protected boolean vDescending

visible

protected boolean visible

fontSize

protected int fontSize

color

protected java.awt.Color color

rotateTextDegrees

protected int rotateTextDegrees

hDrawOff

protected int hDrawOff

vDrawOff

protected int vDrawOff

visualizer

protected javax.swing.JComponent visualizer

locationFormat

protected java.lang.String locationFormat

format

protected FormattedString format

FIRST

public static final java.lang.String FIRST

SEP

public static final java.lang.String SEP

H_TYPE

public static final java.lang.String H_TYPE

V_TYPE

public static final java.lang.String V_TYPE

H_LEADING

public static final java.lang.String H_LEADING

V_LEADING

public static final java.lang.String V_LEADING

H_OFF

public static final java.lang.String H_OFF

V_OFF

public static final java.lang.String V_OFF

V_DESCEND

public static final java.lang.String V_DESCEND

H_DESCEND

public static final java.lang.String H_DESCEND

FONT_SIZE

public static final java.lang.String FONT_SIZE

COLOR

public static final java.lang.String COLOR

VISIBLE

public static final java.lang.String VISIBLE

ROTATE_TEXT

public static final java.lang.String ROTATE_TEXT

H_DRAW_OFF

public static final java.lang.String H_DRAW_OFF

V_DRAW_OFF

public static final java.lang.String V_DRAW_OFF

LOCATION_FORMAT

public static final java.lang.String LOCATION_FORMAT

GRID_LOCATION

public static final java.lang.String GRID_LOCATION

ALPHABET

public static final java.lang.String ALPHABET
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
Overrides:
getAttributeValueString in class AbstractBuildable
Following copied from class: VASSAL.build.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.
Overrides:
setAttribute in class AbstractBuildable
Following copied from class: VASSAL.build.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
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.

getAttributeNames

public java.lang.String[] getAttributeNames()
Overrides:
getAttributeNames in class AbstractBuildable
Following copied from interface: VASSAL.build.AutoConfigurable
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()
Overrides:
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()
Overrides:
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
Overrides:
getAttributeVisibility in class AbstractConfigurable
Following copied from class: VASSAL.build.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
Overrides:
getConfigurer in class AbstractConfigurable

getConfigureTypeName

public static java.lang.String getConfigureTypeName()

getHelpFile

public HelpFile getHelpFile()
Following copied from interface: VASSAL.build.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)

offsetLabelCenter

public java.awt.Point offsetLabelCenter(java.awt.Point p,
                                        double zoom)

offsetLabelCenter

public java.awt.Point offsetLabelCenter(int x,
                                        int y,
                                        double zoom)