Class Dance

Class Dance

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----Dance

public class Dance
extends Applet
Dance - java.applet.Applet

java.applet.Applet for learning how to dance.

You can choose one of four dances and for every dance one of some figures and one of some music titels and view the animation of the figur synchron to the music.

The applet uses three threads for the animation and does an gread effort to make the animation as flickerless as possible.

Three attributes are currently supported:
english - use english texts
audio - default audio on/off
fatborder - use fat or thin border for the buttons.

Disclaimer:
Sorrie, my Java is better than my english. (My dancing is even better. :)
See Also:
Figur, Floor, Foot, Button, MEXButtonList, MEXButton, ToggleButton, Step

Variable Index

 o buttonFont
Font used for the buttons.
 o buttonFontBld
Bold font used for the buttons.
 o choiceFont
Font used for the sub-titels
 o engl
Use english or german for the strings
 o fatBorder
Should have the buttons a two pixel border or only a one pixel border.
 o figur
Currently active figur.
 o foots
Foot object.
 o smallFont
Small font, currently not used.
 o smallFontBld
Small font bold.
 o titleFont
Font used for the applet titel

Constructor Index

 o Dance()

Method Index

 o actionAnimationHelpButton()
Function will be called if the "help" button within the animation page is hit.
 o actionBackStepButton()
Function will be called if the "step backw." button is hit.
 o actionCommentButton(boolean)
Function will be called if the "slow/quick | toe/heel" button is hit.
 o actionDanceButton(int)
Function will be called if one of the dance buttons are hit.
 o actionFigurButton(int)
Function will be called, if one of the figur buttons are hit.
 o actionInfoButton()
Function will be called if the "dance info" button is hit.
 o actionMainHelpButton()
Function will be called if the "help" button within the main page is hit.
 o actionMenuButton()
Function will be called if the "menu" button is hit.
 o actionMusicButton(int)
Function will be called, if one of the music buttons are hit.
 o actionPlayButton()
Function will be called if the "play" button is hit.
 o actionPlayMusicButton()
Function will be called if the "test music" button is hit.
 o actionShowButton()
Function will be called if the "show dance" button is hit.
 o actionSoundButton(boolean)
Function will be called if the "audio on | slow motion" button is hit.
 o actionStepButton()
Function will be called if the "step forw." button is hit.
 o getAppletInfo()
returns some info about author, version and copyright of the applet
 o getCurDance()
 o getCurFigur()
 o getCurMusic()
 o getParameterInfo()
returns info about the parameters
 o init()
java.applet.Applet initialization function.
 o killFigur()
Change from the animation page back to the main page.
 o mouseDown(Event, int, int)
java.applet.Applet function: mouseDown() Calls button.mouseDown() to check for button hits.
 o mouseDrag(Event, int, int)
java.applet.Applet function: mouseDrag() Calls button.mouseDrag() to check for button hits.
 o mouseUp(Event, int, int)
java.applet.Applet function: mouseUp() Calls button.mouseUp() to check for button hits.
 o newFigur()
Change from the main page to the animation page.
 o paint(Graphics)
java.applet.Applet function: paint() Redraw completly the main (figur==null) or animation page (figur!=null).
 o setCurDance(int)
 o setCurFigur(int)
 o setCurMusic(int)
 o start()
 o stop()
java.applet.Applet function: stop() Stops the dancing and the audio.
 o toString()
Returns a String object representing.
 o update(Graphics)
java.applet.Applet function: update() Redraw only the changed things.
 o useAudio()
Should audio played while the animation runs?

Variables

 o engl
  public boolean engl
Use english or german for the strings
 o foots
  public Foot foots
Foot object. Needed for drawing foots.
 o titleFont
  public Font titleFont
Font used for the applet titel
 o choiceFont
  public Font choiceFont
Font used for the sub-titels
 o smallFont
  public Font smallFont
Small font, currently not used.
 o smallFontBld
  public Font smallFontBld
Small font bold. Used for showing the current selection.
 o buttonFont
  public Font buttonFont
Font used for the buttons.
 o buttonFontBld
  public Font buttonFontBld
Bold font used for the buttons.
 o figur
  public Figur figur
Currently active figur.
 o fatBorder
  public boolean fatBorder
Should have the buttons a two pixel border or only a one pixel border.

Constructors

 o Dance
  public Dance()

Methods

 o init
  public void init()
