jrummikub.view.impl
Class View

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by jrummikub.view.impl.View
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, IView

public class View
extends javax.swing.JFrame
implements IView

Implementation of the top-level view interface

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
 
Nested classes/interfaces inherited from interface jrummikub.view.IView
IView.BottomPanelType
 
Field Summary
private  IView.BottomPanelType bottomPanelType
           
private  javax.swing.JFileChooser chooser
           
private  ConnectPanel connectPanel
           
private  GameListPanel gameListPanel
           
private  javax.swing.JLayeredPane layeredPane
           
private  Event loadEvent
           
private  Event1<java.io.File> loadFileEvent
           
private  LoginPanel loginPanel
           
private  javax.swing.JPanel mainLayer
           
private  javax.swing.JMenuBar menuBar
           
private  Event menuNewGameEvent
           
private  Event networkGameEvent
           
private  PausePanel pausePanel
           
private static int PLAYER_PANEL_MAX_HEIGHT
           
private static float PLAYER_PANEL_RATIO
           
private  PlayerPanel playerPanel
           
private  Event quitEvent
           
private  javax.swing.JFrame quitWarningFrame
           
private  QuitWarningPanel quitWarningPanel
           
private  RoundEndPanel roundEndPanel
           
private  Event1<java.io.File> saveEvent
           
private  javax.swing.JMenuItem saveItem
           
private  ScorePanel scorePanel
           
private  SettingsPanel settingsPanel
           
private  SidePanel sidePanel
           
private  StartTurnPanel startTurnPanel
           
private  TablePanel table
           
private static int TABLE_BORDER_WIDTH
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
View()
          Create a new instance of the view
 
Method Summary
 void clearView()
          Hides all view elements and panels except for the cleared table and an empty hand panel
private  java.util.List<Pair<Stone,Position>> createDecorationStones()
           
private  void createFileChooser()
           
private  void createLayeredPane()
           
private  void createMainLayer()
           
private  void createMenuBar()
           
private  javax.swing.JMenuItem createMenuItem(java.lang.String text, Event event)
           
private  void createSettingsPanel()
           
private  void doSetBottomPanel(IView.BottomPanelType type)
           
 void enablePauseMode(boolean enable)
          Enable/disable pause mode
 void enableSave(boolean enable)
          Enables/disables saving in menu bar
private static int even(double d)
           
 IEvent getAcknowledgeConnectionLostEvent()
          The acknoledge connection lost event is emitted when the user has acknowledged that the network connection was lost
 IEvent getAcknowledgeInvalidEvent()
          The start turn event is emitted when the player knows what invalid stones he played
 IConnectPanel getConnectPanel()
          Getter for connect panel
 IEvent getEndPauseEvent()
          The end pause event is emitted when the user wants to sresume the game after a pause
 IEvent getEndProgramEvent()
          The quit event is emitted when the player wants to quit the game
 IGameListPanel getGameListPanel()
          Getter for game list panel
 IHandPanel getHandPanel()
           
 IEvent getLoadEvent()
          The load event is emitted when the user wants to load a previously saved game state
 IEvent1<java.io.File> getLoadFileEvent()
          The load file event is emitted when the user chose to discard the current game to save another
 ILoginPanel getLoginPanel()
          Getter for login panel
 IEvent getMenuNewGameEvent()
          The menu new game event is emitted when the user selects the new game menu entry
 IEvent getNetworkGameEvent()
          The network game event is emitted when the user chooses a network game
 IEvent getNewGameEvent()
          Is emitted if the player wants to end the game and start a new one
 IEvent getNewRoundEvent()
          The new round event is emitted when the player wants to start a new round
 IEvent getPauseEvent()
          The pause event is emitted when the user wants to pause the current turn
 IPlayerPanel getPlayerPanel()
          Returns the player panel
 IEvent getQuitEvent()
          The quit event is emitted when the user wants to leave the application
 IQuitWarningPanel getQuitWarningPanel()
          Getter for quit warning panel
 IEvent1<java.io.File> getSaveEvent()
          The save event is emitted when the user wants to save the current game state
 IScorePanel getScorePanel()
          Returns the score panel
 ISettingsPanel getSettingsPanel()
          Returns the settings panel
 ISidePanel getSidePanel()
          Returns the side panel
 IEvent getStartTurnEvent()
          The start turn event is emitted when the player wants to start his turn
 ITablePanel getTablePanel()
          Returns the table
 void load()
          Loading a game
