Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table.search
Class ColorStyle

java.lang.Object
  extended by com.citra.table.search.ColorStyle
All Implemented Interfaces:
Style

public class ColorStyle
extends Object
implements Style

ColorStyle is a style that is used to highlight the matching cells of a search with a specified background color.


Field Summary
protected  Color selectionColor
          the background color to use
 
Constructor Summary
ColorStyle()
          Constructs a ColorStyle.
ColorStyle(Color selectionColor)
          Constructs a ColorStyle.
 
Method Summary
 void apply(Component c, JTable table, int row, int column)
          Applies the style to the component c.
 void clear()
          Clears all of the matched cells.
 Color getSelectionColor()
          Retrieves the selection color.
 void selectCell(int row, int column)
          Adds the specified cell defined by row and column to the matched cells.
 void setSelectionColor(Color selectionColor)
          Assigns the selection color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectionColor

protected Color selectionColor
the background color to use

Constructor Detail

ColorStyle

public ColorStyle()
Constructs a ColorStyle.


ColorStyle

public ColorStyle(Color selectionColor)
Constructs a ColorStyle.

Method Detail

apply

public void apply(Component c,
                  JTable table,
                  int row,
                  int column)
Applies the style to the component c.

Specified by:
apply in interface Style
Parameters:
c - the component that we wish to apply a style to.
table - the associated table
row - the current row of the table
column - the current column of the table

clear

public void clear()
Clears all of the matched cells.


getSelectionColor

public Color getSelectionColor()
Retrieves the selection color.

Returns:
the selection color

selectCell

public void selectCell(int row,
                       int column)
Adds the specified cell defined by row and column to the matched cells.

Parameters:
row - the row index of the cell
column - the column index of the cell

setSelectionColor

public void setSelectionColor(Color selectionColor)
Assigns the selection color.

Parameters:
selectionColor - the colot to assign

Copyright © 2011 Citra Technologies. All Rights Reserved.