Package VASSAL.counters
Class PropertySheet
java.lang.Object
VASSAL.counters.Decorator
VASSAL.counters.PropertySheet
- All Implemented Interfaces:
PropertyNameSource
,PropertySource
,EditablePiece
,GamePiece
,PropertyExporter
,StateMergeable
,TranslatablePiece
,PersistentPropertyContainer
public class PropertySheet extends Decorator implements TranslatablePiece
A Decorator class that endows a GamePiece with a dialog.
-
Field Summary
Fields Modifier and Type Field Description protected JButton
applyButton
protected Color
backgroundColor
protected int
commitStyle
protected VASSAL.counters.PropertySheet.PropertySheetDialog
frame
static String
ID
protected boolean
isUpdating
protected KeyCommand
launch
protected NamedKeyStroke
launchKeyStroke
protected String
m_definition
protected List<JComponent>
m_fields
protected String
menuName
protected String
oldState
protected Map<String,Object>
properties
protected String
state
Fields inherited from interface VASSAL.counters.PropertyExporter
LOCALIZED_NAME
Fields inherited from interface VASSAL.i18n.TranslatablePiece
PREFIX
-
Constructor Summary
Constructors Constructor Description PropertySheet()
PropertySheet(String type, GamePiece p)
-
Method Summary
Modifier and Type Method Description Rectangle
boundingBox()
The area which this GamePiece occupies when drawn at the point (0,0)void
draw(Graphics g, int x, int y, Component obs, double zoom)
Draw this GamePieceString
getDescription()
A plain-English description of this type of piecePieceEditor
getEditor()
Get the configurer for this traitHelpFile
getHelpFile()
PieceI18nData
getI18nData()
Return I18n data for this pieceObject
getLocalizedProperty(Object key)
String
getName()
The plain English name for this pieceObject
getProperty(Object key)
List<String>
getPropertyNames()
Return Property names exposed by this traitShape
getShape()
The shape of the piece from the user's viewpoint.protected KeyCommand[]
myGetKeyCommands()
String
myGetState()
String
myGetType()
returns string defining the field typesCommand
myKeyEvent(KeyStroke stroke)
The response of this trait alone to the given KeyStrokevoid
mySetState(String state)
Set just the state of this traitvoid
mySetType(String s)
Changes the "type" definition this decoration, which discards all value data and structures.Methods inherited from class VASSAL.counters.Decorator
getCommandDescription, getDecorator, getI18nData, getI18nData, getId, getInner, getInnermost, getKeyCommands, getLocalizedName, getMap, getOuter, getOutermost, getParent, getPersistentProperty, getPosition, getProperties, getState, getTranslation, getType, isSelected, keyEvent, mergeState, putOldProperties, repack, reportDataError, reportDataError, reportDataError, setId, setInner, setMap, setOldProperties, setOldProperties, setParent, setPersistentProperty, setPosition, setProperty, setSelected, setState, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface VASSAL.counters.GamePiece
getId, getLocalizedName, getMap, getParent, getPosition, getState, getType, keyEvent, setId, setMap, setParent, setPosition, setProperty, setState
Methods inherited from interface VASSAL.counters.PropertyExporter
getProperties
-
Field Details
-
ID
- See Also:
- Constant Field Values
-
oldState
-
launchKeyStroke
-
launch
-
backgroundColor
-
m_definition
-
frame
protected VASSAL.counters.PropertySheet.PropertySheetDialog frame -
applyButton
-
commitStyle
protected int commitStyle -
isUpdating
protected boolean isUpdating -
state
-
properties
-
m_fields
-
-
Constructor Details
-
PropertySheet
public PropertySheet() -
PropertySheet
-
-
Method Details
-
mySetType
Changes the "type" definition this decoration, which discards all value data and structures. Format: definition; name; keystroke- Specified by:
mySetType
in interfaceEditablePiece
-
draw
Description copied from interface:GamePiece
Draw this GamePiece -
getName
Description copied from interface:GamePiece
The plain English name for this piece -
boundingBox
Description copied from interface:GamePiece
The area which this GamePiece occupies when drawn at the point (0,0)- Specified by:
boundingBox
in interfaceGamePiece
-
getShape
Description copied from interface:GamePiece
The shape of the piece from the user's viewpoint. This defines the area in which the user must click to select or move the piece, for example. LikeGamePiece.boundingBox()
, it assumes the position is (0,0) and must be translated to the actual location where the piece is being drawn. -
myGetState
- Specified by:
myGetState
in classDecorator
- Returns:
- the state of this trait alone
- See Also:
Decorator.getState()
-
mySetState
Description copied from class:Decorator
Set just the state of this trait- Specified by:
mySetState
in classDecorator
- See Also:
Decorator.myGetState()
-
myGetType
returns string defining the field types- Specified by:
myGetType
in classDecorator
- Returns:
- the type of this trait alone
- See Also:
Decorator.getType()
-
myGetKeyCommands
- Specified by:
myGetKeyCommands
in classDecorator
- Returns:
- the commands for this trait alone
- See Also:
Decorator.getKeyCommands()
-
myKeyEvent
Description copied from class:Decorator
The response of this trait alone to the given KeyStroke- Specified by:
myKeyEvent
in classDecorator
- Parameters:
stroke
- Stroke to apply- Returns:
- Generated Command or null if no effect
- See Also:
Decorator.keyEvent(javax.swing.KeyStroke)
-
getLocalizedProperty
- Specified by:
getLocalizedProperty
in interfacePropertySource
- Overrides:
getLocalizedProperty
in classDecorator
-
getProperty
- Specified by:
getProperty
in interfaceGamePiece
- Specified by:
getProperty
in interfacePropertySource
- Overrides:
getProperty
in classDecorator
-
getDescription
Description copied from interface:EditablePiece
A plain-English description of this type of piece- Specified by:
getDescription
in interfaceEditablePiece
-
getHelpFile
- Specified by:
getHelpFile
in interfaceEditablePiece
-
getEditor
Description copied from interface:EditablePiece
Get the configurer for this trait- Specified by:
getEditor
in interfaceEditablePiece
- Overrides:
getEditor
in classDecorator
-
getI18nData
Description copied from class:Decorator
Return I18n data for this piece- Specified by:
getI18nData
in interfaceTranslatablePiece
- Overrides:
getI18nData
in classDecorator
- Returns:
- I18n data
-
getPropertyNames
Return Property names exposed by this trait- Specified by:
getPropertyNames
in interfacePropertyNameSource
- Overrides:
getPropertyNames
in classDecorator
-