Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
All Classes
A
B
C
G
H
I
K
L
M
N
P
S
T
U
V
W
A
aBoard
- Static variable in class
HangmanApp
reference to the Board instance
actionPerformed(ActionEvent)
- Method in class
Controller
Handle a button press by the user.
addLetter(char)
- Method in class
Board
Add a correctly guessed letter to user's word.
appUI
- Static variable in class
HangmanApp
reference to the UI instance
B
Board
- Class in
<Unnamed>
Board is the game board in a hangman game.
Board()
- Constructor for class
Board
Default constructor
Board(Board)
- Constructor for class
Board
Copy constructor returns a copy of the given board.
buttonPanel
- Variable in class
SwingUI
A panel to contain the row of buttons
C
console
- Variable in class
SimpleUI
input stream for the keyboard
contains(char)
- Method in class
Board
Determine if the guessed letter is part of the hidden word.
Controller
- Class in
<Unnamed>
Controller handles user events in the UI.
Controller(HangmanUI)
- Constructor for class
Controller
Construct a controller to respond to the specified view
controller
- Static variable in class
HangmanApp
reference to the Controller instance
controller
- Variable in class
SimpleUI
controller
- Variable in class
SwingUI
Reference to the controller listening to user actions
current
- Variable in class
Wordlist
Current position in list
G
game
- Variable in class
Controller
Reference to the game we are controlling
Game
- Class in
<Unnamed>
Game represents the Hangman game control logic.
Game(Board, I_WordSource)
- Constructor for class
Game
Construct a Game.
game
- Static variable in class
HangmanApp
reference to the HangmanLogic instance
gameBoard
- Variable in class
Game
the playing area
gameOver()
- Method in class
Game
Determine if the game is over.
getBoardCopy()
- Method in class
Game
Return a copy of the board.
getBoardDisplay()
- Method in class
Board
Format the current state of the board for display.
getMove()
- Method in class
SimpleUI
Asks the user for a move until the user enters a move that is valid.
getSecretWord()
- Method in interface
I_WordSource
Obtain a secret word from some word source.
getSecretWord()
- Method in class
NetWordClient
Obtain a secret word from a random word server.
getSecretWord()
- Method in class
Wordlist
Obtain a secret word from the word list.
getTurns()
- Method in class
Game
Accessor to turn count.
getUserWord()
- Method in class
Board
Accessor to user word for testing
guessCount
- Variable in class
Game
The count of wrong guesses
H
handlePlayAgainChoice(int)
- Method in class
Controller
Handle the user's choice for playing again (yes/no)
HangmanApp
- Class in
<Unnamed>
This is the main class for the solitaire Hangman application.
HangmanApp()
- Constructor for class
HangmanApp
HangmanUI
- Interface in
<Unnamed>
HangmanUI is a Java Interface that describes the behavior of a user interface for the solitaire Hangman game.
hiddenWord
- Variable in class
Board
The hidden word the player tries to guess
I
I_WordSource
- Interface in
<Unnamed>
WordSource is a source of secret words for word puzzle games like Hangman.
initComponents()
- Method in class
SwingUI
This method is called from within the constructor to initialize the form.
inputSource
- Variable in class
SimpleUI
isLoser()
- Method in class
Game
Determine if the player lost the game (ran out of turns)
isWin()
- Method in class
Board
Determine if the player won (guessed all the letters in the hidden word).
isWin()
- Method in class
Game
Determine if the player won the game.
K
kGuessLimit
- Static variable in class
Game
The limit on number of incorrect guesses allowed.
kMaxWordLength
- Variable in class
Board
kWordFile
- Static variable in class
Wordlist
The name of the file containing words.
L
lblTitle
- Variable in class
SwingUI
The title of the game
lblTurns
- Variable in class
SwingUI
A label for the turn counter
LetterButtons
- Variable in class
SwingUI
array of buttons for the letters of the alphabet
list
- Variable in class
Wordlist
the list of words
M
main(String[])
- Static method in class
HangmanApp
The entry point for this application.
main(String[])
- Static method in class
NetWordClient
a local main for unit testing
makeButtons()
- Method in class
SwingUI
Create the 26 letter buttons, one for each letter of the alphabet.
makeMove(char)
- Method in class
Board
Process a user guess.
N
NetWordClient
- Class in
<Unnamed>
Hangman network client.
NetWordClient()
- Constructor for class
NetWordClient
newGame()
- Method in class
Game
Start a new round of hangman by obtaining a hidden word and giving it to the board.
P
playAgain()
- Method in interface
HangmanUI
Handle end of game, asking if the player wants another game If yes, start a new game, otherwise exit.
playAgain()
- Method in class
SimpleUI
Handle end of game, asking if the player wants another game If yes, start a new game, otherwise exit.
playAgain()
- Method in class
SwingUI
Handle end of game, asking if the player wants another game If yes, start a new game, otherwise exit.
printUsage()
- Static method in class
HangmanApp
processMove(char)
- Method in class
Game
Game logic for handling each user guess
S
secret
- Variable in class
Game
The hidden word
sequential
- Variable in class
Wordlist
retrieve words in order? (for testing)
setControl(Controller)
- Method in interface
HangmanUI
Set reference to the controller that handles our input.
setControl(Controller)
- Method in class
SimpleUI
Make the interface visible
setControl(Controller)
- Method in class
SwingUI
Set reference to the controller that handles our input.
setGame(Game)
- Method in class
Controller
Set the reference to the game we are controlling
setHidden(String)
- Method in class
Board
Initialize the hidden word for a game and reset user's word.
setReadable(Readable)
- Method in class
SimpleUI
Provide an input source for this user interface.
setVisible(boolean)
- Method in interface
HangmanUI
Start the display.
setVisible(boolean)
- Method in class
SimpleUI
The main event loop
showBoard(Game)
- Method in class
SimpleUI
Display the current state of the board.
showBoard(Game)
- Method in class
SwingUI
Display the current state of the board.
showLose(String)
- Method in interface
HangmanUI
Display that the player lost the game.
showLose(String)
- Method in class
SimpleUI
Display that the player lost the game.
showLose(String)
- Method in class
SwingUI
Display that the player lost the game.
showWin()
- Method in interface
HangmanUI
Display that the player won the game.
showWin()
- Method in class
SimpleUI
Display that the player won the game.
showWin()
- Method in class
SwingUI
Display that the player won the game.
SimpleUI
- Class in
<Unnamed>
Default User interface for the Hangman game.
SimpleUI()
- Constructor for class
SimpleUI
Construct this user interface.
siteurl
- Variable in class
NetWordClient
Site that returns a randomword
solution()
- Method in class
Game
Accessor to the hidden word.
start()
- Method in class
Game
Start this game.
SwingUI
- Class in
<Unnamed>
This is a Swing graphical user interface to the hangman game.
SwingUI()
- Constructor for class
SwingUI
Creates new frame to contain all the user interface components for the game.
T
txtBoard
- Variable in class
SwingUI
A text area for displaying the guessed letters
U
update(Observable, Object)
- Method in interface
HangmanUI
Update the ui when notified by the game.
update(Observable, Object)
- Method in class
SimpleUI
Update the ui when notified by the game.
update(Observable, Object)
- Method in class
SwingUI
Update the ui when notified by the game.
userWord
- Variable in class
Board
The "user word" of letters the player has guessed correctly placed in their proper position in the word.
V
view
- Variable in class
Controller
Reference to the view we are responding to
W
Wordlist
- Class in
<Unnamed>
Wordlist is a list of words to use in Hangman.
Wordlist(boolean)
- Constructor for class
Wordlist
Construct a word list to be accessed either sequentially (for testing) or randomly.
words
- Variable in class
Game
the source of secret words.
A
B
C
G
H
I
K
L
M
N
P
S
T
U
V
W
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
All Classes