public class HurlingWindowFeedback extends BasicInvalidKeyFeedback
This class is inspired by chapter #38 "Earthquake Dialog" of the book "Swing Hacks" by Joshua Marinacci & Chris Adamson, published by O'Reilly in 2005.
Modifier and Type | Field and Description |
---|---|
static int |
AMPLITUDE |
static int |
CYCLE |
static int |
DURATION |
static int |
FPS |
Modifier | Constructor and Description |
---|---|
|
HurlingWindowFeedback() |
protected |
HurlingWindowFeedback(int amplitude,
int cycle,
int duration,
int fps)
Constructs a new
HurlingWindowFeedback . |
public static final int AMPLITUDE
public static final int CYCLE
public static final int DURATION
public static final int FPS
public HurlingWindowFeedback()
protected HurlingWindowFeedback(int amplitude, int cycle, int duration, int fps)
HurlingWindowFeedback
.amplitude
- the amplitude of pixels for offsetting the window.cycle
- milliseconds required for one cycle.duration
- millisecons of duration of quake.fps
- frames per second for animation.public void run(JPanel panel)
BasicFeedback
Timer
class should be used to schedule timer events
for the animation.
The implementation in this class simply beeps using the default toolkit.
run
in interface Feedback
run
in class BasicInvalidKeyFeedback
panel
- the panel to provide visual/audible run to.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.