|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectcardDeck.Card
public class Card
Represents a playing card in a deck of cards.
| Constructor Summary | |
|---|---|
Card(javax.swing.ImageIcon image,
Suit aSuit,
Face aFace,
int numericValue)
|
|
| Method Summary | |
|---|---|
void |
draw(java.awt.Graphics g,
java.awt.Component c)
Draws either face or back. |
static javax.swing.ImageIcon |
getCardBackImg()
|
Face |
getFace()
|
int |
getHeight()
|
Suit |
getSuit()
|
int |
getValue()
|
int |
getWidth()
|
int |
getX()
|
int |
getY()
|
boolean |
isInside(int x,
int y)
Given a point, it tells whether this is inside card image. |
void |
moveTo(int x,
int y)
Moves a card to a position on the screen, which is implementation dependent. |
static void |
setCardBackImg(int choice)
Set the card back image to the choice |
void |
setX(int x)
Sets x-coordinate of this card |
void |
setY(int y)
Sets the y coordinate of this card |
java.lang.String |
toString()
Prints card as a string |
void |
turnFaceDown()
Turns card face down |
void |
turnFaceUp()
Turns card face up |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Card(javax.swing.ImageIcon image,
Suit aSuit,
Face aFace,
int numericValue)
| Method Detail |
|---|
public void moveTo(int x,
int y)
x - x-coordinate of the cards positiony - y-coordinate of the cards positionpublic Suit getSuit()
public Face getFace()
public int getValue()
public int getWidth()
public int getHeight()
public int getX()
public int getY()
public void setX(int x)
x - Value of new x-coordpublic void setY(int y)
y - Value of new y-coord
public boolean isInside(int x,
int y)
public java.lang.String toString()
toString in class java.lang.Objectpublic void turnFaceUp()
public void turnFaceDown()
public static javax.swing.ImageIcon getCardBackImg()
public static void setCardBackImg(int choice)
choice - int representing image number to be used.
public void draw(java.awt.Graphics g,
java.awt.Component c)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||