JIDE 3.5.15

com.jidesoft.swing
Class Flashable

java.lang.Object
  extended by com.jidesoft.swing.Flashable
Direct Known Subclasses:
TableFlashable

public abstract class Flashable
extends 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.


Field Summary
protected  Animator _animator
           
protected  JComponent _component
           
protected  Timer _timer
           
static String CLIENT_PROPERTY_FLASHABLE
           
 
Constructor Summary
Flashable(JComponent component)
           
 
Method Summary
abstract  void clearFlashing()
          Clears any flashing effect.
abstract  void flash()
          This method actually does the flashing.
protected  Animator getAnimator()
           
 JComponent getComponent()
          Gets the table that will flash.
static Flashable getFlashable(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(JComponent component)
          Checks if there is a Flashable installed on the component.
 boolean isFlashing()
          Checks if it is flashing.
 void setComponent(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_PROPERTY_FLASHABLE

public static final String CLIENT_PROPERTY_FLASHABLE
See Also:
Constant Field Values

_component

protected JComponent _component

_animator

protected Animator _animator

_timer

protected Timer _timer
Constructor Detail

Flashable

public Flashable(JComponent component)
Method Detail

getSynchronizedFlashFlag

public static boolean getSynchronizedFlashFlag()
Gets the flash flag. We have an internal timer which sets this flag value. All Flashables will use the same flash flag so that they are all in sync when flashing.

Returns:
true or false. True means the flash is on and false means flash is off.

getComponent

public JComponent getComponent()
Gets the table that will flash.

Returns:
the table.

setComponent

public void setComponent(JComponent component)
Sets the table that will flash.

Parameters:
component - the new table.

getInterval

public int getInterval()
Gets the interval, in ms.

Returns:
the interval.

setInterval

public void setInterval(int interval)
Sets the interval, in ms. If the flashing is running, the new interval will take effect immediately. By default, it is 300 ms.

Parameters:
interval - the new interval.

flash

public abstract void flash()
This method actually does the flashing. This method is called in the actionPerformed of the timer.


clearFlashing

public abstract void clearFlashing()
Clears any flashing effect. This method will be called in startFlashing() and stopFlashing().


getAnimator

protected Animator getAnimator()

startFlashing

public void startFlashing()
Starts flashing.


stopFlashing

public void stopFlashing()
Stops flashing.


uninstall

public void uninstall()
Uninstalls the 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().


isFlashing

public boolean isFlashing()
Checks if it is flashing.

Returns:
true if flashing.

isFlashableInstalled

public static boolean isFlashableInstalled(JComponent component)
Checks if there is a Flashable installed on the component.

Parameters:
component - the component.
Returns:
true if installed.

getFlashable

public static Flashable getFlashable(JComponent component)
Gets the TableFlashable installed on the table, if any.

Parameters:
component - the component.
Returns:
whether a Flashable is installed.

JIDE 3.5.15