private  void rescale()
           
private  void rescaleSubpanel(javax.swing.JPanel sub, double widthFactor, double heightFactor, int minWidth, int minHeight)
           
 void resetLoginPanel()
          Clears user input of the resetLoginPanel
private  void save()
           
 void setBottomPanel(IView.BottomPanelType type)
          Sets the bottom panels type
 void setCurrentPlayerColor(java.awt.Color color)
          Is used for the PlayerPanel and ScorePanel to display a player's color along with the name
 void setCurrentPlayerHasLaidOut(boolean hasLaidOut)
          Is used for the PlayerPanel to display if a player has laid out along with the name
 void setCurrentPlayerName(java.lang.String playerName)
          Sets the current player's name
 void setInitialMeldError(int points)
          Is set if a player tried to lay out less than initial meld threshold
 void setInitialMeldFirstError()
          Is set if the player tried to modify the table without laying out first
 void setInvalidStoneSets(java.util.Collection<StoneSet> sets)
          Set invalid sets to enable showing
 void setLastStonePlayerName(java.lang.String name)
          Sets the name of the player that has drawn the last stone
 void setMayPause(boolean mayPause)
          Sets the pause button if pausing should be possible in the current situation
 void setRedealedPlayerName(java.lang.String name)
          Sets the name of the player that has redealt last
 void setSelectedStones(java.util.Collection<Stone> stones)
          Sets the stones that are to be painted selected
 void setStoneCollectionHidden(boolean enable)
          Show stone collection
 void showConnectPanel(boolean show)
          Set the connect panel visible
 void showGameListPanel(boolean show)
          Show/hide game list panel
 void showLoadingError()
          Show when loading is unsuccessful
 void showLoginPanel(boolean show)
          Show/hide login panel
 void showQuitWarningPanel(boolean show)
          Sets the quit warning panel visible
 void showScorePanel(boolean show)
          Shows or hides the score panel
 void showServerStartupError(boolean alreadyRunning)
          Show an error message when the server couldn't be started
 void showSettingsPanel(boolean show)
          Shows or hides the game settings panel
 void showSidePanel(boolean show)
          Show/hide side panel
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

PLAYER_PANEL_RATIO

private static final float PLAYER_PANEL_RATIO
See Also:
Constant Field Values

PLAYER_PANEL_MAX_HEIGHT

private static final int PLAYER_PANEL_MAX_HEIGHT
See Also:
Constant Field Values

TABLE_BORDER_WIDTH

private static final int TABLE_BORDER_WIDTH
See Also:
Constant Field Values

layeredPane

private javax.swing.JLayeredPane layeredPane

mainLayer

private javax.swing.JPanel mainLayer

menuBar

private javax.swing.JMenuBar menuBar

saveItem

private javax.swing.JMenuItem saveItem

table

private TablePanel table

playerPanel

private PlayerPanel playerPanel

startTurnPanel

private StartTurnPanel startTurnPanel

pausePanel

private PausePanel pausePanel

roundEndPanel

private RoundEndPanel roundEndPanel

settingsPanel

private SettingsPanel settingsPanel

loginPanel

private LoginPanel loginPanel

scorePanel

private ScorePanel scorePanel

gameListPanel

private GameListPanel gameListPanel

sidePanel

private SidePanel sidePanel

quitWarningPanel

private QuitWarningPanel quitWarningPanel

connectPanel

private ConnectPanel connectPanel

bottomPanelType

private IView.BottomPanelType bottomPanelType

chooser

