|
|||||||||
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
ggz.games.GamePanel
ggz.cards.CardGamePanel
public class CardGamePanel
Nested Class Summary | |
---|---|
protected class |
CardGamePanel.PopupListener
|
protected class |
CardGamePanel.PreferencesAction
|
protected class |
CardGamePanel.QuitAction
|
protected class |
CardGamePanel.SpriteHighlighter
Listener class used to highlight a sprite to indicate that it has the focus. |
protected class |
CardGamePanel.ViewOptionsAction
|
protected class |
CardGamePanel.ViewPreviousHandAction
|
protected class |
CardGamePanel.ViewScoresAction
|
Nested classes/interfaces inherited from class ggz.games.GamePanel |
---|
GamePanel.SeatBootAction, GamePanel.SeatBotAction, GamePanel.SeatOpenAction, GamePanel.SeatSitAction, GamePanel.SeatStandAction, GamePanel.TableChatAction |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected BidPanel |
bidPanel
|
protected Client |
cardClient
|
protected int |
handILastPlayedFrom
|
protected HyperlinkLabel |
howToPlayLabel
|
protected boolean |
isSingleClickToPlayCardEnabled
|
protected javax.swing.JButton |
lastTrickButton
|
protected HyperlinkLabel |
optionsLabel
|
protected javax.swing.Icon[] |
playerIcons
|
protected PlayerLabel[] |
playerLabels
|
protected HyperlinkLabel |
preferencesLabel
|
protected HyperlinkLabel |
previousHandLabel
|
protected HyperlinkLabel |
quitLabel
|
protected javax.swing.JPanel |
scorePanel
|
protected ScoresDialog |
scoresDialog
|
protected HyperlinkLabel |
scoresLabel
|
protected javax.swing.JPanel |
southEastPanel
|
protected CardGamePanel.SpriteHighlighter |
spriteHighlighter
|
protected Sprite[] |
spriteInTrick
|
protected Sprite[][] |
sprites
|
protected TablePanel |
table
|
protected TableLayout |
tableLayout
|
protected javax.swing.JLabel |
themScoreLabel
|
protected javax.swing.JLabel |
usScoreLabel
|
Fields inherited from class ggz.games.GamePanel |
---|
chatPanel, ggzMod, playerListPanel |
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 | |
---|---|
CardGamePanel()
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
void |
alert_badplay(java.lang.String err_msg)
|
void |
alert_bid(int bidder,
Bid bid)
|
void |
alert_hand_size(int max_hand_size)
|
void |
alert_newgame(CardSetType cardset_type)
|
void |
alert_newhand()
|
void |
alert_num_players(int numplayers,
int old_numplayers)
|
void |
alert_play(int player_num,
Card card)
|
void |
alert_player(int seat_num,
SeatType old_type,
java.lang.String old_name)
Invoked when seat information changes or is first received for a given seat. |
void |
alert_players_status()
Called when the status of one or more players has changed. |
void |
alert_scores(int hand_num)
Called when each team's score is received from the server. |
void |
alert_server(java.net.Socket fd)
|
void |
alert_state(Client.GameState oldState,
Client.GameState newState)
|
void |
alert_table()
A table message tells you all the cards on the table. |
void |
alert_trick(int winner)
A trick message tells you about the end of a trick (and who won). |
void |
alert_tricks_count()
Called when the number of tricks that a player has won is received from the server. |
void |
alert_trump()
Called when the trump suit is known for the current hand. |
void |
beep()
|
protected void |
createOrAddBidPanel(int firstBidder)
Creates a new bid panel if bidding has just started. |
protected void |
display_hand_impl(int player_num)
This method is run on a separate thread in display_hand() above. |
void |
display_hand(int player_num)
|
protected java.lang.String |
formatTeamScore(int teamIndex)
|
void |
get_bid(Bid[] bid_choices,
java.lang.String[] bid_texts,
java.lang.String[] bid_descs)
|
void |
get_newgame()
Server has requested the client to OK a new game. |
boolean |
get_options(java.lang.String[] types,
java.lang.String[] descs,
int[] defaults,
java.lang.String[][] option_choices)
An options request asks you to pick a set of options. |
void |
get_play(int play_hand,
Card[] valid_cards)
|
Client |
getCardClient()
|
protected int |
getCardOrientation(int player_num)
|
protected javax.swing.Icon |
getPlayerIcon(SeatType type)
|
void |
handle_disconnect()
Called when the socket disconnects. |
void |
handle_game_message(GGZCardInputStream in,
java.lang.String gametype)
Called when game-specific data is received by the client. |
void |
handle_gameover(Player[] winners)
|
void |
handleServer(java.net.Socket fd)
A new server connection has been made. |
void |
handleState(ModState oldState)
Module status changed. |
void |
init(ModGame mod)
|
protected void |
initPopupMenu(int seat_num,
int ggz_seat_num,
SeatType type)
|
protected void |
initScorePanel()
|
void |
preferenceChange(java.util.prefs.PreferenceChangeEvent event)
|
protected void |
putNextPlayersCardsOnTop(int player_num)
|
protected void |
repaint_player_labels()
|
void |
set_cardlist_message(java.lang.String mark,
Card[][] cardlist)
Called by server just before trick winner is announced to reinform the client of all the cards in the last trick. |
void |
set_player_message(int player_num,
java.lang.String message)
|
void |
set_text_message(java.lang.String mark,
java.lang.String message)
|
void |
setRulesURL(java.lang.String url)
Adds a label in the top left corner that contains a hyperlink to the rules of the game. |
protected void |
showLastTrick()
|
protected void |
showOptions()
|
protected void |
showPreviousHand()
|
protected void |
showScores()
|
protected void |
spriteClicked(Sprite sprite)
Called when a sprite is clicked. |
Methods inherited from class ggz.games.GamePanel |
---|
getChatPanel, getPreferredWindowSize, handleChat, handleError, handleException, handleInfo, handlePlayer, handleSeat, handleSpectatorSeat, handleStats, invokeAndWait, quit |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Client cardClient
protected javax.swing.Icon[] playerIcons
protected PlayerLabel[] playerLabels
protected Sprite[][] sprites
protected Sprite[] spriteInTrick
protected TableLayout tableLayout
protected TablePanel table
protected int handILastPlayedFrom
protected CardGamePanel.SpriteHighlighter spriteHighlighter
protected BidPanel bidPanel
protected javax.swing.JPanel southEastPanel
protected ScoresDialog scoresDialog
protected javax.swing.JButton lastTrickButton
protected boolean isSingleClickToPlayCardEnabled
protected javax.swing.JPanel scorePanel
protected javax.swing.JLabel usScoreLabel
protected javax.swing.JLabel themScoreLabel
protected HyperlinkLabel quitLabel
protected HyperlinkLabel scoresLabel
protected HyperlinkLabel optionsLabel
protected HyperlinkLabel previousHandLabel
protected HyperlinkLabel preferencesLabel
protected HyperlinkLabel howToPlayLabel
Constructor Detail |
---|
public CardGamePanel()
Method Detail |
---|
public void init(ModGame mod) throws java.io.IOException
init
in interface ModEventHandler
init
in class GamePanel
java.io.IOException
protected void createOrAddBidPanel(int firstBidder)
firstBidder
- public void alert_state(Client.GameState oldState, Client.GameState newState)
alert_state
in interface CardGameHandler
public void alert_badplay(java.lang.String err_msg)
alert_badplay
in interface CardGameHandler
public void alert_bid(int bidder, Bid bid)
alert_bid
in interface CardGameHandler
public void alert_hand_size(int max_hand_size)
alert_hand_size
in interface CardGameHandler
public void alert_newgame(CardSetType cardset_type)
alert_newgame
in interface CardGameHandler
public void alert_newhand()
alert_newhand
in interface CardGameHandler
public void alert_trump()
CardGameHandler
alert_trump
in interface CardGameHandler
public void alert_num_players(int numplayers, int old_numplayers)
alert_num_players
in interface CardGameHandler
public void alert_player(int seat_num, SeatType old_type, java.lang.String old_name)
alert_player
in interface CardGameHandler
protected javax.swing.Icon getPlayerIcon(SeatType type)
protected void initPopupMenu(int seat_num, int ggz_seat_num, SeatType type)
protected void initScorePanel()
protected int getCardOrientation(int player_num)
public void alert_play(int player_num, Card card)
alert_play
in interface CardGameHandler
public void alert_players_status()
CardGameHandler
alert_players_status
in interface CardGameHandler
protected void repaint_player_labels()
protected void putNextPlayersCardsOnTop(int player_num)
protected void showLastTrick() throws java.io.IOException
java.io.IOException
protected void showPreviousHand() throws java.io.IOException
java.io.IOException
protected void showScores()
protected void showOptions()
public Client getCardClient()
public void alert_server(java.net.Socket fd)
alert_server
in interface CardGameHandler
public void alert_table()
CardGameHandler
alert_table
in interface CardGameHandler
public void alert_trick(int winner)
CardGameHandler
alert_trick
in interface CardGameHandler
public void alert_scores(int hand_num)
CardGameHandler
alert_scores
in interface CardGameHandler
protected java.lang.String formatTeamScore(int teamIndex)
public void alert_tricks_count()
CardGameHandler
alert_tricks_count
in interface CardGameHandler
public void display_hand(int player_num)
display_hand
in interface CardGameHandler
protected void display_hand_impl(int player_num)
player_num
- public void get_bid(Bid[] bid_choices, java.lang.String[] bid_texts, java.lang.String[] bid_descs)
get_bid
in interface CardGameHandler
public void get_newgame()
CardGameHandler
get_newgame
in interface CardGameHandler
public boolean get_options(java.lang.String[] types, java.lang.String[] descs, int[] defaults, java.lang.String[][] option_choices) throws java.io.IOException
CardGameHandler
get_options
in interface CardGameHandler
java.io.IOException
public void get_play(int play_hand, Card[] valid_cards)
get_play
in interface CardGameHandler
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public void preferenceChange(java.util.prefs.PreferenceChangeEvent event)
preferenceChange
in interface java.util.prefs.PreferenceChangeListener
protected void spriteClicked(Sprite sprite)
sprite
- public void handle_game_message(GGZCardInputStream in, java.lang.String gametype) throws java.io.IOException
CardGameHandler
handle_game_message
in interface CardGameHandler
java.io.IOException
public void handle_gameover(Player[] winners)
handle_gameover
in interface CardGameHandler
public void handle_disconnect()
CardGameHandler
handle_disconnect
in interface CardGameHandler
public void set_cardlist_message(java.lang.String mark, Card[][] cardlist)
set_cardlist_message
in interface CardGameHandler
mark
- Last Trick or Previous Handcardlist
- the list contains as many arrays as there are players in the
game.public void set_player_message(int player_num, java.lang.String message)
set_player_message
in interface CardGameHandler
public void set_text_message(java.lang.String mark, java.lang.String message)
set_text_message
in interface CardGameHandler
public void setRulesURL(java.lang.String url) throws java.net.MalformedURLException
url
-
java.net.MalformedURLException
public void handleState(ModState oldState)
ModEventHandler
handleState
in interface ModEventHandler
handleState
in class GamePanel
ModState
public void handleServer(java.net.Socket fd) throws java.io.IOException
ModEventHandler
handleServer
in interface ModEventHandler
handleServer
in class GamePanel
java.io.IOException
ModGame.connect()
public void beep()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |