|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.amoebacode.blackjack.display.DisplayManager
DisplayManager encapsulates generation of visual and audio elements.
| Field Summary | |
static java.lang.String |
BACKGROUND_IMAGE
The name of the background image |
private static java.lang.Integer |
BACKGROUND_LAYER
The pane layer used for the background image |
static java.lang.String |
BLANK_CARD_IMAGE
The name of the blank card image |
private static java.lang.Integer |
CARD_LAYER
The pane layer used for cards |
private java.util.Map |
imageMap
The collection of images, used to display backgrounds and cards |
private javax.swing.JLayeredPane |
layeredPane
The primary layered pane, which includes all visual components |
private java.util.Map |
soundMap
The collection of sounds, used for audio clip playback |
private static java.lang.Integer |
VIOLATOR_LAYER
The pane layer used for violator elements (buttons, labels, select boxes) |
| Constructor Summary | |
DisplayManager(javax.swing.JLayeredPane layeredPane,
java.util.Map soundMap,
java.util.Map imageMap)
Default public constructor. |
|
| Method Summary | |
private void |
addBackgroundComponent(java.awt.Component component)
Adds the specified component to the background layer of the primary layered pane. |
private void |
addCardComponent(java.awt.Component component)
Adds the specified component to the card layer of the primary layered pane. |
protected void |
addCardComponent(java.awt.Component component,
int position)
Adds the specified component in the specified position to the card layer of the primary layered pane. |
void |
addViolatorComponent(java.awt.Component component)
Adds the specified component to the violator layer of the primary layered pane. |
private void |
drawBackground()
Draws the background image for the primary layered pane. |
protected javax.swing.JLabel |
getBlankCardLabel()
Creates a blank card label and adds it to the card layer of the primary layered pane. |
protected javax.swing.ImageIcon |
getImage(java.lang.String imageName)
Retrieves the specified image from the images map |
protected void |
playClip(java.lang.String clipStr)
Plays the specified audio clip from the sound map. |
void |
removeComponent(java.awt.Component component)
Removes the specified component from the primary layered pane. |
protected void |
setComponentPosition(java.awt.Component component,
int position)
Sets the position of the specified component in the primary layered pane. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private javax.swing.JLayeredPane layeredPane
private java.util.Map soundMap
private java.util.Map imageMap
private static final java.lang.Integer BACKGROUND_LAYER
private static final java.lang.Integer CARD_LAYER
private static final java.lang.Integer VIOLATOR_LAYER
public static final java.lang.String BLANK_CARD_IMAGE
public static final java.lang.String BACKGROUND_IMAGE
| Constructor Detail |
public DisplayManager(javax.swing.JLayeredPane layeredPane,
java.util.Map soundMap,
java.util.Map imageMap)
layeredPane - the primary layered panesoundMap - a Map of soundsimageMap - a Map of images| Method Detail |
private void drawBackground()
protected void playClip(java.lang.String clipStr)
clipStr - the name of the clip to playprotected javax.swing.JLabel getBlankCardLabel()
protected javax.swing.ImageIcon getImage(java.lang.String imageName)
imagePath - the name of the imageprivate void addBackgroundComponent(java.awt.Component component)
component - the component to addpublic void addViolatorComponent(java.awt.Component component)
component - the component to add
protected void addCardComponent(java.awt.Component component,
int position)
component - the component to addposition - the int representing the position within the layerprivate void addCardComponent(java.awt.Component component)
component - the component to addpublic void removeComponent(java.awt.Component component)
component - the component to remove
protected void setComponentPosition(java.awt.Component component,
int position)
component - the component to updateposition - the int representing the new position within the layer
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||