private javax.swing.JFileChooser chooser

menuNewGameEvent

private Event menuNewGameEvent

networkGameEvent

private Event networkGameEvent

loadEvent

private Event loadEvent

loadFileEvent

private Event1<java.io.File> loadFileEvent

saveEvent

private Event1<java.io.File> saveEvent

quitEvent

private Event quitEvent

quitWarningFrame

private javax.swing.JFrame quitWarningFrame
Constructor Detail

View

public View()
Create a new instance of the view

Method Detail

even

private static int even(double d)

getSettingsPanel

public ISettingsPanel getSettingsPanel()
Description copied from interface: IView
Returns the settings panel

Specified by:
getSettingsPanel in interface IView
Returns:
the settings panel

getLoginPanel

public ILoginPanel getLoginPanel()
Description copied from interface: IView
Getter for login panel

Specified by:
getLoginPanel in interface IView
Returns:
login panel

getScorePanel

public IScorePanel getScorePanel()
Description copied from interface: IView
Returns the score panel

Specified by:
getScorePanel in interface IView
Returns:
the score panel

getTablePanel

public ITablePanel getTablePanel()
Description copied from interface: IView
Returns the table

Specified by:
getTablePanel in interface IView
Returns:
the table

getSidePanel

public ISidePanel getSidePanel()
Description copied from interface: IView
Returns the side panel

Specified by:
getSidePanel in interface IView
Returns:
the side panel

getHandPanel

public IHandPanel getHandPanel()
Specified by:
getHandPanel in interface IView
Returns:
the board where the players hand stones are displayed

getPlayerPanel

public IPlayerPanel getPlayerPanel()
Description copied from interface: IView
Returns the player panel

Specified by:
getPlayerPanel in interface IView
Returns:
the playerPanel

getQuitWarningPanel

public IQuitWarningPanel getQuitWarningPanel()
Description copied from interface: IView
Getter for quit warning panel

Specified by:
getQuitWarningPanel in interface IView
Returns:
the panel

getConnectPanel

public IConnectPanel getConnectPanel()
Description copied from interface: IView
Getter for connect panel

Specified by:
getConnectPanel in interface IView
Returns:
the panel

getGameListPanel

public IGameListPanel getGameListPanel()
Description copied from interface: IView
Getter for game list panel

Specified by:
getGameListPanel in interface IView
Returns:
game list panel

getMenuNewGameEvent

public IEvent getMenuNewGameEvent()
Description copied from interface: IView
The menu new game event is emitted when the user selects the new game menu entry

Specified by:
getMenuNewGameEvent in interface IView
Returns:
the event

getLoadFileEvent

public IEvent1<java.io.File> getLoadFileEvent()
Description copied from interface: IView
The load file event is emitted when the user chose to discard the current game to save another

Specified by:
getLoadFileEvent in interface IView
Returns:
the event

getLoadEvent

public IEvent getLoadEvent()
Description copied from interface: IView
The load event is emitted when the user wants to load a previously saved game state

Specified by:
getLoadEvent in interface IView
Returns:
the event

getSaveEvent

public IEvent1<java.io.File> getSaveEvent()
Description copied from interface: IView
The save event is emitted when the user wants to save the current game state

Specified by:
getSaveEvent in interface IView
Returns:
the event

getPauseEvent

public IEvent getPauseEvent()
Description copied from interface: IView
The pause event is emitted when the user wants to pause the current turn

Specified by:
getPauseEvent in interface IView
Returns:
the event

getEndPauseEvent

public IEvent getEndPauseEvent()
Description copied from interface: IView
The end pause event is emitted when the user wants to sresume the game after a pause

Specified by:
getEndPauseEvent in interface IView
Returns:
the event

getNetworkGameEvent

public IEvent getNetworkGameEvent()
Description copied from interface: IView
The network game event is emitted when the user chooses a network game

Specified by:
getNetworkGameEvent in interface IView
Returns:
the event

getQuitEvent

