de.qfs.lib.gui
Class DelayedListSelectionListener
java.lang.Object
|
+--de.qfs.lib.gui.DelayedListSelectionListener
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.ListSelectionListener
- public abstract class DelayedListSelectionListener
- extends java.lang.Object
- implements javax.swing.event.ListSelectionListener
This class implements a delayed version of the ListSelectionListener
interface with the help of a DelayedAction
.
A delayed reaction to selection events is useful, when the selection
causes a complicated display to be updated. Without the delay, keyboard
traversal through the list will cause a redisplay for every item passed. By
using a DelayedListSelectionListener, only the last selection will actually
cause a redisplay, if the delay is set correctly.
When the delayed action is actually performed, the delayedValueChanged
method will be called. This
abstract method must be implemented by a subclass.
- Version:
- $Revision: 1.7 $
- Author:
- Gregor Schmid
Field Summary |
static int |
DEFAULT_DELAY
The default delay for a DelayedListSelectionListener. |
Method Summary |
protected abstract void |
delayedValueChanged(javax.swing.event.ListSelectionEvent event)
Handle a ListSelectionEvent similar to ListSelectionListener.valueChanged . |
void |
valueChanged(javax.swing.event.ListSelectionEvent event)
Restart the timer for the delayed selection changed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_DELAY
public static final int DEFAULT_DELAY
- The default delay for a DelayedListSelectionListener.
DelayedListSelectionListener
public DelayedListSelectionListener()
- Create a new DelayedListSelectionListener with the default delay
of 300 milliseconds.
DelayedListSelectionListener
public DelayedListSelectionListener(int delay)
- Create a new DelayedListSelectionListener.
- Parameters:
delay
- The delay in milliseconds until a
delayedValueChanged is fired
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent event)
- Restart the timer for the delayed selection changed.
- Specified by:
valueChanged
in interface javax.swing.event.ListSelectionListener
- Parameters:
event
- The event that caused the change.
delayedValueChanged
protected abstract void delayedValueChanged(javax.swing.event.ListSelectionEvent event)
- Handle a ListSelectionEvent similar to
ListSelectionListener.valueChanged
.
- Parameters:
event
- The event that caused the change.