|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IGuiPileModel
Simple interface for real views to implement. The view
set by a model's setView
method should be
stored and then updated (call the view's update
method)
when the model changes.
A model should store an id that can be anything, but might be used in a program to represent specific pile-models, e.g., "t1" or "c1" or "f3" in Freecell.
The number of cards visible in a model might be one for a foundation pile in Freecell even when the pile/model stores six cards. The max number of cards visible in such a pile/model should be one, there will only be one visible card as well.
The relationship between maximal number of displayed cards and real number of visible cards is pretty kludgey and the max idea should ultimately disappear when GUI code reaches version 1.0
Method Summary | |
---|---|
java.lang.String |
getPileID()
Return a unique id for a pile, e.g., "t1", "f1". |
IGuiCard |
getVisibleCard(int index)
Return the ith visible card. |
int |
maxVisibleCount()
Return the maximum number of cards that can be displayed. |
void |
setView(GuiPileView view)
Set view for a pile/model. |
int |
visibleCardCount()
Number of cards visible (displayed) from the model. |
Method Detail |
---|
void setView(GuiPileView view)
update
method.
view
- is the view "observing" this modelint visibleCardCount()
int maxVisibleCount()
GuiPilePanel
objects
and in redrawing them.
java.lang.String getPileID()
IGuiCard getVisibleCard(int index)
visibleCardCount()
is the last (all of it shown in a pile) card displayed.
If there are
only three cards visible, but a model stores eight, then index
zero should get the card whose real index is 5, index one gets
real index 6, and index two gets last/real index 7 card.
Cards can be visible and face down.
index
- specifies which visible card obtained from model
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |