Package VASSAL.build.module.map
Class MapCenterer
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.module.map.MapCenterer
- All Implemented Interfaces:
MouseListener,EventListener,Buildable,PropertyNameSource,ValidityChecker
public class MapCenterer extends AbstractBuildable implements MouseListener
Centers the map when user right-clicks on an empty hex
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MapCenterer() -
Method Summary
Modifier and Type Method Description voidaddTo(Buildable b)Adds this component to its parent.protected PieceFindercreatePieceFinder()When the user right-clicks on the Map, the view will center on the location of the click unless thisPieceFinderlocates a piece there.String[]getAttributeNames()StringgetAttributeValueString(String attName)Return a String representation of the attribute with the given name.voidmouseClicked(MouseEvent e)voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)voidsetAttribute(String attName, Object value)Sets an attribute value for this component.Methods inherited from class VASSAL.build.AbstractBuildable
add, build, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponentsOf, getPropertyNames, validate
-
Constructor Details
-
MapCenterer
public MapCenterer()
-
-
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. -
createPieceFinder
When the user right-clicks on the Map, the view will center on the location of the click unless thisPieceFinderlocates a piece there.- Returns:
-
getAttributeNames
- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all attribute names for this component
-
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:
attName- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
-
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:
attName- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-