Package VASSAL.build.module.map
Class Scroller
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.module.map.Scroller
- All Implemented Interfaces:
KeyListener,EventListener,Buildable,PropertyNameSource,ValidityChecker
public class Scroller extends AbstractBuildable implements KeyListener
This component listens to key events on a Map window and
scrolls the map. Depending on the USE_ARROWS attribute,
will use number keypad or arrow keys, or will offer a
preferences setting for the user to choose
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Scroller() -
Method Summary
Modifier and Type Method Description voidadd(Buildable b)Add a Buildable object to this objectvoidaddTo(Buildable parent)Adds this component to its parent.String[]getAttributeNames()StringgetAttributeValueString(String name)Return a String representation of the attribute with the given name.voidkeyPressed(KeyEvent e)voidkeyReleased(KeyEvent e)voidkeyTyped(KeyEvent e)voidsetAttribute(String name, Object value)Sets an attribute value for this component.Methods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validate
-
Field Details
-
USE_ARROWS
The attribute name for whether to use arrow keys instead of number keypad. Should be one of ALWAYS, NEVER, or PROMPT- See Also:
- Constant Field Values
-
ALWAYS
- See Also:
- Constant Field Values
-
NEVER
- See Also:
- Constant Field Values
-
PROMPT
- See Also:
- Constant Field Values
-
usingArrows
-
xStep
protected int xStep -
yStep
protected int yStep
-
-
Constructor Details
-
Scroller
public Scroller()
-
-
Method Details
-
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. -
add
Description copied from class:AbstractBuildableAdd a Buildable object to this object- Specified by:
addin interfaceBuildable- Overrides:
addin classAbstractBuildable
-
getAttributeNames
- Specified by:
getAttributeNamesin classAbstractBuildable- 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 classAbstractBuildable- Parameters:
name- 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 classAbstractBuildable- Parameters:
name- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-