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


Variable Index

 o control_game
ControlGame object that control the game
 o frame
Frame for a floating window
 o game
Game object including all the moves of the game
 o goban
Goban object where the game is played
 o goban_image
GO-ban image
 o info_javago
InfoJavaGO object showing JavaGO information
 o info_score
InfoScore object showing score of the current game played on the goban
 o runner
Applet thread
 o sound_ko
Sound for a bad click
 o sound_ok
Sound for a good click
 o stone
Stone images for black and white stones

Constructor Index

 o JavaGO()

Method Index

 o addAll(Container)
Adding of all the components in the container that is either main applet, either frame :
 o addGoban()
 o appendText(String)
append Text
 o appendTextln(String)
append newline + Text
 o destroy()
JavaGO destroy
 o drawBackground(Graphics, Dimension, ImageObserver)
Draw the background, repeat the image as many times as necessary.
 o 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.
 o floatWindow()
Toggle float window or not Remove all components from one container (main applet or frame) and add all of them on the other
 o 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)
 o init()
JavaGO init, call initMedias, repaint and then initComponent.
 o initComponents()
Init of javaGO components
Creation (new) of :
 o initMedias()
Init of medias : images and sounds :
 o koPlay()
Play ko sound
 o newGame()
Create a new game : retrieve game_size in control field, call game.init (JavaGO.Game.init()) and (JavaGO.Goban.init()) goban.init.
 o okPlay()
Play ok sound
 o paint(Graphics)
JavaGO paint : just draw the bacground with background image.
 o removeAllComponents()
 o run()
JavaGO run
 o start()
JavaGO start, start the thread
 o stop()
JavaGO stop, stop the thread
 o update(Graphics)
JavaGO update : just call paint

Variables

 o runner
protected Thread runner
Applet thread

 o sound_ok
protected static AudioClip sound_ok
Sound for a good click

 o sound_ko
protected static AudioClip sound_ko
Sound for a bad click

 o stone
protected static Image[] stone
Stone images for black and white stones

 o goban_image
protected static Image goban_image
GO-ban image

 o frame
protected Frame frame
Frame for a floating window

 o goban
protected Goban goban
Goban object where the game is played

 o game
public Game game
Game object including all the moves of the game

 o control_game
protected ControlGame control_game
ControlGame object that control the game

 o info_score
protected InfoScore info_score
InfoScore object showing score of the current game played on the goban

 o info_javago
protected InfoJavaGO info_javago
InfoJavaGO object showing JavaGO information

Constructors

 o JavaGO
public JavaGO()

Methods

 o init
public void init()
JavaGO init, call initMedias, repaint and then initComponent.

Overrides:
init in class Applet
 o initMedias
protected void initMedias()
Init of medias : images and sounds :

 o initComponents
protected void initComponents()
Init of javaGO components
Creation (new) of :

 o addAll
protected void addAll(Container container)
Adding of all the components in the container that is either main applet, either frame :

 o addGoban
protected void addGoban()
 o removeAllComponents
protected void removeAllComponents()
 o paint
public void paint(Graphics g)
JavaGO paint : just draw the bacground with background image.

Overrides:
paint in class Container
 o update
public void update(Graphics g)
JavaGO update : just call paint

Overrides:
update in class Container
 o 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.

 o 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)

 o 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

 o 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.

 o 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.

 o okPlay
public static void okPlay()
Play ok sound

 o koPlay
public static void koPlay()
Play ko sound

 o run
public void run()
JavaGO run

 o start
public void start()
JavaGO start, start the thread

Overrides:
start in class Applet
 o stop
public void stop()
JavaGO stop, stop the thread

Overrides:
stop in class Applet
 o destroy
public void destroy()
JavaGO destroy

Overrides:
destroy in class Applet
 o appendText
public void appendText(String s)
append Text

 o appendTextln
public void appendTextln(String s)
append newline + Text


All Packages  Class Hierarchy  This Package  Previous  Next  Index