Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot
Class DefaultPivotStyleModel

java.lang.Object
  extended by com.citra.pivot.DefaultPivotStyleModel
All Implemented Interfaces:
PivotStyleModel
Direct Known Subclasses:
DefaultOlapStyleModel

public class DefaultPivotStyleModel
extends Object
implements PivotStyleModel

DefaultPivotStyleModel is the default PivotStyleModel implementation that uses a PivotStyle to modify the table's cells.


Field Summary
protected  PivotStyle defaultColumnHeaderStyle
          a style that is used as the default style for the column header area
protected  PivotStyle defaultDataStyle
          a style that is used as the default style for the data area
protected  PivotStyle defaultRowHeaderStyle
          a style that is used as the default style for the row header area
 
Constructor Summary
DefaultPivotStyleModel()
          Constructs a DefaultPivotStyleModel.
 
Method Summary
 void applyColumnHeaderStyle(Component c, PivotTable table, PivotColumnAdapter adapter, TreePath path, int level, int column)
          Visually modifies a given component, that appears in the column header of a pivot table.
 void applyDataStyle(Component c, PivotTable table, PivotRowAdapter[] rowAdapters, TreePath[] rowPaths, PivotColumnAdapter[] columnAdapters, TreePath[] columnPaths, int row, int column, Object value)
          Visually modifies a given component, that appears in the data area of a pivot table.
 void applyRowHeaderStyle(Component c, PivotTable table, PivotRowAdapter adapter, TreePath path, int row, int column)
          Visually modifies a given component, that appears in the row header of a pivot table.
 void applyStyle(Component c, PivotTable table, int row, int column, PivotStyle style, boolean isSelected)
          Applies the style to a component, by using the styles parameters, such as background color, font and font style.
 PivotStyle getDefaultColumnHeaderStyle()
          Returns the default column header style.
 PivotStyle getDefaultDataStyle()
          Returns the default data area style.
 PivotStyle getDefaultRowHeaderStyle()
          Returns the default row header style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultDataStyle

protected PivotStyle defaultDataStyle
a style that is used as the default style for the data area


defaultColumnHeaderStyle

protected PivotStyle defaultColumnHeaderStyle
a style that is used as the default style for the column header area


defaultRowHeaderStyle

protected PivotStyle defaultRowHeaderStyle
a style that is used as the default style for the row header area

Constructor Detail

DefaultPivotStyleModel

public DefaultPivotStyleModel()
Constructs a DefaultPivotStyleModel. The default row and column header styles both use a bold font.

Method Detail

applyColumnHeaderStyle

public void applyColumnHeaderStyle(Component c,
                                   PivotTable table,
                                   PivotColumnAdapter adapter,
                                   TreePath path,
                                   int level,
                                   int column)
Visually modifies a given component, that appears in the column header of a pivot table.

Specified by:
applyColumnHeaderStyle in interface PivotStyleModel
Parameters:
c - the component to modify
table - the pivot table
adapter - the column header model
path - the path to the displayed value in the model
level - the group level that the component appears in the column header
column - the component's column

applyDataStyle

public void applyDataStyle(Component c,
                           PivotTable table,
                           PivotRowAdapter[] rowAdapters,
                           TreePath[] rowPaths,
                           PivotColumnAdapter[] columnAdapters,
                           TreePath[] columnPaths,
                           int row,
                           int column,
                           Object value)
Visually modifies a given component, that appears in the data area of a pivot table.

Specified by:
applyDataStyle in interface PivotStyleModel
Parameters:
c - the component to modify
table - the pivot table
rowAdapters - the row header models from left to right that define the cell
rowPaths - the row paths of the row header models from left to right, that define the cell
columnAdapters - the column header models from top to bottom that define the cell
columnPaths - the column paths of the column header models from top to bottom, that define the cell
row - the component's row in the pivot table
column - the component's column in the pivot table
value - the data value

applyRowHeaderStyle

public void applyRowHeaderStyle(Component c,
                                PivotTable table,
                                PivotRowAdapter adapter,
                                TreePath path,
                                int row,
                                int column)
Visually modifies a given component, that appears in the row header of a pivot table.

Specified by:
applyRowHeaderStyle in interface PivotStyleModel
Parameters:
c - the component to modify
table - the pivot table
adapter - the row header model
path - the path to the displayed value in the model
row - the component's row in the pivot table
column - the component's column in the pivot table

getDefaultColumnHeaderStyle

public PivotStyle getDefaultColumnHeaderStyle()
Returns the default column header style.

Returns:
the default column header style

getDefaultDataStyle

public PivotStyle getDefaultDataStyle()
Returns the default data area style.

Returns:
the default data area style

getDefaultRowHeaderStyle

public PivotStyle getDefaultRowHeaderStyle()
Returns the default row header style.

Returns:
the default row header style

applyStyle

public void applyStyle(Component c,
                       PivotTable table,
                       int row,
                       int column,
                       PivotStyle style,
                       boolean isSelected)
Applies the style to a component, by using the styles parameters, such as background color, font and font style.

Parameters:
c - the component the style is applied to
table - the pivot table
row - the component's row in the pivot table
column - the component's column in the pivot table
style - the style to apply
isSelected - true if the selection colors are applied, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.