de.schlichtherle.key.passwd.swing
Class HurlingWindowFeedback
java.lang.Object
de.schlichtherle.key.passwd.swing.BasicFeedback
de.schlichtherle.key.passwd.swing.BasicInvalidKeyFeedback
de.schlichtherle.key.passwd.swing.HurlingWindowFeedback
- All Implemented Interfaces:
- Feedback, Runnable
- Direct Known Subclasses:
- QuakingWindowFeedback
public class HurlingWindowFeedback
- extends BasicInvalidKeyFeedback
Provides feedback by beeping using the default toolkit, disabling the
default button in the root pane for three seconds and concurrently
hurling the containing window for 1.5 seconds.
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.
- Since:
- TrueZIP 6.4
- Version:
- $Id: HurlingWindowFeedback.java,v 1.4 2010/08/20 13:09:40 christian_schlichtherle Exp $
- Author:
- Christian Schlichtherle
|
Method Summary |
protected void |
startAnimation()
Starts the visual feedback. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISTANCE
public static final int DISTANCE
- See Also:
- Constant Field Values
CYCLE
public static final int CYCLE
- See Also:
- Constant Field Values
DURATION
public static final int DURATION
- See Also:
- Constant Field Values
FPS
public static final int FPS
- See Also:
- Constant Field Values
HurlingWindowFeedback
public HurlingWindowFeedback()
HurlingWindowFeedback
protected HurlingWindowFeedback(int distance,
int cycle,
int duration,
int fps)
- Constructs a new
HurlingWindowFeedback.
- Parameters:
distance - The maximum distance for quaking the window.cycle - Milliseconds required for one cycle.duration - Millisecons of duration of quake.fps - Frames per second for animation.
startAnimation
protected void startAnimation()
- Description copied from class:
BasicFeedback
- Starts the visual feedback.
Subclasses may override this method to animate the GUI according to
their liking.
This method is called when the panel is shown in its containing window.
It is run on AWT's Event Dispatch Thread, so it must complete fast
in order not to block the GUI.
If an implementation is going to do animations, the
Timer class should be used to schedule timer events
for the animation.
The implementation in this class is a no-op.
- Overrides:
startAnimation in class BasicInvalidKeyFeedback
Copyright © 2005-2010 Schlichtherle IT Services. All Rights Reserved.