public IEvent getQuitEvent()
Description copied from interface: IView
The quit event is emitted when the user wants to leave the application

Specified by:
getQuitEvent in interface IView
Returns:
the event

clearView

public void clearView()
Description copied from interface: IView
Hides all view elements and panels except for the cleared table and an empty hand panel

Specified by:
clearView in interface IView

showLoadingError

public void showLoadingError()
Description copied from interface: IView
Show when loading is unsuccessful

Specified by:
showLoadingError in interface IView

showServerStartupError

public void showServerStartupError(boolean alreadyRunning)
Description copied from interface: IView
Show an error message when the server couldn't be started

Specified by:
showServerStartupError in interface IView
Parameters:
alreadyRunning - true when the server is already running on this machine

createFileChooser

private void createFileChooser()

createMenuBar

private void createMenuBar()

createMenuItem

private javax.swing.JMenuItem createMenuItem(java.lang.String text,
                                             Event event)

enableSave

public void enableSave(boolean enable)
Description copied from interface: IView
Enables/disables saving in menu bar

Specified by:
enableSave in interface IView
Parameters:
enable - saving possible

load

public void load()
Description copied from interface: IView
Loading a game

Specified by:
load in interface IView

save

private void save()

createLayeredPane

private void createLayeredPane()

createSettingsPanel

private void createSettingsPanel()

createMainLayer

private void createMainLayer()

setMayPause

public void setMayPause(boolean mayPause)
Description copied from interface: IView
Sets the pause button if pausing should be possible in the current situation

Specified by:
setMayPause in interface IView
Parameters:
mayPause - pausing possible

enablePauseMode

public void enablePauseMode(boolean enable)
Description copied from interface: IView
Enable/disable pause mode

Specified by:
enablePauseMode in interface IView
Parameters:
enable - true = enable

rescale

private void rescale()

rescaleSubpanel

private void rescaleSubpanel(javax.swing.JPanel sub,
                             double widthFactor,
                             double heightFactor,
                             int minWidth,
                             int minHeight)

setSelectedStones

public void setSelectedStones(java.util.Collection<Stone> stones)
Description copied from interface: IView
Sets the stones that are to be painted selected

Specified by:
setSelectedStones in interface IView
Parameters:
stones - the stones to be painted selected

setInvalidStoneSets

public void setInvalidStoneSets(java.util.Collection<StoneSet> sets)
Description copied from interface: IView
Set invalid sets to enable showing

Specified by:
setInvalidStoneSets in interface IView
Parameters:
sets - invalid sets on table

showSettingsPanel

public void showSettingsPanel(boolean show)
Description copied from interface: IView
Shows or hides the game settings panel

Specified by:
showSettingsPanel in interface IView
Parameters:
show - specifies if the panel shall be shown or hidden

showLoginPanel

public void showLoginPanel(boolean show)
Description copied from interface: IView
Show/hide login panel

Specified by:
showLoginPanel in interface IView
Parameters:
show - true = login panel is shown

resetLoginPanel

public void resetLoginPanel()
Description copied from interface: IView
Clears user input of the resetLoginPanel

Specified by:
resetLoginPanel in interface IView

showGameListPanel

public void showGameListPanel(boolean show)
Description copied from interface: IView
Show/hide game list panel

Specified by:
showGameListPanel in interface IView
Parameters:
show - true = show

showScorePanel

public void showScorePanel(boolean show)
Description copied from interface: IView
Shows or hides the score panel

Specified by:
showScorePanel in interface IView
Parameters:
show - specifies if the panel shall be shown or hidden

showSidePanel

public void showSidePanel(boolean show)
Description copied from interface: IView
Show/hide side panel

Specified by:
showSidePanel in interface IView
Parameters:
show - true to show

showQuitWarningPanel

public void showQuitWarningPanel(boolean show)
Description copied from interface: IView
Sets the quit warning panel visible

Specified by:
showQuitWarningPanel in interface IView
Parameters:
show - is visible

showConnectPanel

public void showConnectPanel(boolean show)
Description copied from interface: IView
Set the connect panel visible

