VASSAL.build.module.map
Class Scroller
java.lang.Object
|
+--VASSAL.build.AbstractBuildable
|
+--VASSAL.build.module.map.Scroller
- All Implemented Interfaces:
- Buildable, java.util.EventListener, java.awt.event.KeyListener, ValidityChecker
- public class Scroller
- extends AbstractBuildable
- implements java.awt.event.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 |
static java.lang.String |
ALWAYS
|
static java.lang.String |
NEVER
|
static java.lang.String |
PROMPT
|
static java.lang.String |
USE_ARROWS
The attribute name for whether to use arrow keys
instead of number keypad. |
protected java.lang.String |
usingArrows
|
protected int |
xStep
|
protected int |
yStep
|
|
Method Summary |
void |
add(Buildable b)
Add a Buildable object to this object |
void |
addTo(Buildable parent)
Adds this component to its parent. |
java.lang.String[] |
getAttributeNames()
|
java.lang.String |
getAttributeValueString(java.lang.String name)
Return a String representation of the attribute with the given name. |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an attribute value for this component. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USE_ARROWS
public static final java.lang.String USE_ARROWS
- The attribute name for whether to use arrow keys
instead of number keypad. Should be one of ALWAYS, NEVER, or PROMPT
ALWAYS
public static final java.lang.String ALWAYS
NEVER
public static final java.lang.String NEVER
PROMPT
public static final java.lang.String PROMPT
usingArrows
protected java.lang.String usingArrows
xStep
protected int xStep
yStep
protected int yStep
Scroller
public Scroller()
addTo
public void addTo(Buildable parent)
- Description copied from interface:
Buildable
- Adds 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
public void add(Buildable b)
- Description copied from class:
AbstractBuildable
- Add a Buildable object to this object
- Overrides:
add in class AbstractBuildable
getAttributeNames
public java.lang.String[] getAttributeNames()
- Overrides:
getAttributeNames in class AbstractBuildable
- Following copied from class:
VASSAL.build.AbstractBuildable
- Returns:
- a list of all attribute names for this component
setAttribute
public void setAttribute(java.lang.String name,
java.lang.Object value)
- Description copied from class:
AbstractBuildable
- Sets an attribute value for this component. The
key
parameter will be one of those listed in AbstractBuildable.getAttributeNames().
If the value parameter is a String, it will be the
value returned by AbstractBuildable.getAttributeValueString(java.lang.String) for the same
key. If the implementing class extends
AbstractConfigurable, then value will be
an instance of the corresponding Class listed in
AbstractConfigurable.getAttributeTypes()
- Overrides:
setAttribute in class AbstractBuildable
- Following copied from class:
VASSAL.build.AbstractBuildable
- Parameters:
key - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
getAttributeValueString
public java.lang.String getAttributeValueString(java.lang.String name)
- Description copied from class:
AbstractBuildable
- Return 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).
- Overrides:
getAttributeValueString in class AbstractBuildable
- Following copied from class:
VASSAL.build.AbstractBuildable
- Parameters:
key - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressed in interface java.awt.event.KeyListener
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleased in interface java.awt.event.KeyListener
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTyped in interface java.awt.event.KeyListener