|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.threerings.parlor.turn.client.TurnDisplay
public class TurnDisplay
Automatically display a list of players and turn change information in a turn-based game.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected String |
_drawText
The text to display next to a drawing player's name. |
protected HashMap<Name,JLabel> |
_labels
A mapping of the labels currently associated with each player. |
protected Icon[] |
_playerIcons
The game-specified player icons. |
protected Icon |
_turnIcon
The Icon we use for indicating the turn. |
protected TurnGameObject |
_turnObj
The TurnGameObject we're displaying. |
protected String |
_winnerText
The text to display next to a winner's name. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TurnDisplay()
Create a TurnDisplay. |
|
TurnDisplay(Icon turnIcon)
Create a TurnDisplay for a game using the specified Icon to denote whose turn it is. |
|
| Method Summary | |
|---|---|
void |
attributeChanged(AttributeChangedEvent event)
|
protected void |
createList()
Create the list of names and highlight as appropriate. |
void |
didLeavePlace(PlaceObject plobj)
|
void |
elementUpdated(ElementUpdatedEvent event)
|
void |
setDrawText(String drawText)
Sets the text to be displayed next to everyone's name in the event of a draw. |
void |
setPlayerIcons(Icon[] icons)
Set optional icons to use for identifying each player in the game. |
void |
setTurnIcon(Icon turnIcon)
Set the icon to use. |
void |
setWinnerText(String winnerText)
Set the text to be displayed next to the winner's name. |
void |
willEnterPlace(PlaceObject plobj)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected TurnGameObject _turnObj
protected HashMap<Name,JLabel> _labels
protected Icon[] _playerIcons
protected String _winnerText
protected String _drawText
protected Icon _turnIcon
| Constructor Detail |
|---|
public TurnDisplay()
public TurnDisplay(Icon turnIcon)
| Method Detail |
|---|
public void setTurnIcon(Icon turnIcon)
public void setWinnerText(String winnerText)
public void setDrawText(String drawText)
public void setPlayerIcons(Icon[] icons)
protected void createList()
public void willEnterPlace(PlaceObject plobj)
willEnterPlace in interface PlaceViewpublic void didLeavePlace(PlaceObject plobj)
didLeavePlace in interface PlaceViewpublic void attributeChanged(AttributeChangedEvent event)
attributeChanged in interface AttributeChangeListenerpublic void elementUpdated(ElementUpdatedEvent event)
elementUpdated in interface ElementUpdateListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||