|
||||||||||
| 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.LOS_Thread
A class that allows the user to draw a straight line on a Map (LOS
= Line Of Sight). No automatic detection of obstacles is
performed; the user must simply observe the thread against the
image of the map. However, if the user clicks on a board with a
Grid, the thread may snap to the grid and report the
distance between endpoints of the line
| Nested Class Summary |
| Nested classes inherited from class VASSAL.build.AutoConfigurable |
AutoConfigurable.Util |
| Field Summary | |
protected java.awt.Point |
anchor
|
protected java.awt.Point |
arrow
|
static java.lang.String |
DRAW_RANGE
|
protected boolean |
drawRange
|
protected java.lang.String |
fixedColor
|
static java.lang.String |
HIDE_COUNTERS
|
protected boolean |
hideCounters
|
protected javax.swing.KeyStroke |
hotkey
|
static java.lang.String |
HOTKEY
|
static java.lang.String |
LABEL
|
protected long |
lastRelease
|
protected LaunchButton |
launch
|
static java.lang.String |
LOS_COLOR
|
protected Map |
map
|
static java.lang.String |
RANGE_BACKGROUND
|
static java.awt.Font |
RANGE_FONT
|
static java.lang.String |
RANGE_FOREGROUND
|
protected java.awt.Color |
rangeBg
|
protected java.awt.Color |
rangeFg
|
protected boolean |
retainAfterRelease
|
static java.lang.String |
SNAP_LOS
|
protected java.awt.Color |
threadColor
|
protected boolean |
visible
|
| 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 | |
LOS_Thread()
|
|
| Method Summary | |
void |
addTo(Buildable b)
Expects to be added to a Map. |
void |
draw(java.awt.Graphics g,
Map m)
|
void |
drawRange(java.awt.Graphics g,
int range)
Writes text showing the range |
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()
The attributes of an LOS_Thread are: |
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 |
Configurable[] |
getConfigureComponents()
|
java.lang.String |
getConfigureName()
The name of this Configurable Object |
static java.lang.String |
getConfigureTypeName()
|
HelpFile |
getHelpFile()
|
boolean |
isVisible()
|
protected void |
launch()
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Since we register ourselves as a MouseListener using Map.pushMouseListener(java.awt.event.MouseListener), these mouse events are received in map
coordinates |
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Since we register ourselves as a MouseMotionListener directly, these mouse events are received in component coordinates |
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
removeFrom(Buildable b)
Remove this component from its parent |
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. |
void |
setup(boolean show)
|
void |
setVisible(boolean state)
If true, draw the thread on the map |
| Methods inherited from class VASSAL.build.AbstractConfigurable |
addPropertyChangeListener, getAttributeVisibility, getConfigurer, 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.Configurable |
addPropertyChangeListener, getConfigurer, remove |
| Methods inherited from interface VASSAL.build.Buildable |
add, build, getBuildElement |
| Field Detail |
public static final java.lang.String SNAP_LOS
public static final java.lang.String LOS_COLOR
public static final java.lang.String HOTKEY
public static final java.lang.String LABEL
public static final java.lang.String DRAW_RANGE
public static final java.lang.String HIDE_COUNTERS
public static final java.lang.String RANGE_BACKGROUND
public static final java.lang.String RANGE_FOREGROUND
public static java.awt.Font RANGE_FONT
protected boolean retainAfterRelease
protected long lastRelease
protected Map map
protected LaunchButton launch
protected javax.swing.KeyStroke hotkey
protected java.awt.Point anchor
protected java.awt.Point arrow
protected boolean visible
protected boolean drawRange
protected boolean hideCounters
protected java.lang.String fixedColor
protected java.awt.Color threadColor
protected java.awt.Color rangeFg
protected java.awt.Color rangeBg
| Constructor Detail |
public LOS_Thread()
| Method Detail |
public boolean isVisible()
public void setVisible(boolean state)
public void addTo(Buildable b)
Map. Adds a button to the map
window's toolbar. Pushing the button pushes a MouseListener
onto the Map that draws the thread. Adds some entries to
preferences
addTo in interface BuildableMap.pushMouseListener(java.awt.event.MouseListener)public void removeFrom(Buildable b)
Configurable
removeFrom in interface Configurablepublic java.lang.String[] getAttributeNames()
LABEL: the label of the buttonHOTKEY: the hotkey equivalent of the buttonDRAW_RANGE: If true, draw the distance between endpoints of the threadRANGE_FOREGROUND: the color of the text when drawing the distanceRANGE_BACKGROUND: the color of the background rectangle when drawing the distanceHIDE_COUNTERS: If true, hide allGamePieces on the map when drawing the thread
getAttributeNames in interface AutoConfigurablegetAttributeNames in class AbstractBuildable
public void setAttribute(java.lang.String key,
java.lang.Object value)
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.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 setup(boolean show)
public void draw(java.awt.Graphics g,
Map m)
draw in interface Drawableprotected void launch()
public void mouseEntered(java.awt.event.MouseEvent e)
Map.pushMouseListener(java.awt.event.MouseListener), these mouse events are received in map
coordinates
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListener
public void drawRange(java.awt.Graphics g,
int range)
range - the range to display, in whatever units returned
by the MapGrid containing the threadpublic 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[] getAttributeDescriptions()
AbstractConfigurableAbstractBuildable.getAttributeNames()
getAttributeDescriptions in interface AutoConfigurablegetAttributeDescriptions in class AbstractConfigurablepublic java.lang.Class[] getAttributeTypes()
AbstractConfigurableAbstractBuildable.getAttributeNames()
getAttributeTypes in interface AutoConfigurablegetAttributeTypes in class AbstractConfigurablepublic Configurable[] getConfigureComponents()
getConfigureComponents in interface ConfigurablegetConfigureComponents in class AbstractConfigurablepublic java.lang.Class[] getAllowableConfigureComponents()
Configurable
getAllowableConfigureComponents in interface Configurable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||