java.applet.Applet initialization function. Loads some fonts, reads the attributes "english", "audio" and "fatborder".
Overrides:
init in class Applet
 o start
  public void start()
Overrides:
start in class Applet
 o paint
  public void paint(Graphics g)
java.applet.Applet function: paint() Redraw completly the main (figur==null) or animation page (figur!=null).
Overrides:
paint in class Component
 o update
  public void update(Graphics g)
java.applet.Applet function: update() Redraw only the changed things.
Overrides:
update in class Component
 o stop
  public void stop()
java.applet.Applet function: stop() Stops the dancing and the audio.
Overrides:
stop in class Applet
 o getAppletInfo
  public String getAppletInfo()
returns some info about author, version and copyright of the applet
Overrides:
getAppletInfo in class Applet
 o getParameterInfo
  public String[][] getParameterInfo()
returns info about the parameters
Overrides:
getParameterInfo in class Applet
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
java.applet.Applet function: mouseDown() Calls button.mouseDown() to check for button hits.
Overrides:
mouseDown in class Component
See Also:
mouseDown
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
java.applet.Applet function: mouseUp() Calls button.mouseUp() to check for button hits.
Overrides:
mouseUp in class Component
See Also:
mouseUp
 o mouseDrag
  public boolean mouseDrag(Event evt,
                           int x,
                           int y)
java.applet.Applet function: mouseDrag() Calls button.mouseDrag() to check for button hits.
Overrides:
mouseDrag in class Component
See Also:
mouseDrag
 o getCurDance
  public int getCurDance()
 o getCurFigur
  public int getCurFigur()
 o getCurMusic
  public int getCurMusic()
 o setCurDance
  public void setCurDance(int num)
 o setCurFigur
  public void setCurFigur(int num)
 o setCurMusic
  public void setCurMusic(int num)
 o killFigur
  public void killFigur()
Change from the animation page back to the main page.
 o newFigur
  public synchronized void newFigur()
Change from the main page to the animation page. Creates an object for the chooseen dance/figur.
 o useAudio
  public boolean useAudio()
Should audio played while the animation runs?
 o actionMenuButton
  public void actionMenuButton()
Function will be called if the "menu" button is hit. Change from the animation page back to the main page.
See Also:
action
 o actionStepButton
  public void actionStepButton()
Function will be called if the "step forw." button is hit. Does one step forward.
See Also:
stepForw, action
 o actionBackStepButton
  public void actionBackStepButton()
Function will be called if the "step backw." button is hit. Does one step backward.
See Also:
stepBackw, action
 o actionPlayButton
  public void actionPlayButton()
Function will be called if the "play" button is hit. Starts the animation. If an animation is already running, stops it.
See Also:
action
 o actionDanceButton
  public void actionDanceButton(int Bnum)
Function will be called if one of the dance buttons are hit. Sets the other (figur/music) buttons new.
See Also:
action
 o actionFigurButton
  public void actionFigurButton(int Bnum)
Function will be called, if one of the figur buttons are hit.
See Also:
action
 o actionMusicButton
  public void actionMusicButton(int Bnum)
Function will be called, if one of the music buttons are hit.
See Also:
action
 o actionShowButton
  public void actionShowButton()
Function will be called if the "show dance" button is hit. Changes from the main page to the animation page.
See Also:
action
 o actionInfoButton
  public void actionInfoButton()
Function will be called if the "dance info" button is hit. Opens an URL with information about the currently selected dance.
See Also:
action
 o actionPlayMusicButton
  public void actionPlayMusicButton()
Function will be called if the "test music" button is hit. Start playing the selected music.
See Also:
action
 o actionMainHelpButton
  public void actionMainHelpButton()
Function will be called if the "help" button within the main page is hit. Open an URL to a help page.
See Also:
action
 o actionAnimationHelpButton
  public void actionAnimationHelpButton()
Function will be called if the "help" button within the animation page is hit. Open an URL to a help page.
See Also:
action
 o actionSoundButton
  public void actionSoundButton(boolean on)
Function will be called if the "audio on | slow motion" button is hit.
Parameters:
on - state of the toggle button.
See Also:
action
 o actionCommentButton
  public void actionCommentButton(boolean usehb)
Function will be called if the "slow/quick | toe/heel" button is hit.
Parameters:
usehb - state of the toggle button (use heel/toe).
See Also:
action, useComStrHT, useComStrTime
 o toString
  public String toString()
Returns a String object representing.
Overrides:
toString in class Component