Class Board.DemoAdapter

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by Board.DemoAdapter
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener
Enclosing class:
Board

public class Board.DemoAdapter
extends java.awt.event.MouseAdapter

This nested class is to allow the use of the MouseAdapter class Extends MouseAdapter public


Constructor Summary
Board.DemoAdapter()
           
 
Method Summary
 void mouseDragged(java.awt.event.MouseEvent e)
          This method sets the draggedPiece to follow the mouse and calls repaint().
 void mouseMoved(java.awt.event.MouseEvent e)
          This method sets the draggedPiece to follow the mouse and calls repaint() only if the player is forced to multi-jump.
 void mousePressed(java.awt.event.MouseEvent e)
          This method is used to identify the location of the mouse click in relation to the board in general if there is a Piece at this location it becomes the draggedPiece public
 void mouseReleased(java.awt.event.MouseEvent e)
          This method determines where the mouse is released.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mouseWheelMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Board.DemoAdapter

public Board.DemoAdapter()
Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
This method is used to identify the location of the mouse click in relation to the board in general if there is a Piece at this location it becomes the draggedPiece public

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class java.awt.event.MouseAdapter
Parameters:
e - Instance of MouceEvent

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
This method sets the draggedPiece to follow the mouse and calls repaint(). public

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class java.awt.event.MouseAdapter
Parameters:
e - Instance of MouseEvent

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
This method sets the draggedPiece to follow the mouse and calls repaint() only if the player is forced to multi-jump. public

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class java.awt.event.MouseAdapter
Parameters:
e - Instance of MouseEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
This method determines where the mouse is released. If the Checker is released outside of the board it returns it to the original square. It coordinates calls to the methods playerMustJump, moveIsValid and executeMove. public

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class java.awt.event.MouseAdapter
Parameters:
e - Instance of MouseEvent