Package VASSAL.build.module.turn
Class TurnLevel
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.turn.TurnComponent
VASSAL.build.module.turn.TurnLevel
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,PropertyNameSource,ValidityChecker,Translatable
- Direct Known Subclasses:
CounterTurnLevel,ListTurnLevel
public abstract class TurnLevel extends TurnComponent
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTurnLevel.TurnFormatConfigNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
Fields Modifier and Type Field Description protected ComponentchildSetControlsprotected intcurrentprotected intcurrentSubLevelprotected static StringLEVEL_VALUEprotected JPanellevelSetControlsprotected MutableProperty.ImplmyValueprotected static StringNAMEprotected TurnComponentparentprotected static StringPROPprotected StringpropertyNameprotected booleanrolledOverprotected JDialogsetDialogprotected intstartprotected booleansubLevelRolledOverprotected TurnTrackerturnprotected static StringTURN_FORMATprotected FormattedStringturnFormatFields inherited from class VASSAL.build.module.turn.TurnComponent
levelsFields 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 TurnLevel() -
Method Summary
Modifier and Type Method Description protected voidaddChildControls()voidaddTo(Buildable parent)Adds this component to its parent.protected voidadvance()protected voidbuildConfigMenu(JMenu menu)voidfindMaximumStrings(List<String> levels, int currentLevel)List<TurnLevel>getActiveChildLevels()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 elementprotected JMenugetConfigMenu()ComponentI18nDatagetI18nData()protected StringgetLongestFormattedValue()protected abstract StringgetLongestValueName()List<String>getPropertyNames()Implement PropertyNameSource - Expose the name of this level propertyprotected abstract ComponentgetSetControl()protected ComponentgetSetControls(JDialog dialog, TurnTracker turn)protected abstract StringgetState()protected TurnTrackergetTurn()StringgetTurnString()protected abstract StringgetValueString()protected booleanhasRolledOver()protected booleanhasSubLevelRolledOver()protected booleanisActive()booleanisConfigurable()voidremoveFrom(Buildable parent)Remove this component from its parentprotected voidreset()protected voidretreat()voidsetAttribute(String key, Object value)Sets a buildFile (XML) attribute value for this component.protected voidsetHigh()protected voidsetLow()protected voidsetRolledOver(boolean b)protected abstract voidsetState(String code)Methods inherited from class VASSAL.build.module.turn.TurnComponent
addLevel, getHelpFile, getTurnLevel, getTurnLevelCount, getTurnLevels, removeLevelMethods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getAttributeVisibility, getConfigureComponents, getConfigureName, getConfigurer, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, 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
-
NAME
- See Also:
- Constant Field Values
-
PROP
- See Also:
- Constant Field Values
-
TURN_FORMAT
- See Also:
- Constant Field Values
-
LEVEL_VALUE
- See Also:
- Constant Field Values
-
turn
-
setDialog
-
levelSetControls
-
childSetControls
-
parent
-
propertyName
-
start
protected int start -
current
protected int current -
currentSubLevel
protected int currentSubLevel -
subLevelRolledOver
protected boolean subLevelRolledOver -
rolledOver
protected boolean rolledOver -
myValue
-
turnFormat
-
-
Constructor Details
-
TurnLevel
public TurnLevel()
-
-
Method Details
-
getState
-
setState
-
getValueString
-
getLongestValueName
-
getSetControl
-
findMaximumStrings
-
getLongestFormattedValue
-
hasSubLevelRolledOver
protected boolean hasSubLevelRolledOver() -
isActive
protected boolean isActive() -
reset
protected void reset() -
advance
protected void advance() -
retreat
protected void retreat() -
getTurnString
-
getActiveChildLevels
-
buildConfigMenu
-
getConfigMenu
-
isConfigurable
public boolean isConfigurable() -
getSetControls
-
addChildControls
protected void addChildControls() -
getTurn
-
setRolledOver
protected void setRolledOver(boolean b) -
hasRolledOver
protected boolean hasRolledOver() -
setLow
protected void setLow() -
setHigh
protected void setHigh() -
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- Overrides:
getAttributeDescriptionsin classTurnComponent- 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- Overrides:
getAttributeTypesin classTurnComponent
-
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- Overrides:
getAttributeNamesin classTurnComponent- 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- Overrides:
setAttributein classTurnComponent- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()value- 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()
-
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- Overrides:
getAttributeValueStringin classTurnComponent- 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).
-
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.- Specified by:
addToin interfaceBuildable- Overrides:
addToin classTurnComponent
-
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable- Overrides:
removeFromin classTurnComponent
-
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- Overrides:
getAllowableConfigureComponentsin classTurnComponent
-
getI18nData
- Specified by:
getI18nDatain interfaceTranslatable- Overrides:
getI18nDatain classAbstractConfigurable- Returns:
- the i18n data for this component
-
getPropertyNames
Implement PropertyNameSource - Expose the name of this level property- Specified by:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classAbstractBuildable- Returns:
- Default implementation of PropertyNameSource - No properties exposed
-