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 |
|---|---|
private double |
amplitude |
static int |
AMPLITUDE |
private double |
cycle |
static int |
CYCLE |
private int |
duration |
static int |
DURATION |
private int |
fps |
static int |
FPS |
private static double |
PI |
private static double |
TWO_PI |
| Modifier | Constructor and Description |
|---|---|
|
HurlingWindowFeedback() |
protected |
HurlingWindowFeedback(int amplitude,
int cycle,
int duration,
int fps)
Constructs a new
HurlingWindowFeedback. |
private static final double PI
private static final double TWO_PI
public static final int AMPLITUDE
public static final int CYCLE
public static final int DURATION
public static final int FPS
private final double amplitude
private final double cycle
private final int duration
private 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(@NonNull
JPanel panel)
BasicFeedbackTimer 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 Feedbackrun in class BasicInvalidKeyFeedbackpanel - the panel to provide visual/audible run to.Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.