|
||||||||||
| 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.DiceButton
This component places a button into the controls window toolbar. Pressing the button generates random numbers and displays the result in the Chatter
| Nested Class Summary |
| Nested classes inherited from class VASSAL.build.AutoConfigurable |
AutoConfigurable.Util |
| Field Summary | |
static java.lang.String |
HOTKEY
|
static java.lang.String |
LABEL
|
protected LaunchButton |
launch
|
static java.lang.String |
N_DICE
|
static java.lang.String |
N_SIDES
|
protected int |
nDice
|
protected int |
nSides
|
protected int |
plus
|
static java.lang.String |
PLUS
|
static java.lang.String |
PROMPT_ALWAYS
|
protected boolean |
promptAlways
|
protected java.util.Random |
ran
|
static java.lang.String |
REPORT_TOTAL
|
protected boolean |
reportTotal
|
| 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 | |
DiceButton()
|
|
| Method Summary | |
void |
addTo(Buildable parent)
Expects to be added to a GameModule. |
protected void |
DR()
Forwards the result of the roll to the Chatter.send(java.lang.String)
method of the Chatter of the GameModule. |
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 a DiceButton are: LABEL the label of the button in the toolbar
HOTKEY the hotkey equivalent of the button
N_DICE the number of dice to roll on each button press
N_SIDES the number of sides of each die
REPORT_TOTALL If true, add the results of the dice together and report the total. |
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 |
protected java.awt.Component |
getComponent()
The component to be added to the control window toolbar |
static java.lang.String |
getConfigureTypeName()
|
HelpFile |
getHelpFile()
|
protected java.lang.String |
getReportPrefix()
The text reported before the results of the roll |
protected java.lang.String |
getReportSuffix()
The text reported after the results of the roll; |
void |
removeFrom(Buildable b)
Remove this component from its parent |
void |
setAttribute(java.lang.String key,
java.lang.Object o)
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 |
addPropertyChangeListener, getConfigureComponents, getConfigureName, 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.Buildable |
add, build, getBuildElement |
| Field Detail |
protected java.util.Random ran
protected int nSides
protected int nDice
protected int plus
protected boolean reportTotal
protected boolean promptAlways
protected LaunchButton launch
public static final java.lang.String LABEL
public static final java.lang.String N_DICE
public static final java.lang.String N_SIDES
public static final java.lang.String PLUS
public static final java.lang.String HOTKEY
public static final java.lang.String REPORT_TOTAL
public static final java.lang.String PROMPT_ALWAYS
| Constructor Detail |
public DiceButton()
| Method Detail |
public static java.lang.String getConfigureTypeName()
protected java.lang.String getReportPrefix()
protected java.lang.String getReportSuffix()
protected void DR()
Chatter.send(java.lang.String)
method of the Chatter of the GameModule. Format is
prefix+[comma-separated roll list]+suffix
public java.lang.String[] getAttributeNames()
LABEL the label of the button in the toolbar
HOTKEY the hotkey equivalent of the button
N_DICE the number of dice to roll on each button press
N_SIDES the number of sides of each die
REPORT_TOTALL If true, add the results of the dice together and report the total. Otherwise, report the individual results
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 void addTo(Buildable parent)
KeyStrokeListener
protected java.awt.Component getComponent()
public void setAttribute(java.lang.String key,
java.lang.Object o)
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 java.lang.Class[] getAllowableConfigureComponents()
Configurable
public void removeFrom(Buildable b)
Configurable
public HelpFile getHelpFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||