|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame jrummikub.view.impl.View
public class View
Implementation of the top-level view interface
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Nested classes/interfaces inherited from interface jrummikub.view.IView |
---|
jrummikub.view.IView.BottomPanelType |
Field Summary |
---|
Fields inherited from class javax.swing.JFrame |
---|
EXIT_ON_CLOSE |
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 |
void |
enablePauseMode(boolean enable)
Enable/disable pause mode |
void |
enableSave(boolean enable)
Enables/disables saving in menu bar |
jrummikub.util.IEvent |
getAcknowledgeConnectionLostEvent()
The acknoledge connection lost event is emitted when the user has acknowledged that the network connection was lost |
jrummikub.util.IEvent |
getAcknowledgeInvalidEvent()
The start turn event is emitted when the player knows what invalid stones he played |
jrummikub.view.IConnectPanel |
getConnectPanel()
Getter for connect panel |
jrummikub.util.IEvent |
getEndPauseEvent()
The end pause event is emitted when the user wants to sresume the game after a pause |
jrummikub.util.IEvent |
getEndProgramEvent()
The quit event is emitted when the player wants to quit the game |
jrummikub.view.IGameListPanel |
getGameListPanel()
Getter for game list panel |
jrummikub.view.IHandPanel |
getHandPanel()
|
jrummikub.util.IEvent |
getLoadEvent()
The load event is emitted when the user wants to load a previously saved game state |
jrummikub.util.IEvent1<java.io.File> |
getLoadFileEvent()
The load file event is emitted when the user chose to discard the current game to save another |
jrummikub.view.ILoginPanel |
getLoginPanel()
Getter for login panel |
jrummikub.util.IEvent |
getMenuNewGameEvent()
The menu new game event is emitted when the user selects the new game menu entry |
jrummikub.util.IEvent |
getNetworkGameEvent()
The network game event is emitted when the user chooses a network game |
jrummikub.util.IEvent |
getNewGameEvent()
Is emitted if the player wants to end the game and start a new one |
jrummikub.util.IEvent |
getNewRoundEvent()
The new round event is emitted when the player wants to start a new round |
jrummikub.util.IEvent |
getPauseEvent()
The pause event is emitted when the user wants to pause the current turn |
jrummikub.view.IPlayerPanel |
getPlayerPanel()
Returns the player panel |
jrummikub.util.IEvent |
getQuitEvent()
The quit event is emitted when the user wants to leave the application |
jrummikub.view.IQuitWarningPanel |
getQuitWarningPanel()
Getter for quit warning panel |
jrummikub.util.IEvent1<java.io.File> |
getSaveEvent()
The save event is emitted when the user wants to save the current game state |
jrummikub.view.IScorePanel |
getScorePanel()
Returns the score panel |
jrummikub.view.ISettingsPanel |
getSettingsPanel()
Returns the settings panel |
jrummikub.view.ISidePanel |
getSidePanel()
Returns the side panel |
jrummikub.util.IEvent |
getStartTurnEvent()
The start turn event is emitted when the player wants to start his turn |
jrummikub.view.ITablePanel |
getTablePanel()
Returns the table |
void |
load()
Loading a game |
void |
resetLoginPanel()
Clears user input of the resetLoginPanel |
void |
setBottomPanel(jrummikub.view.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<jrummikub.model.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<jrummikub.model.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 |
---|
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, 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, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, 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 |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Constructor Detail |
---|
public View()
Method Detail |
---|
public jrummikub.view.ISettingsPanel getSettingsPanel()
jrummikub.view.IView
getSettingsPanel
in interface jrummikub.view.IView
public jrummikub.view.ILoginPanel getLoginPanel()
jrummikub.view.IView
getLoginPanel
in interface jrummikub.view.IView
public jrummikub.view.IScorePanel getScorePanel()
jrummikub.view.IView
getScorePanel
in interface jrummikub.view.IView
public jrummikub.view.ITablePanel getTablePanel()
jrummikub.view.IView
getTablePanel
in interface jrummikub.view.IView
public jrummikub.view.ISidePanel getSidePanel()
jrummikub.view.IView
getSidePanel
in interface jrummikub.view.IView
public jrummikub.view.IHandPanel getHandPanel()
getHandPanel
in interface jrummikub.view.IView
public jrummikub.view.IPlayerPanel getPlayerPanel()
jrummikub.view.IView
getPlayerPanel
in interface jrummikub.view.IView
public jrummikub.view.IQuitWarningPanel getQuitWarningPanel()
jrummikub.view.IView
getQuitWarningPanel
in interface jrummikub.view.IView
public jrummikub.view.IConnectPanel getConnectPanel()
jrummikub.view.IView
getConnectPanel
in interface jrummikub.view.IView
public jrummikub.view.IGameListPanel getGameListPanel()
jrummikub.view.IView
getGameListPanel
in interface jrummikub.view.IView
public jrummikub.util.IEvent getMenuNewGameEvent()
jrummikub.view.IView
getMenuNewGameEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent1<java.io.File> getLoadFileEvent()
jrummikub.view.IView
getLoadFileEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getLoadEvent()
jrummikub.view.IView
getLoadEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent1<java.io.File> getSaveEvent()
jrummikub.view.IView
getSaveEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getPauseEvent()
jrummikub.view.IView
getPauseEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getEndPauseEvent()
jrummikub.view.IView
getEndPauseEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getNetworkGameEvent()
jrummikub.view.IView
getNetworkGameEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getQuitEvent()
jrummikub.view.IView
getQuitEvent
in interface jrummikub.view.IView
public void clearView()
jrummikub.view.IView
clearView
in interface jrummikub.view.IView
public void showLoadingError()
jrummikub.view.IView
showLoadingError
in interface jrummikub.view.IView
public void showServerStartupError(boolean alreadyRunning)
jrummikub.view.IView
showServerStartupError
in interface jrummikub.view.IView
alreadyRunning
- true when the server is already running on this machinepublic void enableSave(boolean enable)
jrummikub.view.IView
enableSave
in interface jrummikub.view.IView
enable
- saving possiblepublic void load()
jrummikub.view.IView
load
in interface jrummikub.view.IView
public void setMayPause(boolean mayPause)
jrummikub.view.IView
setMayPause
in interface jrummikub.view.IView
mayPause
- pausing possiblepublic void enablePauseMode(boolean enable)
jrummikub.view.IView
enablePauseMode
in interface jrummikub.view.IView
enable
- true = enablepublic void setSelectedStones(java.util.Collection<jrummikub.model.Stone> stones)
jrummikub.view.IView
setSelectedStones
in interface jrummikub.view.IView
stones
- the stones to be painted selectedpublic void setInvalidStoneSets(java.util.Collection<jrummikub.model.StoneSet> sets)
jrummikub.view.IView
setInvalidStoneSets
in interface jrummikub.view.IView
sets
- invalid sets on tablepublic void showSettingsPanel(boolean show)
jrummikub.view.IView
showSettingsPanel
in interface jrummikub.view.IView
show
- specifies if the panel shall be shown or hiddenpublic void showLoginPanel(boolean show)
jrummikub.view.IView
showLoginPanel
in interface jrummikub.view.IView
show
- true = login panel is shownpublic void resetLoginPanel()
jrummikub.view.IView
resetLoginPanel
in interface jrummikub.view.IView
public void showGameListPanel(boolean show)
jrummikub.view.IView
showGameListPanel
in interface jrummikub.view.IView
show
- true = showpublic void showScorePanel(boolean show)
jrummikub.view.IView
showScorePanel
in interface jrummikub.view.IView
show
- specifies if the panel shall be shown or hiddenpublic void showSidePanel(boolean show)
jrummikub.view.IView
showSidePanel
in interface jrummikub.view.IView
show
- true to showpublic void showQuitWarningPanel(boolean show)
jrummikub.view.IView
showQuitWarningPanel
in interface jrummikub.view.IView
show
- is visiblepublic void showConnectPanel(boolean show)
jrummikub.view.IView
showConnectPanel
in interface jrummikub.view.IView
show
- is visiblepublic void setCurrentPlayerName(java.lang.String playerName)
jrummikub.view.IView
setCurrentPlayerName
in interface jrummikub.view.IView
playerName
- the player namepublic void setInitialMeldError(int points)
jrummikub.view.IView
setInitialMeldError
in interface jrummikub.view.IView
points
- initial meld thresholdpublic void setInitialMeldFirstError()
jrummikub.view.IView
setInitialMeldFirstError
in interface jrummikub.view.IView
public void setCurrentPlayerColor(java.awt.Color color)
jrummikub.view.IView
setCurrentPlayerColor
in interface jrummikub.view.IView
color
- the current player's colorpublic void setRedealedPlayerName(java.lang.String name)
jrummikub.view.IView
setRedealedPlayerName
in interface jrummikub.view.IView
name
- the player namepublic void setLastStonePlayerName(java.lang.String name)
jrummikub.view.IView
setLastStonePlayerName
in interface jrummikub.view.IView
name
- the player namepublic void setCurrentPlayerHasLaidOut(boolean hasLaidOut)
jrummikub.view.IView
setCurrentPlayerHasLaidOut
in interface jrummikub.view.IView
hasLaidOut
- specifies if the current player has laid out or notpublic jrummikub.util.IEvent getStartTurnEvent()
jrummikub.view.IView
getStartTurnEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getAcknowledgeInvalidEvent()
jrummikub.view.IView
getAcknowledgeInvalidEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getAcknowledgeConnectionLostEvent()
jrummikub.view.IView
getAcknowledgeConnectionLostEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getNewRoundEvent()
jrummikub.view.IView
getNewRoundEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getNewGameEvent()
jrummikub.view.IView
getNewGameEvent
in interface jrummikub.view.IView
public jrummikub.util.IEvent getEndProgramEvent()
jrummikub.view.IView
getEndProgramEvent
in interface jrummikub.view.IView
public void setBottomPanel(jrummikub.view.IView.BottomPanelType type)
jrummikub.view.IView
setBottomPanel
in interface jrummikub.view.IView
type
- the type of the bottom panelpublic void setStoneCollectionHidden(boolean enable)
jrummikub.view.IView
setStoneCollectionHidden
in interface jrummikub.view.IView
enable
- showing collection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |