Package VASSAL.build.module
Class Inventory
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.Inventory
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,GameComponent,PlayerRoster.SideChangeListener,PropertyNameSource,ValidityChecker,Translatable
public class Inventory extends AbstractConfigurable implements GameComponent, PlayerRoster.SideChangeListener
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classInventory.CounterHolds static information of and a reference to a gamepiece.classInventory.CounterInventoryclassInventory.CounterNodeCounterNode for the result tree.classInventory.HotKeySenderstatic classInventory.IconConfigstatic classInventory.PieceFormatConfigprotected static classInventory.SelectorFilter to select pieces requiredstatic classInventory.SortConfigNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, nameFields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validatorFields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY -
Constructor Summary
Constructors Constructor Description Inventory() -
Method Summary
Modifier and Type Method Description voidadd(Buildable b)Set the owning translatable of this componentvoidaddTo(Buildable b)Adds this component to its parent.protected booleanenabledForPlayersSide()Class<?>[]getAllowableConfigureComponents()Return a list of valid sub-component Classes.String[]getAttributeDescriptions()Return an array of Strings describing the attributes of this object.String[]getAttributeNames()Lists all the buildFile (XML) attribute names for this component.Class<?>[]getAttributeTypes()Return the Class for the buildFile (XML) attributes of this component.StringgetAttributeValueString(String key)Called by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML elementVisibilityConditiongetAttributeVisibility(String name)By default, all attributes are visibleprotected booleangetBooleanValue(Object o)protected ComponentgetComponent()static StringgetConfigureTypeName()HelpFilegetHelpFile()CommandgetRestoreCommand()When saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullGamePiecegetSelectedCounter()protected intgetTotalValue(GamePiece p)protected ComponentinitButtons()protected ComponentinitTree()Construct an explorer like interface for the selected countersprotected TreeCellRendererinitTreeCellRenderer()protected voidinventoryToText()protected voidlaunch()protected CommandmyUndoCommand()voidremove(Buildable b)Remove a Buildable object from this objectvoidremoveFrom(Buildable b)Remove this component from its parentprotected CommandsendHotKeyToPieces(KeyStroke keyStroke)voidsetAttribute(String key, Object o)Sets a buildFile (XML) attribute value for this component.voidsetup(boolean gameStarting)Notify the GameComponent that a game has started/endedprotected voidsetupLaunch()voidsideChanged(String oldSide, String newSide)Update inventory according to change of side.Methods inherited from class VASSAL.build.AbstractConfigurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getI18nData, getI18nPrefix, getLocalizedConfigureName, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.build.Buildable
build, getBuildElement
-
Field Details
-
launch
-
results
-
tree
-
VERSION
- See Also:
- Constant Field Values
-
HOTKEY
- See Also:
- Constant Field Values
-
BUTTON_TEXT
- See Also:
- Constant Field Values
-
NAME
- See Also:
- Constant Field Values
-
ICON
- See Also:
- Constant Field Values
-
TOOLTIP
- See Also:
- Constant Field Values
-
mapSeparator
-
groupSeparator
-
FILTER
- See Also:
- Constant Field Values
-
piecePropertiesFilter
-
GROUP_BY
- See Also:
- Constant Field Values
-
groupBy
-
NON_LEAF_FORMAT
- See Also:
- Constant Field Values
-
nonLeafFormat
-
CENTERONPIECE
- See Also:
- Constant Field Values
-
centerOnPiece
protected boolean centerOnPiece -
FORWARD_KEYSTROKE
- See Also:
- Constant Field Values
-
forwardKeystroke
protected boolean forwardKeystroke -
SHOW_MENU
- See Also:
- Constant Field Values
-
showMenu
protected boolean showMenu -
SIDES
- See Also:
- Constant Field Values
-
sides
-
KEYSTROKE
- See Also:
- Constant Field Values
-
keyStroke
-
CUTBELOWROOT
- See Also:
- Constant Field Values
-
cutBelowRoot
protected int cutBelowRoot -
CUTABOVELEAVES
- See Also:
- Constant Field Values
-
cutAboveLeaves
protected int cutAboveLeaves -
LEAF_FORMAT
- See Also:
- Constant Field Values
-
pieceFormat
-
PIECE_ZOOM
- See Also:
- Constant Field Values
-
pieceZoom
protected double pieceZoom -
DRAW_PIECES
- See Also:
- Constant Field Values
-
drawPieces
protected boolean drawPieces -
FOLDERS_ONLY
- See Also:
- Constant Field Values
-
foldersOnly
protected boolean foldersOnly -
SORT_PIECES
- See Also:
- Constant Field Values
-
sortPieces
protected boolean sortPieces -
SORT_FORMAT
- See Also:
- Constant Field Values
-
sortFormat
-
ALPHA
- See Also:
- Constant Field Values
-
LENGTHALPHA
- See Also:
- Constant Field Values
-
NUMERIC
- See Also:
- Constant Field Values
-
SORT_OPTIONS
-
sortStrategy
-
SORTING
- See Also:
- Constant Field Values
-
frame
-
-
Constructor Details
-
Inventory
public Inventory()
-
-
Method Details
-
getConfigureTypeName
-
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
initTree
Construct an explorer like interface for the selected counters -
initTreeCellRenderer
-
initButtons
-
inventoryToText
protected void inventoryToText() -
getSelectedCounter
-
getComponent
-
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable
-
add
Description copied from class:AbstractConfigurableSet the owning translatable of this component- Specified by:
addin interfaceBuildable- Overrides:
addin classAbstractConfigurable
-
remove
Description copied from class:AbstractConfigurableRemove a Buildable object from this object- Specified by:
removein interfaceConfigurable- Overrides:
removein classAbstractConfigurable
-
launch
protected void launch() -
getTotalValue
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- a HelpFilte describing how to use and configure this component
-
getAllowableConfigureComponents
Description copied from interface:ConfigurableReturn 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.- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable
-
getAttributeDescriptions
Description copied from interface:AutoConfigurableReturn an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object.- Specified by:
getAttributeDescriptionsin interfaceAutoConfigurable- Specified by:
getAttributeDescriptionsin classAbstractConfigurable- Returns:
- an array of Strings describing the buildFile (XML) attributes of this component. These strings are used as prompts in the
Properties window for this object, when the component is configured in the Editor. The order of descriptions should
be the same as the order of names in
AbstractBuildable.getAttributeNames()
-
getAttributeTypes
Description copied from class:AbstractConfigurableReturn 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 ofAutoConfigurerwill 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 inAbstractBuildable.getAttributeNames()- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Specified by:
getAttributeTypesin classAbstractConfigurable
-
getAttributeNames
Description copied from class:AbstractBuildableLists all the buildFile (XML) attribute names for this component. If this component is ALSO anAbstractConfigurable, then this list of attributes determines the appropriate attribute order forAbstractConfigurable.getAttributeDescriptions()andAbstractConfigurable.getAttributeTypes().- Specified by:
getAttributeNamesin interfaceAutoConfigurable- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all buildFile (XML) attribute names for this component
-
setAttribute
Description copied from class:AbstractBuildableSets a buildFile (XML) attribute value for this component. Thekeyparameter will be one of those listed inAbstractBuildable.getAttributeNames(). If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluewill be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()- Specified by:
setAttributein interfaceAutoConfigurable- Specified by:
setAttributein interfaceTranslatable- Specified by:
setAttributein classAbstractBuildable- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()o- If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
getAttributeVisibility
Description copied from class:AbstractConfigurableBy default, all attributes are visible- Specified by:
getAttributeVisibilityin interfaceAutoConfigurable- Overrides:
getAttributeVisibilityin classAbstractConfigurable- Parameters:
name- Name (key) of one of this component's attributes- Returns:
- a
VisibilityConditionfor this attribute, or null if attribute should always be visible.
-
getBooleanValue
- Parameters:
o-
-
getAttributeValueString
Description copied from interface:AutoConfigurableCalled by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML element- Specified by:
getAttributeValueStringin interfaceAutoConfigurable- Specified by:
getAttributeValueStringin interfaceTranslatable- Specified by:
getAttributeValueStringin classAbstractBuildable- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()- Returns:
- a String representation of the attribute with the given name. When initializing a module, this String value will be passed to
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
-
getRestoreCommand
Description copied from interface:GameComponentWhen saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null- Specified by:
getRestoreCommandin interfaceGameComponent
-
setup
public void setup(boolean gameStarting)Description copied from interface:GameComponentNotify the GameComponent that a game has started/ended- Specified by:
setupin interfaceGameComponent- Parameters:
gameStarting- if true, a game is starting. If false, then a game is ending
-
setupLaunch
protected void setupLaunch() -
sideChanged
Update inventory according to change of side.- Specified by:
sideChangedin interfacePlayerRoster.SideChangeListener
-
enabledForPlayersSide
protected boolean enabledForPlayersSide() -
sendHotKeyToPieces
- Returns:
- Command which only has some text in. The actual processing is done within the pieces.
-
myUndoCommand
-