|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.amoebacode.blackjack.display.DisplayElement
|
+--com.amoebacode.blackjack.display.label.LabelWrapper
LabelWrapper is the base class for all text display labels.
| Field Summary | |
private static int |
BLINK_DELAY
The number of milliseconds to wait between blinks |
private static int |
BLINK_TIMES
The number of times this label should blink when updated |
private int |
blinkCount
The current number of times the label has blinked |
private boolean |
blinkOn
Indicates whether the blink is currently on |
private boolean |
isBlinking
Indicates whether this label is currently blinking |
protected javax.swing.JLabel |
label
The label display element wrapped by this object |
private static int |
LABEL_HEIGHT
The height in pixels of this label |
private static int |
LABEL_WIDTH
The width in pixels of this label |
private javax.swing.Timer |
timer
The timer which handles the blink delay |
| Fields inherited from class com.amoebacode.blackjack.display.DisplayElement |
parent |
| Constructor Summary | |
protected |
LabelWrapper(DisplayElement parent)
Default protected constructor. |
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Performs one blink (called when the timer expires). |
protected void |
blinkOff()
Turns the blink off (called when the timer expires). |
protected void |
blinkOn()
Turns the blink on (called when the timer expires). |
protected boolean |
blinks()
Indicates whether this label blinks when updated. |
void |
clear()
Cancels blinking and removes this label from the primary layered pane. |
protected int |
getBlinkDelay()
Returns the number of milliseconds to wait between blinks. |
protected int |
getBlinkTimes()
Returns the number of times this label should blink when updated. |
protected java.awt.Font |
getLabelFont()
Returns the font of this label. |
protected int |
getLabelHeight()
Returns the height of this label. |
protected int |
getLabelWidth()
Returns the width of this label. |
protected abstract int |
getXPos()
Returns the horizontal position of the select box. |
protected abstract int |
getYPos()
Returns the vertical position of the select box. |
protected void |
setBackground(java.awt.Color background)
Sets the background color of this label. |
void |
setText(java.lang.String text)
Sets the text of this label. |
protected void |
setupLabel()
Creates the label display element with an empty string and adds it to the layered pane. |
protected void |
setupLabel(java.lang.String text)
Creates the label display element with the specified text and adds it to the layered pane. |
void |
setVisible(boolean visible)
Sets the visibility attribute of this label. |
protected void |
startBlinking()
Begins the blinking by starting the timer. |
protected void |
stopBlinking()
Finishes the blinking by stopping the timer. |
void |
updateLocation()
Updates the location of this label according to the horizontal and vertical coordinates. |
| Methods inherited from class com.amoebacode.blackjack.display.DisplayElement |
executeGameCommand, getDisplayManager, getGameDisplay, getParent, hasParent, playGameClip, queueAction, resumeQueue |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected javax.swing.JLabel label
private static final int LABEL_WIDTH
private static final int LABEL_HEIGHT
private static final int BLINK_TIMES
private static final int BLINK_DELAY
private int blinkCount
private boolean blinkOn
private boolean isBlinking
private javax.swing.Timer timer
| Constructor Detail |
protected LabelWrapper(DisplayElement parent)
parent - the DisplayElement parent of this label| Method Detail |
protected void setupLabel()
protected void setupLabel(java.lang.String text)
text - the String to display on the labelprotected int getLabelWidth()
protected int getLabelHeight()
protected java.awt.Font getLabelFont()
protected abstract int getXPos()
protected abstract int getYPos()
public void setVisible(boolean visible)
visible - the new visibility valueprotected void setBackground(java.awt.Color background)
background - the new background colorpublic void setText(java.lang.String text)
text - the new textprotected int getBlinkTimes()
protected boolean blinks()
protected int getBlinkDelay()
protected void startBlinking()
protected void stopBlinking()
protected void blinkOn()
protected void blinkOff()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the ActionEven that triggered this actionpublic void updateLocation()
public void clear()
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||