|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SolitaireReleasedAdapter | +--heineman.klondike.WastePileController
Controls all actions regarding the WastePile.
In an earlier version of this controller, the CardView object returned by the PileView
object was converted into a ColumnView to make it easier to process Release requests
throughout the system. Unfortunately, this negated the usefulness of returnWidget
because this method for a PileView only accepted CardView
objects. This
leads the the following controller design principle: Never change the type of the object
extracted from a Widget because then NO OTHER CONTROLLER will be able to use returnWidget.
Thus, the alternative we must choose is to have all other controllers check the type of
the dragging object, and if it is a CardView, then it is understood to be coming from
the wastePile; these controllers will be slightly more complicated, but the logic can
easily be localized, and returnWidget
is not affected.
Field Summary | |
protected PileView |
src
The specific WastePileView being controlled. |
protected Klondike |
theGame
The Klondike Game. |
Constructor Summary | |
WastePileController(Klondike theGame,
PileView waste)
WastePileController 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Klondike theGame
protected PileView src
Constructor Detail |
public WastePileController(Klondike theGame, PileView waste)
Method Detail |
public void mouseClicked(java.awt.event.MouseEvent me)
me
- java.awt.event.MouseEventpublic void mousePressed(java.awt.event.MouseEvent me)
me
- java.awt.event.MouseEvent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |