|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectks.common.view.CardImages
Responsible for returning images for cards (as well as reverse).
This class is only responsible for storing images that some other entity has created.
Calculates card size based on reverseImage.
For V1.7 moved Loading code out of this class, and into CardImagesLoader. For V2.1 removed static fields and made first-class entity.
Constructor Summary | |
CardImages()
Create CardImages object with no associated images. |
Method Summary | |
java.awt.Image |
getCardImage(Card c)
Get the card image given a Card Object. |
java.awt.Image |
getCardImage(int rank,
int suit)
Extracts the card resource based upon the name. |
java.awt.Image |
getCardReverse()
Get the reverse image for a card. |
int |
getHeight()
Return the individual height (in pixels) of each card. |
java.lang.String |
getName()
Return Name for this deck class. |
int |
getOverlap()
Overlap is roughly 23% of the cardHeight. |
int |
getWidth()
Return the width of each card. |
void |
setCardImage(Card c,
java.awt.Image img)
Used by CardImagesLoader to set the appropriate image once loaded. |
void |
setCardReverse(java.awt.Image reverseImage)
Set the reverse image for a card. |
void |
setName(java.lang.String name)
Set Name for this deck class. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CardImages()
Method Detail |
public java.awt.Image getCardImage(int rank, int suit)
rank
- the rank of the desired card.suit
- the suit of the desired card.
public java.awt.Image getCardImage(Card c)
c
- card whose image is being requested.
public java.awt.Image getCardReverse()
public int getHeight()
public java.lang.String getName()
public int getOverlap()
public int getWidth()
public void setCardImage(Card c, java.awt.Image img)
c
- the card whose image is being stored.img
- the image of the given Card object.public void setCardReverse(java.awt.Image reverseImage)
All calculations for card width, height, and offset are based on this card's dimensions.
reverseImage
- image for the reverse of a card.public void setName(java.lang.String name)
name
- deck name.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |