|
|||||||||
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 | +--minesweeper.MainFrame
The MineSweeper
main frame.
Inner classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.AWTTreeLock |
Field Summary | |
private boolean |
bGameAllowed
The flag indicating whether the game is running. |
private JButton |
btnReset
The reset button. |
private static Color |
CANVASBACKGROUNDCOLOR
The canvas background color. |
private static ImageIcon |
HAPPYSMILEY
A smiling smiley. |
private int |
iInitialMines
The initial number of mines. |
private int |
iRemainingMines
The number of remaining mines. |
private long |
lStartTime
The date (in seconds since Epoch) at which the current play started. |
private MineField |
mfMineField
The mine field. |
private static ImageIcon |
SADSMILEY
A sad smiley. |
private JTextField |
tfMineCount
The text field displaying the number of remaining mines. |
private JTextField |
tfTimer
The text field displaying the elapsed time. |
private Timer |
tTimer
The time used to update second display. |
private static ImageIcon |
WONDERINGSMILEY
A wondering smiley. |
Fields inherited from class javax.swing.JFrame |
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis |
Fields inherited from class java.awt.Window |
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, warningString, windowListener, windowSerializedDataVersion |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
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 | |
MainFrame(int iColumns,
int iRows,
int iMines)
Creates a new MainFrame object. |
Method Summary | |
protected void |
gameOver()
Disables the mine field and reveals wrong mines. |
protected void |
refreshMineCountField()
Refreshes the text field that displays the number of remaining mines. |
protected void |
reset(boolean bFirstCall)
Resets the game. |
Methods inherited from class java.awt.Frame |
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
private static final Color CANVASBACKGROUNDCOLOR
private static final ImageIcon HAPPYSMILEY
private static final ImageIcon SADSMILEY
private static final ImageIcon WONDERINGSMILEY
private final JTextField tfMineCount
private final JTextField tfTimer
private final JButton btnReset
private MineField mfMineField
private int iInitialMines
private int iRemainingMines
private boolean bGameAllowed
private final Timer tTimer
private long lStartTime
Constructor Detail |
public MainFrame(int iColumns, int iRows, int iMines)
MainFrame
object.Method Detail |
protected void gameOver()
protected void reset(boolean bFirstCall)
bFirstCall
- indicates whether this is an initialisation and not a resetprotected void refreshMineCountField()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |