TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.crypto.raes.param.swing
Class HurlingWindowFeedback

java.lang.Object
  extended by de.schlichtherle.truezip.crypto.raes.param.swing.BasicFeedback
      extended by de.schlichtherle.truezip.crypto.raes.param.swing.BasicInvalidKeyFeedback
          extended by de.schlichtherle.truezip.crypto.raes.param.swing.HurlingWindowFeedback
All Implemented Interfaces:
Feedback, InvalidKeyFeedback

public class HurlingWindowFeedback
extends BasicInvalidKeyFeedback

Provides run 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.

Author:
Christian Schlichtherle

Field Summary
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
           
 
Constructor Summary
  HurlingWindowFeedback()
           
protected HurlingWindowFeedback(int amplitude, int cycle, int duration, int fps)
          Constructs a new HurlingWindowFeedback.
 
Method Summary
 void run(JPanel panel)
          Starts the visual/audible run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PI

private static final double PI
See Also:
Constant Field Values

TWO_PI

private static final double TWO_PI
See Also:
Constant Field Values

AMPLITUDE

public static final int AMPLITUDE
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

amplitude

private final double amplitude

cycle

private final double cycle

duration

private final int duration

fps

private final int fps
Constructor Detail

HurlingWindowFeedback

public HurlingWindowFeedback()

HurlingWindowFeedback

protected HurlingWindowFeedback(int amplitude,
                                int cycle,
                                int duration,
                                int fps)
Constructs a new HurlingWindowFeedback.

Parameters:
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.
Method Detail

run

public void run(@NonNull
                JPanel panel)
Description copied from class: BasicFeedback
Starts the visual/audible run. 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 simply beeps using the default toolkit.

Specified by:
run in interface Feedback
Overrides:
run in class BasicInvalidKeyFeedback
Parameters:
panel - the panel to provide visual/audible run to.

TrueZIP Driver ZIP.RAES (TZP) 7.1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.