All Packages Class Hierarchy This Package Previous Next Index
Class JavaGO.JavaGO
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----JavaGO.JavaGO
- public class JavaGO
- extends Applet
- implements Runnable, Constants
Main class : JavaGO
-
control_game
- ControlGame object that control the game
-
frame
- Frame for a floating window
-
game
- Game object including all the moves of the game
-
goban
- Goban object where the game is played
-
goban_image
- GO-ban image
-
info_javago
- InfoJavaGO object showing JavaGO information
-
info_score
- InfoScore object showing score of the current game played on the goban
-
runner
- Applet thread
-
sound_ko
- Sound for a bad click
-
sound_ok
- Sound for a good click
-
stone
- Stone images for black and white stones
-
JavaGO()
-
-
addAll(Container)
- Adding of all the components in the container that is either main applet, either frame :
- control_game : control_game added at the top (or North)
- goban : goban added in the center
- info_score : info_score added on the left (or West)
- info_javago : info_javago added on the bottom (or South)
-
addGoban()
-
-
appendText(String)
- append Text
-
appendTextln(String)
- append newline + Text
-
destroy()
- JavaGO destroy
-
drawBackground(Graphics, Dimension, ImageObserver)
- Draw the background, repeat the image as many times as necessary.
-
drawStoneImage(Graphics, int, int, int, int, ImageObserver)
- Draw one stone image of the specific size
If stone image not found draw black or white full circle.
-
floatWindow()
- Toggle float window or not
Remove all components from one container (main applet or frame)
and add all of them on the other
-
fullWindow()
- Toggle full window on or off
If float window operate on frame object else on main applet
Add or remove all components except goban (ie control_game, info_score, info_javago)
-
init()
- JavaGO init, call initMedias, repaint and then initComponent.
-
initComponents()
- Init of javaGO components
Creation (new) of :
- frame : Frame object for the support of the floating window (after "o" action)
- goban : Goban object where the game is played
- game : Game object including all the moves of the game
- control_game : ControlGame object that control the game
- info_score : InfoScore object showing score of the current game played on the goban
- info_javago : InfoJavaGO object showing JavaGO information
-
initMedias()
- Init of medias : images
- gob.gif : backround goban GIF image
- black.gif : black stone GIF image
- white.gif : white stone GIF image
and sounds :
- ok.au : sound for correct moves
- ko.au : sound for incorrect moves
-
koPlay()
- Play ko sound
-
newGame()
- Create a new game : retrieve game_size in control field, call game.init (JavaGO.Game.init())
and (JavaGO.Goban.init()) goban.init.
-
okPlay()
- Play ok sound
-
paint(Graphics)
- JavaGO paint : just draw the bacground with background image.
-
removeAllComponents()
-
-
run()
- JavaGO run
-
start()
- JavaGO start, start the thread
-
stop()
- JavaGO stop, stop the thread
-
update(Graphics)
- JavaGO update : just call paint
runner
protected Thread runner
- Applet thread
sound_ok
protected static AudioClip sound_ok
- Sound for a good click
sound_ko
protected static AudioClip sound_ko
- Sound for a bad click
stone
protected static Image[] stone
- Stone images for black and white stones
goban_image
protected static Image goban_image
- GO-ban image
frame
protected Frame frame
- Frame for a floating window
goban
protected Goban goban
- Goban object where the game is played
game
public Game game
- Game object including all the moves of the game
control_game
protected ControlGame control_game
- ControlGame object that control the game
info_score
protected InfoScore info_score
- InfoScore object showing score of the current game played on the goban
info_javago
protected InfoJavaGO info_javago
- InfoJavaGO object showing JavaGO information
JavaGO
public JavaGO()
init
public void init()
- JavaGO init, call initMedias, repaint and then initComponent.
- Overrides:
- init in class Applet
initMedias
protected void initMedias()
- Init of medias : images
- gob.gif : backround goban GIF image
- black.gif : black stone GIF image
- white.gif : white stone GIF image
and sounds :
- ok.au : sound for correct moves
- ko.au : sound for incorrect moves
initComponents
protected void initComponents()
- Init of javaGO components
Creation (new) of :
- frame : Frame object for the support of the floating window (after "o" action)
- goban : Goban object where the game is played
- game : Game object including all the moves of the game
- control_game : ControlGame object that control the game
- info_score : InfoScore object showing score of the current game played on the goban
- info_javago : InfoJavaGO object showing JavaGO information
addAll
protected void addAll(Container container)
- Adding of all the components in the container that is either main applet, either frame :
- control_game : control_game added at the top (or North)
- goban : goban added in the center
- info_score : info_score added on the left (or West)
- info_javago : info_javago added on the bottom (or South)
addGoban
protected void addGoban()
removeAllComponents
protected void removeAllComponents()
paint
public void paint(Graphics g)
- JavaGO paint : just draw the bacground with background image.
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- JavaGO update : just call paint
- Overrides:
- update in class Container
newGame
protected void newGame()
- Create a new game : retrieve game_size in control field, call game.init (JavaGO.Game.init())
and (JavaGO.Goban.init()) goban.init.
fullWindow
protected void fullWindow()
- Toggle full window on or off
If float window operate on frame object else on main applet
Add or remove all components except goban (ie control_game, info_score, info_javago)
floatWindow
protected void floatWindow()
- Toggle float window or not
Remove all components from one container (main applet or frame)
and add all of them on the other
drawStoneImage
public static void drawStoneImage(Graphics g,
int color,
int x,
int y,
int size,
ImageObserver observer)
- Draw one stone image of the specific size
If stone image not found draw black or white full circle.
drawBackground
public static void drawBackground(Graphics g,
Dimension size,
ImageObserver observer)
- Draw the background, repeat the image as many times as necessary.
If image not found draw orange rectangle as background.
okPlay
public static void okPlay()
- Play ok sound
koPlay
public static void koPlay()
- Play ko sound
run
public void run()
- JavaGO run
start
public void start()
- JavaGO start, start the thread
- Overrides:
- start in class Applet
stop
public void stop()
- JavaGO stop, stop the thread
- Overrides:
- stop in class Applet
destroy
public void destroy()
- JavaGO destroy
- Overrides:
- destroy in class Applet
appendText
public void appendText(String s)
- append Text
appendTextln
public void appendTextln(String s)
- append newline + Text
All Packages Class Hierarchy This Package Previous Next Index