public abstract class Flashable
extends java.lang.Object
Flashable
is a basic interface to enable flashing in any component. Internally it uses Animator
to create the flashing effect.
Whenever a Flashable is installed to a JComponent, you can always use isFlashableInstalled(javax.swing.JComponent)
to check if it is installed.Modifier and Type | Field and Description |
---|---|
protected Animator |
_animator |
protected javax.swing.JComponent |
_component |
protected javax.swing.Timer |
_timer |
static java.lang.String |
CLIENT_PROPERTY_FLASHABLE |
Constructor and Description |
---|
Flashable(javax.swing.JComponent component) |
Modifier and Type | Method and Description |
---|---|
abstract void |
clearFlashing()
Clears any flashing effect.
|
abstract void |
flash()
This method actually does the flashing.
|
protected Animator |
getAnimator() |
javax.swing.JComponent |
getComponent()
Gets the table that will flash.
|
static Flashable |
getFlashable(javax.swing.JComponent component)
Gets the TableFlashable installed on the table, if any.
|
int |
getInterval()
Gets the interval, in ms.
|
static boolean |
getSynchronizedFlashFlag()
Gets the flash flag.
|
static boolean |
isFlashableInstalled(javax.swing.JComponent component)
Checks if there is a Flashable installed on the component.
|
boolean |
isFlashing()
Checks if it is flashing.
|
void |
setComponent(javax.swing.JComponent component)
Sets the table that will flash.
|
void |
setInterval(int interval)
Sets the interval, in ms.
|
void |
startFlashing()
Starts flashing.
|
void |
stopFlashing()
Stops flashing.
|
void |
uninstall()
Uninstalls the
Flashable from the component. |
public static final java.lang.String CLIENT_PROPERTY_FLASHABLE
protected javax.swing.JComponent _component
protected Animator _animator
protected javax.swing.Timer _timer
public static boolean getSynchronizedFlashFlag()
public javax.swing.JComponent getComponent()
public void setComponent(javax.swing.JComponent component)
component
- the new table.public int getInterval()
public void setInterval(int interval)
interval
- the new interval.public abstract void flash()
public abstract void clearFlashing()
startFlashing()
and stopFlashing()
.protected Animator getAnimator()
public void startFlashing()
public void stopFlashing()
public void uninstall()
Flashable
from the component. Once uninstalled, you have to create a new Flashable in
order to use thflashingng feature again. If you just want to stop flashing, you should use stopFlashing()
.public boolean isFlashing()
public static boolean isFlashableInstalled(javax.swing.JComponent component)
component
- the component.public static Flashable getFlashable(javax.swing.JComponent component)
component
- the component.