Package VASSAL.build.module.map
Class MapCenterer
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.module.map.MapCenterer
- All Implemented Interfaces:
MouseListener,EventListener,Buildable,PropertyNameSource,ValidityChecker,ImageSearchTarget
Centers the map when user right-clicks on an empty hex
-
Field Summary
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds this component to its parent.protected PieceFinderWhen the user right-clicks on the Map, the view will center on the location of the click unless thisPieceFinderlocates a piece there.String[]Lists all the buildFile (XML) attribute names for this component.getAttributeValueString(String attName)voidvoidvoidvoidvoidvoidsetAttribute(String attName, Object value)Sets a buildFile (XML) attribute value for this component.Methods inherited from class VASSAL.build.AbstractBuildable
add, addImageNamesRecursively, build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validateMethods inherited from class VASSAL.search.AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNames
-
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 responsible 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
Description copied from class:AbstractBuildableLists all the buildFile (XML) attribute names for this component. If this component is ALSO anAbstractConfigurable, then this list of attributes determines the appropriate attribute order forAbstractConfigurable.getAttributeDescriptions()andAbstractConfigurable.getAttributeTypes().- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeValueString
- Specified by:
getAttributeValueStringin classAbstractBuildable- Parameters:
attName- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()- Returns:
- a String representation of the XML buildFile attribute with the given name. When initializing a module,
this String value will loaded from the XML and passed to
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object). It is also frequently used for checking the current value of an attribute.
-
setAttribute
Description copied from class:AbstractBuildableSets a buildFile (XML) 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()value- If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
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
-