VASSAL.build.module.map
Class KeyBufferer

java.lang.Object
  |
  +--java.awt.event.MouseAdapter
        |
        +--VASSAL.build.module.map.KeyBufferer
All Implemented Interfaces:
Buildable, Drawable, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class KeyBufferer
extends java.awt.event.MouseAdapter
implements Buildable, java.awt.event.MouseMotionListener, Drawable

This component listens for mouse clicks on a map. If the user clicks on a GamePiece, that piece is added to the KeyBuffer

See Also:
Map.addLocalMouseListener(java.awt.event.MouseListener)

Field Summary
protected  java.awt.Point anchor
           
protected  java.awt.Color color
           
protected  Map map
           
protected  java.awt.Rectangle selection
           
protected  int thickness
           
 
Constructor Summary
KeyBufferer()
           
 
Method Summary
 void add(Buildable b)
          Adds a child component.
 void addTo(Buildable b)
          Adds this component to its parent.
 void build(org.w3c.dom.Element e)
          Build the object
 void draw(java.awt.Graphics g, Map map)
           
 org.w3c.dom.Element getBuildElement(org.w3c.dom.Document doc)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected Map map

selection

protected java.awt.Rectangle selection

anchor

protected java.awt.Point anchor

color

protected java.awt.Color color

thickness

protected int thickness
Constructor Detail

KeyBufferer

public KeyBufferer()
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.
Specified by:
addTo in interface Buildable

add

public void add(Buildable b)
Description copied from interface: Buildable
Adds a child component. Both this method and Buildable.addTo(VASSAL.build.Buildable) are invoked when adding a child to a parent
Specified by:
add in interface Buildable

getBuildElement

public org.w3c.dom.Element getBuildElement(org.w3c.dom.Document doc)
Specified by:
getBuildElement in interface Buildable
Following copied from interface: VASSAL.build.Buildable
Returns:
an XML element from which this component can be built

build

public void build(org.w3c.dom.Element e)
Description copied from interface: Buildable
Build the object
Specified by:
build in interface Buildable
Following copied from interface: VASSAL.build.Buildable
Parameters:
e - the XML element containing the object data

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Overrides:
mousePressed in class java.awt.event.MouseAdapter

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Overrides:
mouseReleased in class java.awt.event.MouseAdapter

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

draw

public void draw(java.awt.Graphics g,
                 Map map)
Specified by:
draw in interface Drawable