ks.common.view
Class BuildablePileView

java.lang.Object
  extended byks.common.view.Widget
      extended byks.common.view.BuildablePileView
All Implemented Interfaces:
ElementListener

public class BuildablePileView
extends Widget

Visually represents a BuildablePile element on the screen. A BuildablePile is a Model Element that contains a pile of cards face down, and then a face up card that can be built into a column.

Cards are extracted from a BuildablePileView as ColumnView widgets; thus a single card pulled off a BuildablePileView is still a ColumnView.

returnWidget(Widget w) returns the dragged widget back to its source.


Constructor Summary
BuildablePileView(Element me)
          BuildablePileView constructor comment.
 
Method Summary
 ColumnView getColumnView(java.awt.event.MouseEvent me)
          If the MouseEvent falls on a faceup card for this BuildablePileView, remove the Column and return a ColumnView widget to manage the Column as it is dragged on the screen.
 void redraw()
          Redraw a buildable pile.
 boolean returnWidget(Widget w)
          Return the ColumnView widget's model element back onto the underlying BuildablePile.
 
Methods inherited from class ks.common.view.Widget
getBounds, getCardImages, getContainer, getHeight, getImage, getModelElement, getMouseManager, getName, getWidth, getX, getXY, getY, inBounds, isDirty, modelChanged, paint, paint, paint, refresh, refresh, setBounds, setBounds, setContainer, setDirty, setHeight, setImage, setMouseAdapter, setMouseManager, setMouseMotionAdapter, setName, setUndoAdapter, setWidth, setX, setXY, setY, toString, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BuildablePileView

public BuildablePileView(Element me)
BuildablePileView constructor comment.

Parameters:
me - ks.common.model.Element
Method Detail

getColumnView

public ColumnView getColumnView(java.awt.event.MouseEvent me)
If the MouseEvent falls on a faceup card for this BuildablePileView, remove the Column and return a ColumnView widget to manage the Column as it is dragged on the screen.

If no faceup cards are available, then a null ColumnView is returned.

Note: The BuildablePile Model will be altered by this method if the mouseEvent maps to a faceup card in this model.

Parameters:
me - java.awt.event.MouseEvent

redraw

public void redraw()
Redraw a buildable pile. Note that redraw must only be called Image. The view will be a few pixels wider than a card, to be able to convey the image of how many cards are upside down in the BuildablePile.

If empty, a border outline is drawn (since v1.6.10).

Specified by:
redraw in class Widget

returnWidget

public boolean returnWidget(Widget w)
Return the ColumnView widget's model element back onto the underlying BuildablePile.

The only dragged Widget from a BuildablePileView is a ColumnView.

Overrides:
returnWidget in class Widget
Parameters:
w - ks.common.view.Widget
Returns:
boolean
Since:
V1.6.10