JIDE 3.5.15

com.jidesoft.grid
Class TableFlashable

java.lang.Object
  extended by com.jidesoft.swing.Flashable
      extended by com.jidesoft.grid.TableFlashable

public class TableFlashable
extends Flashable

TableFlashable makes the CellStyleTable cells flashing as long as the StyleModel's getCellStyleAt method return a FlashCellStyle.

Here is a sample.

 TableFlashable flasher = new TableFlashable(_table, new FlashCellStyle[]{_flashCellStyle}, new
 int[]{0, 2});
 flasher.startFlashing();
 
All flashing happened at the same pace so that it looks better when there are many cell flashing. The flash interval is determined by Flashable.setInterval(int) method. The flash style can be defined at using setFlashStyle of FlashCellStyle. Since the same CellStyle class is used, you can flash background, foreground, font, border, or even alignments.

For performance consideration, you should predefine several FlashCellStyle's and use them in StyleModel. You also need to pass the FlashCellStyle as an array to the constructor of TableFlashable.

We also all your set specify which columns to flash if the flashing cells only appear at certain columns.


Field Summary
static int ALL_VISIBLE_CELLS
           
static int ONLY_FLASH_CELLS
           
 
Fields inherited from class com.jidesoft.swing.Flashable
_animator, _component, _timer, CLIENT_PROPERTY_FLASHABLE
 
Constructor Summary
TableFlashable(CellStyleTable table, FlashCellStyle[] flashCellStyles)
           
TableFlashable(CellStyleTable table, FlashCellStyle[] flashCellStyles, int[] columns)
           
 
Method Summary
 void clearFlashing()
          Clears any flashing effect.
 void flash()
          This method actually does the flashing.
 int getFlashArea()
          Gets the flash area.
 FlashCellStyle[] getFlashCellStyles()
          Gets the FlashCellStyles used by the StyleModel.
 int[] getPosisbleFlashColumns()
          Deprecated. replaced by getPossibleFlashColumns().
 int[] getPossibleFlashColumns()
          Gets the possible flash columns.
 void setFlashArea(int flashArea)
          Sets the flash area.
 void setFlashCellStyles(FlashCellStyle[] flashCellStyles)
          Sets the FlashCellStyles in use.
 void setPosisbleFlashColumns(int[] possibleFlashColumns)
          Deprecated. replaced by setPossibleFlashColumns(int[]).
 void setPossibleFlashColumns(int[] possibleFlashColumns)
          Sets the possible flash columns.
 
Methods inherited from class com.jidesoft.swing.Flashable
getAnimator, getComponent, getFlashable, getInterval, getSynchronizedFlashFlag, isFlashableInstalled, isFlashing, setComponent, setInterval, startFlashing, stopFlashing, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_VISIBLE_CELLS

public static final int ALL_VISIBLE_CELLS
See Also:
Constant Field Values

ONLY_FLASH_CELLS

public static final int ONLY_FLASH_CELLS
See Also:
Constant Field Values
Constructor Detail

TableFlashable

public TableFlashable(CellStyleTable table,
                      FlashCellStyle[] flashCellStyles)

TableFlashable

public TableFlashable(CellStyleTable table,
                      FlashCellStyle[] flashCellStyles,
                      int[] columns)
Method Detail

getFlashArea

public int getFlashArea()
Gets the flash area.

Returns:
the flash area. It could be either ALL_VISIBLE_CELLS or ONLY_FLASH_CELLS.

setFlashArea

public void setFlashArea(int flashArea)
Sets the flash area. This give you a fine tuning over the performance. If you choose ALL_VISIBLE_CELLS, we will repaint all visible cells of the possible columns (set using setPossibleFlashColumns(int[]). If the visible table cells are not many, this could have a better performance than ONLY_FLASH_CELLS. If you choose ONLY_FLASH_CELLS, we will look at StyleModels and see if getCellStyleAt returns a FlashCellStyle and only repaint those cells. So compare with the two options, one might paint cells that are not flashing. The other will take time to examine StyleModel. In TableFlasherDemo, the two always have the same performance. You can decide which one to use based on the actual situation in your application. In general, if your StyleModel's getCellStyleAt is expensive, try to use ALL_VISIBLE_CELLS. If your TableModel's getValueAt method is expensive, try to use ONLY_FLASH_CELLS.

Parameters:
flashArea - the new flash area. It could be either ALL_VISIBLE_CELLS or ONLY_FLASH_CELLS.

getFlashCellStyles

public FlashCellStyle[] getFlashCellStyles()
Gets the FlashCellStyles used by the StyleModel.

Returns:
the FlashCellStyles in use.

setFlashCellStyles

public void setFlashCellStyles(FlashCellStyle[] flashCellStyles)
Sets the FlashCellStyles in use.

Parameters:
flashCellStyles - the new FlashCellStyles.

getPosisbleFlashColumns

@Deprecated
public int[] getPosisbleFlashColumns()
Deprecated. replaced by getPossibleFlashColumns().

Returns:
the possible flash columns.

getPossibleFlashColumns

public int[] getPossibleFlashColumns()
Gets the possible flash columns.

Returns:
the possible flash columns.

setPosisbleFlashColumns

@Deprecated
public void setPosisbleFlashColumns(int[] possibleFlashColumns)
Deprecated. replaced by setPossibleFlashColumns(int[]).

Parameters:
possibleFlashColumns - the possible flash columns

setPossibleFlashColumns

public void setPossibleFlashColumns(int[] possibleFlashColumns)
Sets the possible flash columns.

Parameters:
possibleFlashColumns - the possible flash columns

flash

public void flash()
Description copied from class: Flashable
This method actually does the flashing. This method is called in the actionPerformed of the timer.

Specified by:
flash in class Flashable

clearFlashing

public void clearFlashing()
Description copied from class: Flashable
Clears any flashing effect. This method will be called in Flashable.startFlashing() and Flashable.stopFlashing().

Specified by:
clearFlashing in class Flashable

JIDE 3.5.15