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.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name -
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()Class<?>[]getAttributeTypes()Return the Class for the attributes of this object.StringgetAttributeValueString(String key)Return a String representation of the attribute with the given name.protected JMenugetConfigMenu()ComponentI18nDatagetI18nData()Return the i18n data for this componentprotected 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 an 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, validate
-
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 class:AbstractConfigurableReturn 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 inAbstractBuildable.getAttributeNames()- Specified by:
getAttributeDescriptionsin interfaceAutoConfigurable- Overrides:
getAttributeDescriptionsin classTurnComponent
-
getAttributeTypes
Description copied from class:AbstractConfigurableReturn 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 inAbstractBuildable.getAttributeNames()- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Overrides:
getAttributeTypesin classTurnComponent
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceAutoConfigurable- Overrides:
getAttributeNamesin classTurnComponent- Returns:
- a list of all attribute names for this component
-
setAttribute
Description copied from class:AbstractBuildableSets an 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()
-
getAttributeValueString
Description copied from class:AbstractBuildableReturn a String representation of the attribute with the given name. When initializing a module, this String value will be passed toAbstractBuildable.setAttribute(java.lang.String, java.lang.Object).- 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()
-
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
Description copied from class:AbstractConfigurableReturn the i18n data for this component- Specified by:
getI18nDatain interfaceTranslatable- Overrides:
getI18nDatain classAbstractConfigurable
-
getPropertyNames
Implement PropertyNameSource - Expose the name of this level property- Specified by:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classAbstractBuildable
-