com.asdf.plugins.pokergames.gameview
Class GameViewSeat

java.lang.Object
  extended by com.asdf.plugins.pokergames.gameview.GameViewSeat
All Implemented Interfaces:
java.awt.event.MouseListener, java.util.EventListener

public class GameViewSeat
extends java.lang.Object
implements java.awt.event.MouseListener


Field Summary
 java.awt.Point centerOfSeat
           
 
Method Summary
 void bounds(int x, int y, double xratio, double yratio)
          Method that places and resizes everything that is located near seat: smallcards, dealerbutton, reservedbutton, cards, timer, playerseat, distributed betchips, bet text.
 void chipDraw(double xratio, double yratio)
          draw bet distribution for this seat.
 void drawTimer(double currenttimer, double maxtimer)
          Draws timer with ratio of current/max
 void enableCard(int i, boolean b)
          Sets given cards as enabled or not-enabled.
 void enableCards(boolean b)
           
 int getCardCount()
          Gives amount of cards we created seat/game
 java.awt.Point getCenter()
          Gives center of seat,
 int getSeatNro()
          Returns seat number of this seat.
 void hideAll()
          Hide all graphic components except reserved and dealer buttons.
 void hideCards()
          hides all card components.
 boolean isCardsKnown()
          returns as boolean if cards are set as known.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setAvailable(boolean visible, PokerGameController tgc)
          Draw available seats if visible and attach gamecontroller to pass messages.
 void setBet(boolean visible, double amount, double xratio, double yratio)
          Updates bettext.
 void setcards(boolean ingame)
          Clear visible cards from this seat.
 void setCards(boolean enabled, java.lang.String[] s, double xratio, double yratio)
          sets visible cards for this player, parameters decide how they are shown.
 void setCardsDisable()
          sets all cards disabled.
 void setCardsKnown(boolean b)
          marks cards as known/unknown so that gamemodel doesnt overwrite known cards.
 void setDealer(boolean b)
          Draw dealer button true/false near this seat.
 void setGameViewAccountName(java.lang.String s)
           
 void setReserved(boolean b)
          Show this seat as reserved seat true/false
 void setSeat(boolean enabled, java.lang.String accountname_, java.lang.String name_, double bank_, java.lang.String action_)
          sets playerinfo to this seat
 void setTimerVisible(boolean b)
          hides timerbar
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centerOfSeat

public java.awt.Point centerOfSeat
Method Detail

setCardsKnown

public void setCardsKnown(boolean b)
marks cards as known/unknown so that gamemodel doesnt overwrite known cards.

Parameters:
b -

isCardsKnown

public boolean isCardsKnown()
returns as boolean if cards are set as known.

Returns:
is cards known

setGameViewAccountName

public void setGameViewAccountName(java.lang.String s)

setCardsDisable

public void setCardsDisable()
sets all cards disabled. Used to show if cards are folded or not part of winning hand.


getCardCount

public int getCardCount()
Gives amount of cards we created seat/game

Returns:
the length of cards.

enableCard

public void enableCard(int i,
                       boolean b)
Sets given cards as enabled or not-enabled.

Parameters:
i - given card number
b - toggle true/false to enabled

enableCards

public void enableCards(boolean b)

bounds

public void bounds(int x,
                   int y,
                   double xratio,
                   double yratio)
Method that places and resizes everything that is located near seat: smallcards, dealerbutton, reservedbutton, cards, timer, playerseat, distributed betchips, bet text.

Parameters:
x - width of playarea
y - height of playarea
xratio - width ratio of pictures and seat.
yratio - height ratio of picutres and seat.

getSeatNro

public int getSeatNro()
Returns seat number of this seat.


chipDraw

public void chipDraw(double xratio,
                     double yratio)
draw bet distribution for this seat.

Parameters:
xratio -
yratio -

setBet

public void setBet(boolean visible,
                   double amount,
                   double xratio,
                   double yratio)
Updates bettext. Creates new distribution of chip presentation if bet has changed from previous

Parameters:
visible - visible switch
amount - amount of bet

setDealer

public void setDealer(boolean b)
Draw dealer button true/false near this seat.


setReserved

public void setReserved(boolean b)
Show this seat as reserved seat true/false


setAvailable

public void setAvailable(boolean visible,
                         PokerGameController tgc)
Draw available seats if visible and attach gamecontroller to pass messages.

Parameters:
visible - - Toggle if seat is available
tgc - - Gamecontroller that forwards message if player wants to sit.

setTimerVisible

public void setTimerVisible(boolean b)
hides timerbar


drawTimer

public void drawTimer(double currenttimer,
                      double maxtimer)
Draws timer with ratio of current/max

Parameters:
currenttimer -
maxtimer -

hideAll

public void hideAll()
Hide all graphic components except reserved and dealer buttons. (bet distribution is hidden in setbet)


hideCards

public void hideCards()
hides all card components.


setcards

public void setcards(boolean ingame)
Clear visible cards from this seat. Draw presentation of smallcard image if player is ingame


setCards

public void setCards(boolean enabled,
                     java.lang.String[] s,
                     double xratio,
                     double yratio)
sets visible cards for this player, parameters decide how they are shown.

Parameters:
enabled - if cards are not enabled draw them as gray.
s - - all cards that this seat has given as string.

setSeat

public void setSeat(boolean enabled,
                    java.lang.String accountname_,
                    java.lang.String name_,
                    double bank_,
                    java.lang.String action_)
sets playerinfo to this seat

Parameters:
enabled - - folded/sitdown shows background as darker shade of gray
accountname_ - - player's accountname
name_ -
bank_ - - players bankaccount
action_ - - playesr latest action

getCenter

public java.awt.Point getCenter()
Gives center of seat,

Returns:
center point of the seat

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener