VASSAL.build.module.map
Class MapCenterer

java.lang.Object
  |
  +--VASSAL.build.AbstractBuildable
        |
        +--VASSAL.build.module.map.MapCenterer
All Implemented Interfaces:
Buildable, java.util.EventListener, java.awt.event.MouseListener

public class MapCenterer
extends AbstractBuildable
implements java.awt.event.MouseListener

Centers the map when user right-clicks on an empty hex


Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents
 
Constructor Summary
MapCenterer()
           
 
Method Summary
 void addTo(Buildable b)
          Adds this component to its parent.
protected  PieceFinder createPieceFinder()
          When the user right-clicks on the Map, the view will center on the location of the click unless this PieceFinder locates a piece there.
 java.lang.String[] getAttributeNames()
           
 java.lang.String getAttributeValueString(java.lang.String attName)
          Return a String representation of the attribute with the given name.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setAttribute(java.lang.String attName, java.lang.Object value)
          Sets an attribute value for this component.
 
Methods inherited from class VASSAL.build.AbstractBuildable
add, build, getBuildComponents, getBuildElement, getComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapCenterer

public MapCenterer()
Method Detail

addTo

public void addTo(Buildable b)
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.

createPieceFinder

protected PieceFinder createPieceFinder()
When the user right-clicks on the Map, the view will center on the location of the click unless this PieceFinder locates a piece there.
Returns:
 

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

getAttributeValueString

public java.lang.String getAttributeValueString(java.lang.String attName)
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()

setAttribute

public void setAttribute(java.lang.String attName,
                         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()

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener