Index

A C G I M P R S T X Y 
All Classes and Interfaces|All Packages|Serialized Form

A

a6 - package a6
 
addSliderLabels(JSlider, String, String) - Static method in class a6.GameMain
Label `slider`'s minimum value with `minLabel` and its maximum value with `maxLabel`.

C

checkHit(int, int) - Method in class a6.GameComponent.Target
Return true and set state to "hit" if coordinates (cx,cy) are within this target's circular area and it was not already "hit"; return false otherwise.
clip(int, int) - Method in class a6.GameComponent.Target
Clip `coord` to be within `[radius, max - radius]`, if possible.
createAndShowGUI() - Static method in class a6.GameMain
Create application window.

G

GameComponent - Class in a6
GUI component for Click-a-Dot game board.
GameComponent() - Constructor for class a6.GameComponent
Construct a new GameComponent with default settings.
GameComponent.Target - Class in a6
Represents a dot to be clicked.
GameMain - Class in a6
Main class for Click-a-Dot game.
GameMain() - Constructor for class a6.GameMain
 
getScore() - Method in class a6.GameComponent
Query the current score.
getTargetRadius() - Method in class a6.GameComponent
Query the radius of the target dot [px].
getTargetTimeMillis() - Method in class a6.GameComponent
Query the duration each target is shown [ms].

I

isActive - Variable in class a6.GameComponent
Whether a game is currently being played.
isHit - Variable in class a6.GameComponent.Target
Whether this has been "hit" in its current location.

M

main(String[]) - Static method in class a6.GameMain
Start the application.
makeSliderPanel(JSlider, String) - Static method in class a6.GameMain
Place `slider` in a new padded panel with top label `title` and return the panel.
maxTargets - Variable in class a6.GameComponent
Number of targets to show during one game.
mouseClicked(MouseEvent) - Method in class a6.GameComponent
 
mouseEntered(MouseEvent) - Method in class a6.GameComponent
 
mouseExited(MouseEvent) - Method in class a6.GameComponent
 
mousePressed(MouseEvent) - Method in class a6.GameComponent
Handle a mouse button being pressed.
mouseReleased(MouseEvent) - Method in class a6.GameComponent
 

P

paintComponent(Graphics) - Method in class a6.GameComponent
Visualize the current game state by painting on `g`.
paintDot(Graphics) - Method in class a6.GameComponent.Target
Paint dot on provided Graphics `g`.

R

radius - Variable in class a6.GameComponent.Target
Radius of circular dot representing the target [px].
respawn(int, int) - Method in class a6.GameComponent.Target
Move target to a random location and reset "hit" state.
rng - Variable in class a6.GameComponent.Target
Generate random numbers to use when choosing new location.

S

saveScore(JFrame, int) - Static method in class a6.GameMain
Append a line containing `score` to a user-selected file, using `frame` as the parent of any dialogs.
score - Variable in class a6.GameComponent
Number of targets successfully hit by player during the current game.
setScore(int) - Method in class a6.GameComponent
Change the current score to `newScore` and notify observers.
setTargetRadius(int) - Method in class a6.GameComponent
Change the radius of the target dot to `r` px.
setTargetTimeMillis(int) - Method in class a6.GameComponent
Change the duration each target is shown to `t` ms.
startGame() - Method in class a6.GameComponent
Start a new game using current settings.
stopGame() - Method in class a6.GameComponent
Stop current game.

T

target - Variable in class a6.GameComponent
Encapsulates state and controls for current target.
Target() - Constructor for class a6.GameComponent.Target
 
targetCount - Variable in class a6.GameComponent
Number of targets that have been shown during current game (including the current target).
targetTimeMillis - Variable in class a6.GameComponent
Duration each target is shown [ms].
timeout() - Method in class a6.GameComponent
Update the game when the timer "goes off".
timer - Variable in class a6.GameComponent
Timer to trigger changing targets.

X

x - Variable in class a6.GameComponent.Target
x-coordinate of current center position [px].

Y

y - Variable in class a6.GameComponent.Target
y-coordinate of current center position [px].
A C G I M P R S T X Y 
All Classes and Interfaces|All Packages|Serialized Form