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
-
buttonFont
- Font used for the buttons.
-
buttonFontBld
- Bold font used for the buttons.
-
choiceFont
- Font used for the sub-titels
-
engl
- Use english or german for the strings
-
fatBorder
- Should have the buttons a two pixel border or only a one pixel border.
-
figur
- Currently active figur.
-
foots
- Foot object.
-
smallFont
- Small font, currently not used.
-
smallFontBld
- Small font bold.
-
titleFont
- Font used for the applet titel
-
Dance()
-
-
actionAnimationHelpButton()
- Function will be called if the "help" button within the animation page is hit.
-
actionBackStepButton()
- Function will be called if the "step backw." button is hit.
-
actionCommentButton(boolean)
- Function will be called if the "slow/quick | toe/heel" button is hit.
-
actionDanceButton(int)
- Function will be called if one of the dance buttons are hit.
-
actionFigurButton(int)
- Function will be called, if one of the figur buttons are hit.
-
actionInfoButton()
- Function will be called if the "dance info" button is hit.
-
actionMainHelpButton()
- Function will be called if the "help" button within the main page is hit.
-
actionMenuButton()
- Function will be called if the "menu" button is hit.
-
actionMusicButton(int)
- Function will be called, if one of the music buttons are hit.
-
actionPlayButton()
- Function will be called if the "play" button is hit.
-
actionPlayMusicButton()
- Function will be called if the "test music" button is hit.
-
actionShowButton()
- Function will be called if the "show dance" button is hit.
-
actionSoundButton(boolean)
- Function will be called if the "audio on | slow motion" button is hit.
-
actionStepButton()
- Function will be called if the "step forw." button is hit.
-
getAppletInfo()
- returns some info about author, version and copyright of the applet
-
getCurDance()
-
-
getCurFigur()
-
-
getCurMusic()
-
-
getParameterInfo()
- returns info about the parameters
-
init()
- java.applet.Applet initialization function.
-
killFigur()
- Change from the animation page back to the main page.
-
mouseDown(Event, int, int)
- java.applet.Applet function: mouseDown()
Calls button.mouseDown() to check for button hits.
-
mouseDrag(Event, int, int)
- java.applet.Applet function: mouseDrag()
Calls button.mouseDrag() to check for button hits.
-
mouseUp(Event, int, int)
- java.applet.Applet function: mouseUp()
Calls button.mouseUp() to check for button hits.
-
newFigur()
- Change from the main page to the animation page.
-
paint(Graphics)
- java.applet.Applet function: paint()
Redraw completly the main (figur==null) or animation page (figur!=null).
-
setCurDance(int)
-
-
setCurFigur(int)
-
-
setCurMusic(int)
-
-
start()
-
-
stop()
- java.applet.Applet function: stop()
Stops the dancing and the audio.
-
toString()
- Returns a String object representing.
-
update(Graphics)
- java.applet.Applet function: update()
Redraw only the changed things.
-
useAudio()
- Should audio played while the animation runs?
engl
public boolean engl
- Use english or german for the strings
foots
public Foot foots
- Foot object. Needed for drawing foots.
titleFont
public Font titleFont
- Font used for the applet titel
choiceFont
public Font choiceFont
- Font used for the sub-titels
smallFont
public Font smallFont
- Small font, currently not used.
smallFontBld
public Font smallFontBld
- Small font bold. Used for showing the current selection.
buttonFont
public Font buttonFont
- Font used for the buttons.
buttonFontBld
public Font buttonFontBld
- Bold font used for the buttons.
figur
public Figur figur
- Currently active figur.
fatBorder
public boolean fatBorder
- Should have the buttons a two pixel border or only a one pixel border.
Dance
public Dance()
init
public void init()
- java.applet.Applet initialization function.
Loads some fonts, reads the attributes "english", "audio" and
"fatborder".
- Overrides:
- init in class Applet
start
public void start()
- Overrides:
- start in class Applet
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
update
public void update(Graphics g)
- java.applet.Applet function: update()
Redraw only the changed things.
- Overrides:
- update in class Component
stop
public void stop()
- java.applet.Applet function: stop()
Stops the dancing and the audio.
- Overrides:
- stop in class Applet
getAppletInfo
public String getAppletInfo()
- returns some info about author, version and copyright of the applet
- Overrides:
- getAppletInfo in class Applet
getParameterInfo
public String[][] getParameterInfo()
- returns info about the parameters
- Overrides:
- getParameterInfo in class Applet
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
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
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
getCurDance
public int getCurDance()
getCurFigur
public int getCurFigur()
getCurMusic
public int getCurMusic()
setCurDance
public void setCurDance(int num)
setCurFigur
public void setCurFigur(int num)
setCurMusic
public void setCurMusic(int num)
killFigur
public void killFigur()
- Change from the animation page back to the main page.
newFigur
public synchronized void newFigur()
- Change from the main page to the animation page.
Creates an object for the chooseen dance/figur.
useAudio
public boolean useAudio()
- Should audio played while the animation runs?
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
actionStepButton
public void actionStepButton()
- Function will be called if the "step forw." button is hit.
Does one step forward.
- See Also:
- stepForw, action
actionBackStepButton
public void actionBackStepButton()
- Function will be called if the "step backw." button is hit.
Does one step backward.
- See Also:
- stepBackw, action
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
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
actionFigurButton
public void actionFigurButton(int Bnum)
- Function will be called, if one of the figur buttons are hit.
- See Also:
- action
actionMusicButton
public void actionMusicButton(int Bnum)
- Function will be called, if one of the music buttons are hit.
- See Also:
- action
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
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
actionPlayMusicButton
public void actionPlayMusicButton()
- Function will be called if the "test music" button is hit.
Start playing the selected music.
- See Also:
- action
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
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
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
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
toString
public String toString()
- Returns a String object representing.
- Overrides:
- toString in class Component