Class draw2


public class draw2
extends JPanel

Überschrift:

Beschreibung: Haupklasse

Copyright: Copyright (c) 2002

Organisation:

Field Summary

private boolean
beat
private int
bits
(package private) Color
circleColor
private boolean
circleMode
(package private) int
circleX
(package private) int
circleY
private int[]
correctXpoints
private int[]
correctYpoints
private boolean
correctionMode
(package private) int
destX
(package private) int
destY
private boolean
futureMode
private timer
myTimer
private boolean
polar
private sequence
s
(package private) int
srcX
(package private) int
srcY
private int
step
private int
t
private int[]
xclicked
private int[]
xpoints
private int[]
yclicked
private int[]
ypoints

Constructor Summary

draw2()
standard constructor
draw2(int bits, sequence s, boolean beat)
Constructor

Method Summary

void
circle(int circleX, int circleY, Color circleColor)
activates circlemode
boolean
circleGreen(int index)
checks if circle should be green or red
void
clearAll()
deletes the two clicked-Arrays
void
correctionModeOff()
sets CorrectionMode off
void
future(int srcX, int srcY, int destX, int destY)
draws a posibble line of the future
int[]
getClickedX()
the x-positions of the pressed points
int[]
getClickedY()
the y-positions of the pressed points
int[]
getXclicked()
int[]
getYclicked()
int
inRange(int x, int y)
return the index of the pressed button as integer
int
indexMax()
gives back the index of the last used xclicked.array
int
indexMaxClicked()
boolean
isAllowed(int x, int y, int back)
gives back the index of the last used xclicked-array
boolean
isSelected(int index)
checks if the point is already pressed
void
paint(Graphics g)
method responsible for painting
void
setCorrection(int[] correctXpoints, int[] correctYpoints)
draws the solution
void
setSequence(sequence s)
sequence object is associated
void
setTimer(timer myTimer)
timer object is associated

Field Details

beat

private boolean beat

bits

private int bits

circleColor

(package private)  Color circleColor

circleMode

private boolean circleMode

circleX

(package private)  int circleX

circleY

(package private)  int circleY

correctXpoints

private int[] correctXpoints

correctYpoints

private int[] correctYpoints

correctionMode

private boolean correctionMode

destX

(package private)  int destX

destY

(package private)  int destY

futureMode

private boolean futureMode

myTimer

private timer myTimer

polar

private boolean polar

s

private sequence s

srcX

(package private)  int srcX

srcY

(package private)  int srcY

step

private int step

t

private int t

xclicked

private int[] xclicked

xpoints

private int[] xpoints

yclicked

private int[] yclicked

ypoints

private int[] ypoints

Constructor Details

draw2

public draw2()
standard constructor
Parameters:

draw2

public draw2(int bits,
             sequence s,
             boolean beat)
Constructor
Parameters:

Method Details

circle

public void circle(int circleX,
                   int circleY,
                   Color circleColor)
activates circlemode
Parameters:

circleGreen

public boolean circleGreen(int index)
checks if circle should be green or red
Parameters:
index - of the ponit
Returns:
boolean true , false

clearAll

public void clearAll()
deletes the two clicked-Arrays
Parameters:

correctionModeOff

public void correctionModeOff()
sets CorrectionMode off
Parameters:

future

public void future(int srcX,
                   int srcY,
                   int destX,
                   int destY)
draws a posibble line of the future
Parameters:

getClickedX

public int[] getClickedX()
the x-positions of the pressed points
Parameters:
Returns:
integer array

getClickedY

public int[] getClickedY()
the y-positions of the pressed points
Parameters:
Returns:
integer array

getXclicked

public int[] getXclicked()

getYclicked

public int[] getYclicked()

inRange

public int inRange(int x,
                   int y)
return the index of the pressed button as integer
Parameters:
Returns:
Integer

indexMax

public int indexMax()
gives back the index of the last used xclicked.array
Parameters:
Returns:
Integer

indexMaxClicked

public int indexMaxClicked()

isAllowed

public boolean isAllowed(int x,
                         int y,
                         int back)
gives back the index of the last used xclicked-array
Parameters:
Returns:
boolean

isSelected

public boolean isSelected(int index)
checks if the point is already pressed
Parameters:
index - of the point
Returns:
boolean true false

paint

public void paint(Graphics g)
method responsible for painting
Parameters:

setCorrection

public void setCorrection(int[] correctXpoints,
                          int[] correctYpoints)
draws the solution
Parameters:

setSequence

public void setSequence(sequence s)
sequence object is associated
Parameters:

setTimer

public void setTimer(timer myTimer)
timer object is associated
Parameters: