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.
-
GridXSize
- size().width of the floor grid
-
GridYSize
- size().height of the floor grid
-
Floor(String, boolean, int, int, int, int, int, int, int, int, Foot, Dance)
- Creates a dance floor.
-
BottomEdge()
- Returns the bottom border of the floor
-
BottomEdgeParket()
- Returns the bottom border without the title string of the floor
-
CalcXPos(float)
- Gets a position relative to the grid and returns
a x-coordinate relative to the applet origin.
-
CalcYPos(float)
- Gets a position relative to the grid and returns
a y-coordinate relative to the applet origin.
-
HideComStr()
- Hide the takt/time - heel/toe string (after the next repaint()).
-
IsDame()
- Is this the lady floor?
-
LeftEdge()
- Returns the left border of the floor.
-
RedrawFloor()
- Next time Floor.paint() will be called, all (floor and steps)
will be painted new.
-
RightEdge()
- Returns the right border of the floor
-
SetComStrPos(float, float)
- Set the position of the comment (takt/time - heel/toe) string.
-
SetTRPos(float, float)
- Set the position of the dancing direction arrow.
-
ShowComStr()
- Show the takt/time - heel/toe string (after the next repaint()).
-
TopEdge()
- Returns the top border of the floor
-
addToClipRect(int, int, int, int)
- Add the rect (x1, y1) - (x2, y2) to the clip rect of this floor.
-
backStep()
- Take back one step.
-
clearSteps()
- Undo all steps on this floor
-
doStep(Step)
- Do the step s.
-
getNumSteps()
- Returns the number of steps already set on this floor.
-
installClipRect(Graphics)
- Setup the clip rect of this floor onto the graphics context g.
-
paint(Graphics)
- Draw the floor.
-
repaintAllSteps()
- Repaint all steps on the next repaint().
-
toString()
- Returns a String object representing.
-
useComStrHT()
- Use the heel/toe string for the comment field
-
useComStrTime()
- Use the time (quick/slow) string for the comment field
GridXSize
public final static int GridXSize
- size().width of the floor grid
GridYSize
public final static int GridYSize
- size().height of the floor grid
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
LeftEdge
public int LeftEdge()
- Returns the left border of the floor.
RightEdge
public int RightEdge()
- Returns the right border of the floor
TopEdge
public int TopEdge()
- Returns the top border of the floor
BottomEdge
public int BottomEdge()
- Returns the bottom border of the floor
BottomEdgeParket
public int BottomEdgeParket()
- Returns the bottom border without the title string of the floor
CalcXPos
public int CalcXPos(float x)
- Gets a position relative to the grid and returns
a x-coordinate relative to the applet origin.
CalcYPos
public int CalcYPos(float y)
- Gets a position relative to the grid and returns
a y-coordinate relative to the applet origin.
IsDame
public boolean IsDame()
- Is this the lady floor?
SetTRPos
public void SetTRPos(float x,
float y)
- Set the position of the dancing direction arrow.
SetComStrPos
public void SetComStrPos(float x,
float y)
- Set the position of the comment (takt/time - heel/toe) string.
ShowComStr
public void ShowComStr()
- Show the takt/time - heel/toe string (after the next repaint()).
HideComStr
public void HideComStr()
- Hide the takt/time - heel/toe string (after the next repaint()).
useComStrHT
public void useComStrHT()
- Use the heel/toe string for the comment field
useComStrTime
public void useComStrTime()
- Use the time (quick/slow) string for the comment field
doStep
public void doStep(Step s)
- Do the step s.
backStep
public void backStep()
- Take back one step. Adds this step to the clip
rect of this floor.
- See Also:
- addToClipRect, stepBackw
getNumSteps
public int getNumSteps()
- Returns the number of steps already set on this floor.
clearSteps
public void clearSteps()
- Undo all steps on this floor
repaintAllSteps
public void repaintAllSteps()
- Repaint all steps on the next repaint().
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.backStep().
- See Also:
- addToClipRect, backStep
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.
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
RedrawFloor
public void RedrawFloor()
- Next time Floor.paint() will be called, all (floor and steps)
will be painted new.
- See Also:
- paint, repaintAllSteps
toString
public String toString()
- Returns a String object representing.
- Overrides:
- toString in class Object