All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class kpalin.alabra.AppForm

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----kpalin.alabra.AppForm

public class AppForm
extends Frame
Here we create a window for application and prepare data for the game. This is the highest class specificly for application so here we have to handle file management and menu stuf.

Author:
Kimmo Palin

Variable Index

 o chessGame
This is the real gamething.
 o frameMenu
Menubar for the window.
 o saveGame
An object controlling saving and loading of the game.

Constructor Index

 o AppForm(String, String, ChessSettings)
Creates new application window.

Method Index

 o exitApp(int)
This is only method that can kill the application
 o loadGame()
Loads a saved file.
 o pause()
Pause if iconified.
 o readImages(String)
Here we start reading the Images.
 o resetGame()
Reseting the game
 o saveGame()
Saves this game with old name or asks a new one if this is a first save.
 o saveGameAs()
Asks user a name of a file where to save this game.
 o unpause()
Unpause if de-iconified.

Variables

 o frameMenu
 private ChessAppMB frameMenu
Menubar for the window. Just in case taken here if we hapen to need it sometimes somewhere.

 o chessGame
 private ChessPlay chessGame
This is the real gamething. From this on, applet and application are all alike.

 o saveGame
 private FileIO saveGame
An object controlling saving and loading of the game.

Constructors

 o AppForm
 AppForm(String fname,
         String gifdir,
         ChessSettings set)
Creates new application window.

Parameters:
fname - Name of the file to be loaded.
gifdir - Name of the directory where we can find the gifs for pieces.
tileWidth - Width (and height) of a tile on the chessboard.

Methods

 o loadGame
 public void loadGame()
Loads a saved file.

 o saveGame
 public void saveGame()
Saves this game with old name or asks a new one if this is a first save.

 o saveGameAs
 public void saveGameAs()
Asks user a name of a file where to save this game.

 o resetGame
 void resetGame()
Reseting the game

 o pause
 void pause()
Pause if iconified.

See Also:
ChessPlay, CtrlPanel
 o unpause
 void unpause()
Unpause if de-iconified.

See Also:
ChessPlay, CtrlPanel
 o exitApp
 void exitApp(int code)
This is only method that can kill the application

Parameters:
code - Exit code.
 o readImages
 void readImages(String basedir)
Here we start reading the Images. This code is specific to application and can't be shared with applet.

Parameters:
basedir - Directory where the images should be found.

All Packages  Class Hierarchy  This Package  Previous  Next  Index