|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | 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 | +--SGui
The SGui class is the Graphical User Interface for the Sokoban program
Inner classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected javax.swing.JTextField |
chatInput
|
protected javax.swing.JPanel |
chatPanel
|
protected javax.swing.JTextArea |
chatText
|
protected javax.swing.JButton |
continueButton
|
protected static boolean |
debugMode
The debug flag signifying if the game should return time accurately or always 1. |
protected javax.swing.JMenuItem |
gameEndGame
|
protected javax.swing.JMenuItem |
gameExit
|
protected javax.swing.JMenuItem |
gameHighScores
|
protected javax.swing.JMenuItem |
gameLevelEditor
|
protected javax.swing.JMenuItem |
gameLoad
|
protected javax.swing.JMenu |
gameMenu
|
protected javax.swing.JMenu |
gameNewGame
|
protected javax.swing.JMenuItem |
gameNewMultiplayerGame
|
protected javax.swing.JMenuItem |
gameNewSoloGame
|
protected javax.swing.JMenuItem |
gameOptChange
|
protected javax.swing.JMenu |
gameOptions
|
protected javax.swing.JMenuItem |
gameSave
|
protected javax.swing.JMenuItem |
helpAbout
|
protected javax.swing.JMenuItem |
helpInstructions
|
protected javax.swing.JMenu |
helpMenu
|
protected javax.swing.JMenuItem |
helpTutorial
|
protected SGui.KeyMonitor |
keyboardListener
Instance of KeyMonitor to listen to keyboard commands to control the robot while the game is being played. |
protected javax.swing.JMenuItem |
levelEditorExit
|
protected javax.swing.JMenuItem |
levelEditorHelpInstructions
|
protected javax.swing.JMenu |
levelEditorHelpMenu
|
protected javax.swing.JMenu |
levelEditorLevelMenu
|
protected javax.swing.JMenuItem |
levelEditorLoad
|
protected javax.swing.JMenuItem |
levelEditorNew
|
protected javax.swing.JMenuItem |
levelEditorOrg
|
protected javax.swing.JMenuItem |
levelEditorSave
|
protected javax.swing.JMenuItem |
levelGoTo
|
protected javax.swing.JMenu |
levelMenu
|
protected javax.swing.JMenuItem |
levelNext
|
protected javax.swing.JMenuItem |
levelPause
|
protected javax.swing.JMenuItem |
levelPrevious
|
protected javax.swing.JMenuItem |
levelReplay
|
protected javax.swing.JMenuItem |
levelRestart
|
protected javax.swing.JLabel |
levelScore
|
protected javax.swing.JMenuItem |
levelUndo
|
protected javax.swing.JButton |
mainHighScores
|
protected javax.swing.JButton |
mainLevelEditor
|
protected javax.swing.JButton |
mainMulti
|
protected javax.swing.JButton |
mainSolo
|
protected javax.swing.JPanel |
mapDisplay
The display panel where the MapRenderer will be drawn. |
protected javax.swing.JMenuBar |
menuBar
|
protected javax.swing.JLabel |
pauseScreen
The pause screen message. |
protected javax.swing.JButton |
sendChat
|
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, 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 | |
SGui(boolean debugFlag)
Constructor - initializes the window and displays the start screen |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handles the events passed to the Sokoban class ActionListener. |
void |
addKeyMonitor()
Adds a KeyMonitor |
void |
addText(java.lang.String str)
Displays the passed text in the chat window |
void |
endGame()
Ends the game and stops the statsMonitor Timer. |
void |
loadGame()
Show the load game dialog box. |
void |
loadMainMenu()
Change the topPanel to display the main menu. |
void |
pauseGame()
Disable the UI buttons not available during a pause game. |
void |
removeKeyMonitor()
Removes all KeyMonitors |
void |
resetStatDisplay()
Resets the stat display. |
void |
resumeGame()
Enable the UI buttons disabled after a pause game. |
void |
setLevelFinishedDisplay(int levelScore)
Displays the level finished screen giving the user's game statistics |
void |
setLevelName(java.lang.String name)
Changes the level name displayed to the user. |
void |
setMapVisible()
Change the game display to show the map. |
void |
setPauseDisplay()
Change the game display to show the pause screen and the map. |
java.lang.String |
showGoToDialog()
Show the go to level dialog box. |
void |
showHelpDialog(java.lang.String helpFile)
Show a dialog box displaying the instructions text file. |
void |
startGame(boolean multiplayer)
Initializes the topPanel to begin displaying the map. |
void |
updateStats()
Updates the stat display. |
protected void |
viewHighScores()
Displays the High Scores window |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
protected static boolean debugMode
protected javax.swing.JMenuBar menuBar
protected javax.swing.JMenu gameMenu
protected javax.swing.JMenu gameNewGame
protected javax.swing.JMenuItem gameNewSoloGame
protected javax.swing.JMenuItem gameNewMultiplayerGame
protected javax.swing.JMenuItem gameLoad
protected javax.swing.JMenuItem gameSave
protected javax.swing.JMenu gameOptions
protected javax.swing.JMenuItem gameOptChange
protected javax.swing.JMenuItem gameHighScores
protected javax.swing.JMenuItem gameLevelEditor
protected javax.swing.JMenuItem gameEndGame
protected javax.swing.JMenuItem gameExit
protected javax.swing.JMenu levelMenu
protected javax.swing.JMenuItem levelNext
protected javax.swing.JMenuItem levelPrevious
protected javax.swing.JMenuItem levelGoTo
protected javax.swing.JMenuItem levelRestart
protected javax.swing.JMenuItem levelPause
protected javax.swing.JMenuItem levelUndo
protected javax.swing.JMenuItem levelReplay
protected javax.swing.JMenu helpMenu
protected javax.swing.JMenuItem helpInstructions
protected javax.swing.JMenuItem helpTutorial
protected javax.swing.JMenuItem helpAbout
protected javax.swing.JButton mainSolo
protected javax.swing.JButton mainMulti
protected javax.swing.JButton mainHighScores
protected javax.swing.JButton mainLevelEditor
protected javax.swing.JButton continueButton
protected javax.swing.JLabel levelScore
protected javax.swing.JPanel chatPanel
protected javax.swing.JTextArea chatText
protected javax.swing.JTextField chatInput
protected javax.swing.JButton sendChat
protected javax.swing.JMenu levelEditorLevelMenu
protected javax.swing.JMenu levelEditorHelpMenu
protected javax.swing.JMenuItem levelEditorNew
protected javax.swing.JMenuItem levelEditorLoad
protected javax.swing.JMenuItem levelEditorSave
protected javax.swing.JMenuItem levelEditorOrg
protected javax.swing.JMenuItem levelEditorExit
protected javax.swing.JMenuItem levelEditorHelpInstructions
protected javax.swing.JPanel mapDisplay
protected javax.swing.JLabel pauseScreen
protected SGui.KeyMonitor keyboardListener
Constructor Detail |
public SGui(boolean debugFlag)
Method Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- an event passed to the ActionListener.
Pre-conditions:an event has occured.
Post-conditions:the Game class has been informed of the change and the user interface has been updated.
public void startGame(boolean multiplayer)
multiplayer
- signifies if the game is multiplayer and the
chat box should be included or not
Pre-conditions:none.
Post-conditions:the Game class has been initialized and the game begins.
public void loadMainMenu()
public void loadGame()
public void endGame()
Pre-conditions:a game is currently in progress.
Post-conditions:the statsMonitor has been stopped and the game has ended.
public java.lang.String showGoToDialog()
public void showHelpDialog(java.lang.String helpFile)
public void addKeyMonitor()
public void removeKeyMonitor()
public void setLevelFinishedDisplay(int levelScore)
levelScore
- the score received for finishing the level
Pre-conditions:a level has been finished.
Post-conditions:the level finished screen is displayed to the user.
public void pauseGame()
public void resumeGame()
public void updateStats()
public void resetStatDisplay()
public void setPauseDisplay()
public void setMapVisible()
public void setLevelName(java.lang.String name)
name
- the new level name to display to the user
Pre-conditions:the level has been changed.
Post-conditions:the level name displayed to the user is updated.
public void addText(java.lang.String str)
protected void viewHighScores()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |