saveopen.presentation
Class FrameBlinker
java.lang.Object
|
+--javax.swing.Timer
|
+--saveopen.presentation.FrameBlinker
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener, java.io.Serializable
- public class FrameBlinker
- extends javax.swing.Timer
- implements java.awt.event.ActionListener
A special-purpose Timer which can be used to make a Frame
blink on and off at a regular interval. A distinct
FrameBlinker is needed for every Frame you wish to blink.
A number of experiments indicated that the original version
of this class, which called the Frame's hide() and show()
methods, interacted poorly with the enclosing window-managing
environment. For instance, CTWM flashed the window, but first
moved it to virtual screen 1, and minimized it. After some
thought, I decided that blinking the title was the best option.
- See Also:
- Serialized Form
Field Summary |
protected boolean |
on
The current state of blinkitude. |
protected java.awt.Frame |
target
The Frame to be blinked. |
protected java.lang.String |
targetTitle
The original title of target ; the title blinks
between this and "Selected Frame". |
Fields inherited from class javax.swing.Timer |
listenerList |
Constructor Summary |
FrameBlinker(java.awt.Frame targetFrame)
Creates a new FrameBlinker, with target frame targetFrame . |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
With every tick of the Timer, switches the frame title. |
static void |
main(java.lang.String[] args)
For test purposes. |
void |
stop()
Makes the frame stop blinking and restores the original
frame title. |
Methods inherited from class javax.swing.Timer |
addActionListener, fireActionPerformed, getDelay, getInitialDelay, getListeners, getLogTimers, isCoalesce, isRepeats, isRunning, removeActionListener, restart, setCoalesce, setDelay, setInitialDelay, setLogTimers, setRepeats, start |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
target
protected java.awt.Frame target
- The Frame to be blinked.
on
protected boolean on
- The current state of blinkitude.
targetTitle
protected java.lang.String targetTitle
- The original title of
target
; the title blinks
between this and "Selected Frame".
FrameBlinker
public FrameBlinker(java.awt.Frame targetFrame)
- Creates a new FrameBlinker, with target frame
targetFrame
.
The default delay is 500 milliseconds.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- With every tick of the Timer, switches the frame title.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
stop
public void stop()
- Makes the frame stop blinking and restores the original
frame title.
- Overrides:
stop
in class javax.swing.Timer
main
public static void main(java.lang.String[] args)
- For test purposes. Creates and displays a Frame, then blinks it.