heineman.klondike
Class BuildablePileController

java.lang.Object
  |
  +--java.awt.event.MouseAdapter
        |
        +--heineman.klondike.BuildablePileController
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener

public class BuildablePileController
extends java.awt.event.MouseAdapter

Controls all actions to do with mouse events over the BuildablePile widget.

Creation date: (11/10/01 8:08:51 PM)


Field Summary
protected  BuildablePileView src
          The src BuildablePileView that initiated the event.
protected  Klondike theGame
          The game that we are partly controlling.
 
Constructor Summary
BuildablePileController(Klondike theGame, BuildablePileView bpv)
          BuildablePileController constructor comment.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent me)
          Try to play the faceup card directly to the foundation.
 void mousePressed(java.awt.event.MouseEvent me)
          Coordinate reaction to the beginning of a Drag Event.
 void mouseReleased(java.awt.event.MouseEvent me)
          Coordinate reaction to the completion of a Drag Event.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theGame

protected Klondike theGame
The game that we are partly controlling.


src

protected BuildablePileView src
The src BuildablePileView that initiated the event.

Constructor Detail

BuildablePileController

public BuildablePileController(Klondike theGame,
                               BuildablePileView bpv)
BuildablePileController constructor comment.

Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Try to play the faceup card directly to the foundation.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class java.awt.event.MouseAdapter
Parameters:
me - java.awt.event.MouseEvent

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Coordinate reaction to the beginning of a Drag Event. Note: There is no way to differentiate between a press that will become part of a double click vs. a click that will be held and dragged. Only mouseReleased will be able to help us out with that one. Creation date: (10/4/01 6:05:55 PM)

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class java.awt.event.MouseAdapter
Parameters:
me - java.awt.event.MouseEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Coordinate reaction to the completion of a Drag Event.

A bit of a challenge to construct the appropriate move, because cards can be dragged both from the WastePile (as a CardView widget) and the BuildablePileView (as a ColumnView widget).

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