Class Floor

Class Floor

java.lang.Object
   |
   +----Floor

class Floor
extends Object
Floor maintains one dance floor. Normaly two of them are needed. One for the lady and one for the gent. It stores all informations about the steps which are done and draws them.
Version:
1.1, 13 Sep 1995
Author:
Georg Heßmann

Variable Index

 o GridXSize
size().width of the floor grid
 o GridYSize
size().height of the floor grid

Constructor Index

 o Floor(String, boolean, int, int, int, int, int, int, int, int, Foot, Dance)
Creates a dance floor.

Method Index

 o BottomEdge()
Returns the bottom border of the floor
 o BottomEdgeParket()
Returns the bottom border without the title string of the floor
 o CalcXPos(float)
Gets a position relative to the grid and returns a x-coordinate relative to the applet origin.
 o CalcYPos(float)
Gets a position relative to the grid and returns a y-coordinate relative to the applet origin.
 o HideComStr()
Hide the takt/time - heel/toe string (after the next repaint()).
 o IsDame()
Is this the lady floor?
 o LeftEdge()
Returns the left border of the floor.
 o RedrawFloor()
Next time Floor.paint() will be called, all (floor and steps) will be painted new.
 o RightEdge()
Returns the right border of the floor
 o SetComStrPos(float, float)
Set the position of the comment (takt/time - heel/toe) string.
 o SetTRPos(float, float)
Set the position of the dancing direction arrow.
 o ShowComStr()
Show the takt/time - heel/toe string (after the next repaint()).
 o TopEdge()
Returns the top border of the floor
 o addToClipRect(int, int, int, int)
Add the rect (x1, y1) - (x2, y2) to the clip rect of this floor.
 o backStep()
Take back one step.
 o clearSteps()
Undo all steps on this floor
 o doStep(Step)
Do the step s.
 o getNumSteps()
Returns the number of steps already set on this floor.
 o installClipRect(Graphics)
Setup the clip rect of this floor onto the graphics context g.
 o paint(Graphics)
Draw the floor.
 o repaintAllSteps()
Repaint all steps on the next repaint().
 o toString()
Returns a String object representing.
 o useComStrHT()
Use the heel/toe string for the comment field
 o useComStrTime()
Use the time (quick/slow) string for the comment field

Variables

 o GridXSize
  public final static int GridXSize
size().width of the floor grid
 o GridYSize
  public final static int GridYSize
size().height of the floor grid

Constructors

 o Floor
  public Floor(String t,
               boolean isd,
               int gxo,
               int gyo,
               int xsz,
               int ysz,
               int lborder,
               int rborder,
               int tborder,
               int bborder,
               Foot f,
               Dance app)
Creates a dance floor.
Parameters:
t - titel (lady/gent)
isd - is this the lady-floor?
gxo - left border of the floor relative to the applet origin
gyo - top border of the floor relative to the applet origin
xsz - x-size of the grid
ysz - y-size of the grid
lborder - left border of the grid
rborder - right border of the grid
tborder - top border of the grid
bborder - bottom border of the grid
f - pointer to the foot object
app - pointer to the main applet

Methods

 o LeftEdge
  public int LeftEdge()
Returns the left border of the floor.

 o RightEdge

  public int RightEdge()
Returns the right border of the floor

 o TopEdge

  public int TopEdge()
Returns the top border of the floor

 o BottomEdge

  public int BottomEdge()
Returns the bottom border of the floor

 o BottomEdgeParket

  public int BottomEdgeParket()
Returns the bottom border without the title string of the floor

 o CalcXPos

  public int CalcXPos(float x)
Gets a position relative to the grid and returns a x-coordinate relative to the applet origin.

 o CalcYPos

  public int CalcYPos(float y)
Gets a position relative to the grid and returns a y-coordinate relative to the applet origin.

 o IsDame

  public boolean IsDame()
Is this the lady floor?

 o SetTRPos

  public void SetTRPos(float x,
                       float y)
Set the position of the dancing direction arrow.

 o SetComStrPos

  public void SetComStrPos(float x,
                           float y)
Set the position of the comment (takt/time - heel/toe) string.

 o ShowComStr

  public void ShowComStr()
Show the takt/time - heel/toe string (after the next repaint()).

 o HideComStr

  public void HideComStr()
Hide the takt/time - heel/toe string (after the next repaint()).

 o useComStrHT

  public void useComStrHT()
Use the heel/toe string for the comment field

 o useComStrTime

  public void useComStrTime()
Use the time (quick/slow) string for the comment field

 o doStep

  public void doStep(Step s)
Do the step s.

 o backStep

  public void backStep()
Take back one step. Adds this step to the clip rect of this floor.
See Also:
addToClipRect

 o getNumSteps

  public int getNumSteps()
Returns the number of steps already set on this floor.

 o clearSteps

  public void clearSteps()
Undo all steps on this floor

 o repaintAllSteps

  public void repaintAllSteps()
Repaint all steps on the next repaint().

 o addToClipRect

  public void addToClipRect(int x1,
                            int y1,
                            int x2,
                            int y2)
Add the rect (x1, y1) - (x2, y2) to the clip rect of this floor. Will be called from Foot.addToClipRect() which will be called from Floor.takeBack().
See Also:
addToClipRect, takeBack

 o installClipRect

  public Graphics installClipRect(Graphics og)
Setup the clip rect of this floor onto the graphics context g. Than initialize the clip rect of this floor.

 o paint

  public void paint(Graphics g)
Draw the floor. If Floor.RedrawFloor() was called, all will be painted. Else only the changed things.
See Also:
RedrawFloor

 o RedrawFloor

  public void RedrawFloor()
Next time Floor.paint() will be called, all (floor and steps) will be painted new.
See Also:
paint, repaintAllSteps

 o toString

  public String toString()
Returns a String object representing.
Overrides:
toString in class Object