Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.table.search
Class TableStyleSelector

java.lang.Object
  extended by com.sciapp.table.search.TableStyleSelector
All Implemented Interfaces:
SearchModelListener, EventListener

public class TableStyleSelector
extends Object
implements SearchModelListener

A simple SearchModelListener implementation that uses a Style to paint the matching cells of a table when searching with a different background color.


Field Summary
protected  ColorStyle style
          the style that will be used to paint the matching cells
protected  JTable table
          the associated table
 
Constructor Summary
TableStyleSelector(JTable table)
          Constructs a TableStyleSelector.
 
Method Summary
 Color getSelectionColor()
          Retrieves the matching selection color.
 ColorStyle getStyle()
          Retrieves the style that will be used to paint the matching cells.
 void search(SearchModelEvent e)
          Called whenever searching of a table has been requested.
 void setSelectionColor(Color color)
          Assigns the selection color.
 void setStyle(ColorStyle style)
          Assigns the style that will be used to paint the matching cells.
 void setTable(JTable table)
          Assigns the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected JTable table
the associated table


style

protected ColorStyle style
the style that will be used to paint the matching cells

Constructor Detail

TableStyleSelector

public TableStyleSelector(JTable table)
Constructs a TableStyleSelector.

Method Detail

getSelectionColor

public Color getSelectionColor()
Retrieves the matching selection color.

Returns:
the selection color

getStyle

public ColorStyle getStyle()
Retrieves the style that will be used to paint the matching cells.

Returns:
the style

search

public void search(SearchModelEvent e)
Called whenever searching of a table has been requested.

Specified by:
search in interface SearchModelListener
Parameters:
e - the SearchModelEvent object

setSelectionColor

public void setSelectionColor(Color color)
Assigns the selection color. The default is Color.red.

Parameters:
color - the color to assign

setStyle

public void setStyle(ColorStyle style)
Assigns the style that will be used to paint the matching cells.

Parameters:
style - the style to assign

setTable

public void setTable(JTable table)
Assigns the table.

Parameters:
table - the table to assign

Copyright © 2005 Scientific Applications. All Rights Reserved.