Package com.jidesoft.swing
Class Flashable
java.lang.Object
com.jidesoft.swing.Flashable
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
FieldsModifier and TypeFieldDescriptionprotected Animator
protected JComponent
protected Timer
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Clears any flashing effect.abstract void
flash()
This method actually does the flashing.protected Animator
Gets the table that will flash.static Flashable
getFlashable
(JComponent component) Gets the TableFlashable installed on the table, if any.int
Gets the interval, in ms.static boolean
Gets the flash flag.static boolean
isFlashableInstalled
(JComponent component) Checks if there is a Flashable installed on the component.boolean
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
Starts flashing.void
Stops flashing.void
Uninstalls theFlashable
from the component.
-
Field Details
-
CLIENT_PROPERTY_FLASHABLE
- See Also:
-
_component
-
_animator
-
_timer
-
-
Constructor Details
-
Flashable
-
-
Method Details
-
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
Gets the table that will flash.- Returns:
- the table.
-
setComponent
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 instartFlashing()
andstopFlashing()
. -
getAnimator
-
startFlashing
public void startFlashing()Starts flashing. -
stopFlashing
public void stopFlashing()Stops flashing. -
uninstall
public void uninstall()Uninstalls theFlashable
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 usestopFlashing()
. -
isFlashing
public boolean isFlashing()Checks if it is flashing.- Returns:
- true if flashing.
-
isFlashableInstalled
Checks if there is a Flashable installed on the component.- Parameters:
component
- the component.- Returns:
- true if installed.
-
getFlashable
Gets the TableFlashable installed on the table, if any.- Parameters:
component
- the component.- Returns:
- whether a Flashable is installed.
-