VASSAL.build.module
Class RandomTextButton
java.lang.Object
|
+--VASSAL.build.AbstractBuildable
|
+--VASSAL.build.AbstractConfigurable
|
+--VASSAL.build.module.DiceButton
|
+--VASSAL.build.module.RandomTextButton
- All Implemented Interfaces:
- AutoConfigurable, Buildable, Configurable
- public class RandomTextButton
- extends DiceButton
- Author:
- Michael Blumoehr
This component places a button into the controls window toolbar.
Pressing the button generates random numbers or strings and displays the
result in the Chatter
|
Field Summary |
static java.lang.String |
FACES
|
static java.lang.String |
NUMERIC
|
| Fields inherited from class VASSAL.build.module.DiceButton |
BUTTON_TEXT, DEPRECATED_NAME, HOTKEY, ICON, launch, N_DICE, N_SIDES, NAME, nDice, nSides, plus, PLUS, PROMPT_ALWAYS, promptAlways, ran, REPORT_TOTAL, reportTotal |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FACES
public static final java.lang.String FACES
NUMERIC
public static final java.lang.String NUMERIC
RandomTextButton
public RandomTextButton()
getConfigureTypeName
public static java.lang.String getConfigureTypeName()
DR
protected void DR()
- Forwards the result of the roll to the
Chatter.send(java.lang.String)
method of the Chatter of the GameModule. Format is
prefix+[comma-separated roll list]+suffix
- Overrides:
DR in class DiceButton
getAttributeVisibility
public VisibilityCondition getAttributeVisibility(java.lang.String name)
- Description copied from class:
AbstractConfigurable
- By default, all attributes are visible
- Overrides:
getAttributeVisibility in class DiceButton
- Following copied from class:
VASSAL.build.AbstractConfigurable
- Parameters:
name - - Returns:
-
getAttributeNames
public java.lang.String[] getAttributeNames()
- The additional Attributes of a RandomTextButton are:
FACES Text of the dice faces
must be integer if USE_FACES=NUMERIC
NUMERIC If true, then face text must be an integer,
and reportTotal is enabled
- Overrides:
getAttributeNames in class DiceButton
- 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 DiceButton
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 DiceButton
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 DiceButton
- Following copied from class:
VASSAL.build.AbstractBuildable
- Parameters:
key - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
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 DiceButton
- Following copied from class:
VASSAL.build.AbstractBuildable
- Parameters:
key - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
getHelpFile
public HelpFile getHelpFile()
- Overrides:
getHelpFile in class DiceButton
- Following copied from interface:
VASSAL.build.Configurable
- Returns:
- a HelpFilte describing how to use and configure
this component