jrummikub.view
Interface IView

All Known Implementing Classes:
View

public interface IView

The top-level view interface


Nested Class Summary
static class IView.BottomPanelType
          Different types of bottom panels
 
Method Summary
 void clearView()
          Hides all view elements and panels except for the cleared table and an empty hand panel
 void enablePauseMode(boolean enable)
          Enable/disable pause mode
 void enableSave(boolean enable)
          Enables/disables saving in menu bar
 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
 void resetLoginPanel()
          Clears user input of the resetLoginPanel
 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
 

Method Detail

getSettingsPanel

ISettingsPanel getSettingsPanel()
Returns the settings panel

Returns:
the settings panel

getScorePanel

IScorePanel getScorePanel()
Returns the score panel

Returns:
the score panel

getTablePanel

ITablePanel getTablePanel()
Returns the table

Returns:
the table

getSidePanel

ISidePanel getSidePanel()
Returns the side panel

Returns:
the side panel

getHandPanel

IHandPanel getHandPanel()
Returns:
the board where the players hand stones are displayed

getPlayerPanel

IPlayerPanel getPlayerPanel()
Returns the player panel

Returns:
the playerPanel

setCurrentPlayerName

void setCurrentPlayerName(java.lang.String playerName)
Sets the current player's name

Parameters:
playerName - the player name

setRedealedPlayerName

void setRedealedPlayerName(java.lang.String name)
Sets the name of the player that has redealt last

Parameters:
name - the player name

setLastStonePlayerName

void setLastStonePlayerName(java.lang.String name)
Sets the name of the player that has drawn the last stone

Parameters:
name - the player name

setSelectedStones

void setSelectedStones(java.util.Collection<Stone> stones)
Sets the stones that are to be painted selected

Parameters:
stones - the stones to be painted selected

getStartTurnEvent

IEvent getStartTurnEvent()
The start turn event is emitted when the player wants to start his turn

Returns:
the event

getAcknowledgeInvalidEvent

IEvent getAcknowledgeInvalidEvent()
The start turn event is emitted when the player knows what invalid stones he played

Returns:
the event

getAcknowledgeConnectionLostEvent

IEvent getAcknowledgeConnectionLostEvent()
The acknoledge connection lost event is emitted when the user has acknowledged that the network connection was lost

Returns:
the event

getEndProgramEvent

IEvent getEndProgramEvent()
The quit event is emitted when the player wants to quit the game

Returns:
the event

getNewRoundEvent

IEvent getNewRoundEvent()
The new round event is emitted when the player wants to start a new round

Returns:
the event

showSettingsPanel

void showSettingsPanel(boolean show)
Shows or hides the game settings panel

Parameters:
show - specifies if the panel shall be shown or hidden

showScorePanel

void showScorePanel(boolean show)
Shows or hides the score panel

Parameters:
show - specifies if the panel shall be shown or hidden

setCurrentPlayerColor

void setCurrentPlayerColor(java.awt.Color color)
Is used for the PlayerPanel and ScorePanel to display a player's color along with the name

Parameters:
color - the current player's color

setCurrentPlayerHasLaidOut

void setCurrentPlayerHasLaidOut(boolean hasLaidOut)
Is used for the PlayerPanel to display if a player has laid out along with the name

Parameters:
hasLaidOut - specifies if the current player has laid out or not

getNewGameEvent

IEvent getNewGameEvent()
Is emitted if the player wants to end the game and start a new one

Returns:
newGameEvent

setBottomPanel

void setBottomPanel(IView.BottomPanelType type)
Sets the bottom panels type

Parameters:
type - the type of the bottom panel

getMenuNewGameEvent

IEvent getMenuNewGameEvent()
The menu new game event is emitted when the user selects the new game menu entry

Returns:
the event

getLoadEvent

IEvent getLoadEvent()
The load event is emitted when the user wants to load a previously saved game state

Returns:
the event

getSaveEvent

IEvent1<java.io.File> getSaveEvent()
The save event is emitted when the user wants to save the current game state

Returns:
the event

getPauseEvent

IEvent getPauseEvent()
The pause event is emitted when the user wants to pause the current turn

Returns:
the event

getEndPauseEvent

IEvent getEndPauseEvent()
The end pause event is emitted when the user wants to sresume the game after a pause

Returns:
the event

clearView

void clearView()
Hides all view elements and panels except for the cleared table and an empty hand panel


getNetworkGameEvent

IEvent getNetworkGameEvent()
The network game event is emitted when the user chooses a network game

Returns:
the event

getLoginPanel

ILoginPanel getLoginPanel()
Getter for login panel

Returns:
login panel

getGameListPanel

IGameListPanel getGameListPanel()
Getter for game list panel

Returns:
game list panel

showLoginPanel

void showLoginPanel(boolean show)
Show/hide login panel

Parameters:
show - true = login panel is shown

resetLoginPanel

void resetLoginPanel()
Clears user input of the resetLoginPanel


enablePauseMode

void enablePauseMode(boolean enable)
Enable/disable pause mode

Parameters:
enable - true = enable

showGameListPanel

void showGameListPanel(boolean show)
Show/hide game list panel

Parameters:
show - true = show

showSidePanel

void showSidePanel(boolean show)
Show/hide side panel

Parameters:
show - true to show

setInitialMeldError

void setInitialMeldError(int points)
Is set if a player tried to lay out less than initial meld threshold

Parameters:
points - initial meld threshold

setStoneCollectionHidden

void setStoneCollectionHidden(boolean enable)
Show stone collection

Parameters:
enable - showing collection

setInitialMeldFirstError

void setInitialMeldFirstError()
Is set if the player tried to modify the table without laying out first


setInvalidStoneSets

void setInvalidStoneSets(java.util.Collection<StoneSet> sets)
Set invalid sets to enable showing

Parameters:
sets - invalid sets on table

showLoadingError

void showLoadingError()
Show when loading is unsuccessful


showServerStartupError

void showServerStartupError(boolean alreadyRunning)
Show an error message when the server couldn't be started

Parameters:
alreadyRunning - true when the server is already running on this machine

enableSave

void enableSave(boolean enable)
Enables/disables saving in menu bar

Parameters:
enable - saving possible

showQuitWarningPanel

void showQuitWarningPanel(boolean show)
Sets the quit warning panel visible

Parameters:
show - is visible

getQuitEvent

IEvent getQuitEvent()
The quit event is emitted when the user wants to leave the application

Returns:
the event

getQuitWarningPanel

IQuitWarningPanel getQuitWarningPanel()
Getter for quit warning panel

Returns:
the panel

getLoadFileEvent

IEvent1<java.io.File> getLoadFileEvent()
The load file event is emitted when the user chose to discard the current game to save another

Returns:
the event

load

void load()
Loading a game


showConnectPanel

void showConnectPanel(boolean show)
Set the connect panel visible

Parameters:
show - is visible

getConnectPanel

IConnectPanel getConnectPanel()
Getter for connect panel

Returns:
the panel

setMayPause

void setMayPause(boolean mayPause)
Sets the pause button if pausing should be possible in the current situation

Parameters:
mayPause - pausing possible