Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table.styles
Interface StyleModel

All Known Implementing Classes:
DefaultStyleModel, PivotTable.PivotDataStyleModel, TreeTable.DefaultTreeStyleModel

public interface StyleModel

StyleModel is used for rendering the cells of a JTable. This class manages a collection of Style objects, which are applied to the cell component, just before showing it on the table.


Method Summary
 void addStyle(Style newStyle)
          Adds a style to the end of the list of styles.
 void applyStyles(Component c, JTable table, int row, int column)
          Applies the styles currently in the model to the component c.
 void clearStyles()
          Removes all styles.
 Style getStyle(int index)
          Retrieves the style at index.
 Style[] getStyles()
          Returns the styles of the style model as an array.
 void insertStyle(Style newStyle, int index)
          Inserts a new style at index.
 void removeStyle(Style style)
          Removes a style from the style model.
 

Method Detail

addStyle

void addStyle(Style newStyle)
Adds a style to the end of the list of styles.

Parameters:
newStyle - the new style to add.

applyStyles

void applyStyles(Component c,
                 JTable table,
                 int row,
                 int column)
Applies the styles currently in the model to the component c.

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

clearStyles

void clearStyles()
Removes all styles.


getStyle

Style getStyle(int index)
Retrieves the style at index.

Parameters:
index - the location of the style.
Returns:
the style at the ith index.

getStyles

Style[] getStyles()
Returns the styles of the style model as an array.

Returns:
the styles as an array of Style objects.

insertStyle

void insertStyle(Style newStyle,
                 int index)
Inserts a new style at index.

Parameters:
newStyle - the new style to add
index - the location of the style

removeStyle

void removeStyle(Style style)
Removes a style from the style model.

Parameters:
style - the style to remove.

Copyright © 2011 Citra Technologies. All Rights Reserved.