Class InternetDiceButton
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.AbstractToolbarItem
VASSAL.build.module.DiceButton
VASSAL.build.module.InternetDiceButton
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,AutoConfigurable
,Buildable
,Configurable
,GameComponent
,PropertyNameSource
,CommandEncoder
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
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/interfaces inherited from class VASSAL.build.module.DiceButton
DiceButton.IconConfig, DiceButton.KeepConfig, DiceButton.ReportFormatConfig
Nested classes/interfaces inherited from class VASSAL.build.AbstractToolbarItem
AbstractToolbarItem.FormattedStringConfig
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Report format varialeprotected static DieManager
Fields inherited from class VASSAL.build.module.DiceButton
ADD_TO_TOTAL, addToTotal, BUTTON_TEXT, counts, DEPRECATED_NAME, HOTKEY, ICON, KEEP_COUNT, KEEP_DICE, KEEP_EQUAL, KEEP_GREATER, KEEP_LARGEST, KEEP_LESS, KEEP_OPTION, KEEP_SMALLEST, keepCount, keepDice, keepingDice, keepOption, keepProp, keepValue, launch, LOCK_ADD, LOCK_DICE, LOCK_PLUS, LOCK_SIDES, lockAdd, lockDice, lockPlus, lockSides, N_DICE, N_SIDES, NAME, nDice, nSides, NUMERIC_TOTAL, numericTotal, plus, PLUS, PROMPT_ALWAYS, promptAlways, property, ran, rawCounts, rawRolls, REPORT_FORMAT, REPORT_NAME, REPORT_TOTAL, reportFormat, reportTotal, RESULT, RESULT_N, SORT_DICE_RESULTS, sortDice, tooltip, TOOLTIP, totalProp
Fields inherited from class VASSAL.build.AbstractToolbarItem
CAN_DISABLE, canDisable, DISABLED_ICON, disabledIconConfig, HIDE_WHEN_DISABLED, hideWhenDisabled, PROPERTY_GATE, propertyGate, showDisabledOptions
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Expects to be added to the DieManager.Translate a String into aCommand
protected void
DR()
Ask the die manager to do our roll!Translate aCommand
into a StringClass<?>[]
This getAttributeTypes() will return the items specific to the Toolbar Button - classes extending this should add their own items as well.static String
When saving a game, each GameComponent should return aCommand
that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullprotected void
void
Remove from our parentvoid
setup
(boolean gameStarting) Notify the GameComponent that a game has started/endedMethods inherited from class VASSAL.build.module.DiceButton
addLocalImageNames, formatResult, getAllowableConfigureComponents, getAttributeDescriptions, getAttributeNames, getAttributeValueString, getAttributeVisibility, getPropertyNames, initLaunchButton, setAttribute
Methods inherited from class VASSAL.build.AbstractToolbarItem
addPropertyGateListener, addPropertyGateListener, checkDisabled, disableIfTrue, getComponent, getLaunchButton, getMenuTextList, getNamedKeyStrokeList, getNameKey, getPropertyList, isShowDisabledOptions, makeLaunchButton, propertyChange, removePropertyGateListener, setButtonTextKey, setHotKeyKey, setIconKey, setLaunchButton, setNameKey, setNamePrompt, setShowDisabledOptions, setTooltipKey
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getExpressionList, getFormattedStringList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, setAncestor, validate
Methods inherited from class VASSAL.search.AbstractImageFinder
getAllImageNames, getLocalImageNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
Methods inherited from interface VASSAL.build.Buildable
build, getBuildElement, isMandatory, isMovable, isUnique
-
Field Details
-
dieManager
-
DETAILS
-
-
Constructor Details
-
InternetDiceButton
public InternetDiceButton()
-
-
Method Details
-
getConfigureTypeName
-
getAttributeTypes
Description copied from class:AbstractToolbarItem
This getAttributeTypes() will return the items specific to the Toolbar Button - classes extending this should add their own items as well. If the "nameKey" is blank, then no "name" configure entry will be generated. Extending classes can use ArrayUtils.addAll(super.getAttributeTypes(), key1, ..., keyN), or supply their own order from scratch.- Specified by:
getAttributeTypes
in interfaceAutoConfigurable
- Overrides:
getAttributeTypes
in classDiceButton
- Returns:
- the Class for the buildFile (XML) attributes of this component. Valid classes include: String, Integer, Double, Boolean, Image,
Color, and KeyStroke, along with any class for which a Configurer exists in VASSAL.configure. The class determines, among other things,
which type of
AutoConfigurer
will be used to configure the attribute when the object is configured in the Editor.The order of classes should be the same as the order of names in
AbstractBuildable.getAttributeNames()
-
DR
-
addTo
Expects to be added to the DieManager.- Specified by:
addTo
in interfaceBuildable
- Overrides:
addTo
in classDiceButton
- Parameters:
parent
- parent Buildable to add this component to as a subcomponent.
-
initDieManager
protected void initDieManager() -
removeFrom
Description copied from class:AbstractToolbarItem
Remove from our parent- Specified by:
removeFrom
in interfaceConfigurable
- Overrides:
removeFrom
in classAbstractToolbarItem
- Parameters:
b
- parent
-
setup
public void setup(boolean gameStarting) Description copied from interface:GameComponent
Notify the GameComponent that a game has started/ended- Specified by:
setup
in interfaceGameComponent
- Overrides:
setup
in classAbstractToolbarItem
- Parameters:
gameStarting
- if true, a game is starting. If false, then a game is ending
-
getRestoreCommand
Description copied from interface:GameComponent
When saving a game, each GameComponent should return aCommand
that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null- Specified by:
getRestoreCommand
in interfaceGameComponent
- Overrides:
getRestoreCommand
in classAbstractToolbarItem
-
decode
Description copied from interface:CommandEncoder
Translate a String into aCommand
- Specified by:
decode
in interfaceCommandEncoder
-
encode
Description copied from interface:CommandEncoder
Translate aCommand
into a String- Specified by:
encode
in interfaceCommandEncoder
-
getHelpFile
- Specified by:
getHelpFile
in interfaceConfigurable
- Overrides:
getHelpFile
in classDiceButton
- Returns:
- a HelpFile describing how to use and configure * this component
-