Specified by:
showConnectPanel in interface IView
Parameters:
show - is visible

setCurrentPlayerName

public void setCurrentPlayerName(java.lang.String playerName)
Description copied from interface: IView
Sets the current player's name

Specified by:
setCurrentPlayerName in interface IView
Parameters:
playerName - the player name

setInitialMeldError

public void setInitialMeldError(int points)
Description copied from interface: IView
Is set if a player tried to lay out less than initial meld threshold

Specified by:
setInitialMeldError in interface IView
Parameters:
points - initial meld threshold

setInitialMeldFirstError

public void setInitialMeldFirstError()
Description copied from interface: IView
Is set if the player tried to modify the table without laying out first

Specified by:
setInitialMeldFirstError in interface IView

setCurrentPlayerColor

public void setCurrentPlayerColor(java.awt.Color color)
Description copied from interface: IView
Is used for the PlayerPanel and ScorePanel to display a player's color along with the name

Specified by:
setCurrentPlayerColor in interface IView
Parameters:
color - the current player's color

setRedealedPlayerName

public void setRedealedPlayerName(java.lang.String name)
Description copied from interface: IView
Sets the name of the player that has redealt last

Specified by:
setRedealedPlayerName in interface IView
Parameters:
name - the player name

setLastStonePlayerName

public void setLastStonePlayerName(java.lang.String name)
Description copied from interface: IView
Sets the name of the player that has drawn the last stone

Specified by:
setLastStonePlayerName in interface IView
Parameters:
name - the player name

setCurrentPlayerHasLaidOut

public void setCurrentPlayerHasLaidOut(boolean hasLaidOut)
Description copied from interface: IView
Is used for the PlayerPanel to display if a player has laid out along with the name

Specified by:
setCurrentPlayerHasLaidOut in interface IView
Parameters:
hasLaidOut - specifies if the current player has laid out or not

getStartTurnEvent

public IEvent getStartTurnEvent()
Description copied from interface: IView
The start turn event is emitted when the player wants to start his turn

Specified by:
getStartTurnEvent in interface IView
Returns:
the event

getAcknowledgeInvalidEvent

public IEvent getAcknowledgeInvalidEvent()
Description copied from interface: IView
The start turn event is emitted when the player knows what invalid stones he played

Specified by:
getAcknowledgeInvalidEvent in interface IView
Returns:
the event

getAcknowledgeConnectionLostEvent

public IEvent getAcknowledgeConnectionLostEvent()
Description copied from interface: IView
The acknoledge connection lost event is emitted when the user has acknowledged that the network connection was lost

Specified by:
getAcknowledgeConnectionLostEvent in interface IView
Returns:
the event

getNewRoundEvent

public IEvent getNewRoundEvent()
Description copied from interface: IView
The new round event is emitted when the player wants to start a new round

Specified by:
getNewRoundEvent in interface IView
Returns:
the event

getNewGameEvent

public IEvent getNewGameEvent()
Description copied from interface: IView
Is emitted if the player wants to end the game and start a new one

Specified by:
getNewGameEvent in interface IView
Returns:
newGameEvent

getEndProgramEvent

public IEvent getEndProgramEvent()
Description copied from interface: IView
The quit event is emitted when the player wants to quit the game

Specified by:
getEndProgramEvent in interface IView
Returns:
the event

createDecorationStones

private java.util.List<Pair<Stone,Position>> createDecorationStones()

setBottomPanel

public void setBottomPanel(IView.BottomPanelType type)
Description copied from interface: IView
Sets the bottom panels type

Specified by:
setBottomPanel in interface IView
Parameters:
type - the type of the bottom panel

doSetBottomPanel

private void doSetBottomPanel(IView.BottomPanelType type)

setStoneCollectionHidden

public void setStoneCollectionHidden(boolean enable)
Description copied from interface: IView
Show stone collection

Specified by:
setStoneCollectionHidden in interface IView
Parameters:
enable - showing collection