|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel com.jidesoft.pivot.HeaderTableModel
public class HeaderTableModel
TableModel for the row header and column header of the pivot table.
Field Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
HeaderTableModel(IPivotDataModel pivotDataModel,
CompoundKey[] rows,
boolean rowHeader)
|
Method Summary | |
---|---|
void |
collapse(int index)
|
void |
collapse(int rowIndex,
int columnIndex)
Collapses the cell at the specified row and column index is expandable. |
void |
collapseAll()
Collapses all expandable level cells. |
void |
collapseAll(int[] noActionFieldIndices)
Collapses all expandable level cells without touching those PivotFields in the array. |
protected List<Values> |
createList()
Creates the List used internally. |
void |
expand(int index)
Expands the whole column if if it is the row header or expands the whole row if it is the column header. |
void |
expand(int rowIndex,
int columnIndex)
Expands the cell at the specified row and column index is expandable. |
void |
expandAll()
Expands all expandable cells. |
void |
expandAll(int[] noActionFieldIndices)
Expands all expandable level cells without touching those PivotFields in the array. |
void |
fireTableStructureChanged()
|
Class |
getCellClassAt(int row,
int column)
Gets the type at cell (row, column). |
CellSpan |
getCellSpanAt(int rowIndex,
int columnIndex)
Gets the cell span at the specified row and column. |
CellStyle |
getCellStyleAt(int rowIndex,
int columnIndex)
Gets the cell style at the specified cell. |
int |
getColumnCount()
Gets the column count. |
Object |
getColumnIdentifier(int columnIndex)
Returns the identifier of the column in the model. |
String |
getColumnName(int column)
|
ConverterContext |
getConverterContextAt(int row,
int column)
Gets the converter context at cell (row, column). |
EditorContext |
getEditorContextAt(int row,
int column)
Gets the editor context at cell (row, column). |
Expandable |
getExpandable(int rowIndex,
int columnIndex)
Gets the Expandable object at specified row index and column index. |
Map<String,Boolean> |
getExpansionState()
Gets the expansion sate of the HeaderTableModel. |
PivotField |
getFieldAt(int rowIndex,
int columnIndex)
Gets the pivot field associated with the cell. |
Object[] |
getKeyValuesAt(int index)
|
protected int |
getNumberOfDataFields()
|
IPivotDataModel |
getPivotDataModel()
Gets the pivot data model. |
int |
getRowCount()
Gets the row count. |
Class<?> |
getRowValueClass(int rowIndex)
|
int |
getSummaryColumn(int rowIndex)
|
int |
getSummaryType(int rowIndex)
|
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value for the cell at columnIndex and rowIndex . |
String |
getValueAtInString(Locale locale,
int rowIndex,
int columnIndex)
Deprecated. replaced by HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter) in AggregateTable scenario. |
String |
getValueAtInString(Locale locale,
Object value,
int rowIndex,
int columnIndex)
Deprecated. replaced by HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter) in AggregateTable scenario. |
String |
getValueAtInString(PivotTablePane pane,
int rowIndex,
int columnIndex)
Deprecated. replaced by HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter) in AggregateTable scenario. |
String |
getValueAtInString(PivotTablePane pane,
Object value,
int rowIndex,
int columnIndex)
Deprecated. replaced by HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter) in AggregateTable scenario. |
Values |
getValuesAt(int index)
Returns the Values at the row specified by row . |
int |
indexOf(Object[] keys)
Index of the Objects in the HeaderTableModel. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
boolean |
isCellSpanOn()
Checks if the cell span is on for this table model. |
boolean |
isCellStyleOn()
Checks if the style is on. |
boolean |
isCollapsed(int rowIndex,
int columnIndex)
Checks if the cell at the specified row and column index is collapsed. |
boolean |
isDataCell(int rowIndex,
int columnIndex)
|
protected boolean |
isDataFieldAdded()
Should date fields added to this field table model. |
boolean |
isExpandable(int rowIndex,
int columnIndex)
Checks if the cell at the specified row and column index is expandable. |
boolean |
isExpanded(int rowIndex,
int columnIndex)
Checks if the cell at the specified row and column index is expanded. |
boolean |
isGrandTotalRowOrColumn(int index)
Checks if the row or column at the index is a grand total row or column. |
boolean |
isRowHeader()
Checks if the table model is for row header. |
boolean |
isRunningSummaryRowOrColumn(int index)
Checks if the row or column at the index is a running summary row or column. |
boolean |
isSubtotalRowOrColumn(int index)
Checks if the row or column at the index is a sub total row or column. |
void |
refreshAfterUpdateExpandable(int oldColumnCount)
Refresh the header table model after updating expandable. |
void |
setCellSpanOn(boolean cellSpanOn)
Sets the cell span on or off. |
void |
setExpansionState(Map<String,Boolean> expandedMap)
Sets the expansion state. |
protected void |
setRows(CompoundKey[] rows)
|
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
|
protected void |
setValueExpanded(Expandable value,
boolean expanded)
Update the value's expandable status. |
protected boolean |
shouldOptimize(int changedKeyCount,
int totalKeyCount)
Check if the refresh process should be optimized. |
void |
toggle(int rowIndex,
int columnIndex)
Toggles the cell at the specified row and column index is expandable. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, removeTableModelListener |
Constructor Detail |
---|
public HeaderTableModel(IPivotDataModel pivotDataModel, CompoundKey[] rows, boolean rowHeader)
pivotDataModel
- the PivotDataModel.rows
- the compound keys.rowHeader
- true if it is the row header. False if it is the column header.Method Detail |
---|
protected boolean shouldOptimize(int changedKeyCount, int totalKeyCount)
changedKeyCount
- changed CompoundKey countstotalKeyCount
- the total CompoundKey counts
protected void setRows(CompoundKey[] rows)
protected int getNumberOfDataFields()
public void refreshAfterUpdateExpandable(int oldColumnCount)
oldColumnCount
- the column count before updatingprotected void setValueExpanded(Expandable value, boolean expanded)
refreshAfterUpdateExpandable(int)
, when
this method is invoked, the expandable has not been updated. However, this method could be invoked many times if
collapseAll() or expandAll() is invoked.
value
- the expandable valueexpanded
- the new expanded statuspublic void fireTableStructureChanged()
fireTableStructureChanged
in class AbstractTableModel
protected List<Values> createList()
CachedArrayList
instance so
that we get a faster indexOf performance.
public boolean isRowHeader()
public int getRowCount()
getRowCount
in interface TableModel
public Object getColumnIdentifier(int columnIndex)
ColumnIdentifierTableModel
JideTable
uses this method to get the unique
identifier of this column.
getColumnIdentifier
in interface ColumnIdentifierTableModel
columnIndex
- the index of the column
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public Values getValuesAt(int index)
row
.
index
- the row whose row is to be queried
public Object[] getKeyValuesAt(int index)
public Object getValueAt(int rowIndex, int columnIndex)
columnIndex
and rowIndex
.
getValueAt
in interface TableModel
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried
public Class<?> getRowValueClass(int rowIndex)
public int getSummaryType(int rowIndex)
public int getSummaryColumn(int rowIndex)
public Expandable getExpandable(int rowIndex, int columnIndex)
rowIndex
- the row index of the cell.columnIndex
- the column index of the cell
public CellSpan getCellSpanAt(int rowIndex, int columnIndex)
SpanModel
private final CellSpan span = new CellSpan(0,0,1,1);
public CellSpan getCellSpanAt(int row, int col) {
span.setRow(...);
span.setColumn(...);
span.setRowSpan(...);
span.setColumnSpan(...);
return span;
}
For performance consideration, if the cell span has 1 row span and 1 column span, it is better to return null
instead of new CellSpan(row, column, 1, 1).
getCellSpanAt
in interface SpanModel
rowIndex
- the row index.columnIndex
- the column index.
public void setCellSpanOn(boolean cellSpanOn)
cellSpanOn
- true or false.public boolean isCellSpanOn()
isCellSpanOn
in interface SpanModel
public PivotField getFieldAt(int rowIndex, int columnIndex)
rowIndex
- the row indexcolumnIndex
- the column index
public ConverterContext getConverterContextAt(int row, int column)
ContextSensitiveTableModel
getConverterContextAt
in interface ContextSensitiveTableModel
row
- the row indexcolumn
- the column index
public EditorContext getEditorContextAt(int row, int column)
ContextSensitiveTableModel
getEditorContextAt
in interface ContextSensitiveTableModel
row
- the row indexcolumn
- the column index
public Class getCellClassAt(int row, int column)
ContextSensitiveTableModel
getCellClassAt
in interface ContextSensitiveTableModel
row
- the row indexcolumn
- the column index
public boolean isExpandable(int rowIndex, int columnIndex)
rowIndex
- the row index of the cellcolumnIndex
- the column index of the cell
public boolean isExpanded(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index.
public boolean isCollapsed(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index.
public void expand(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index.public void expand(int index)
index
- the row index if it is the column header or the column index if it is the row header.public void collapse(int index)
public void collapse(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index.public void toggle(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index.public void expandAll()
public void expandAll(int[] noActionFieldIndices)
noActionFieldIndices
- those fields that should not be collapsedpublic void collapseAll()
public void collapseAll(int[] noActionFieldIndices)
noActionFieldIndices
- those fields that should not be collapsedprotected boolean isDataFieldAdded()
public boolean isDataCell(int rowIndex, int columnIndex)
public final CellStyle getCellStyleAt(int rowIndex, int columnIndex)
PivotDataModel.setCellStyleProvider(PivotCellStyleProvider)
to provide cell style for HeaderTable.
getCellStyleAt
in interface StyleModel
rowIndex
- the row index.columnIndex
- the column index.
public final boolean isCellStyleOn()
StyleModel
isCellStyleOn
in interface StyleModel
public boolean isRunningSummaryRowOrColumn(int index)
index
- the row index if the HeaderTableModel is used in row header of the pivot table. If the
HeaderTableModel is used as column header, the rowIndex should be the column index.
public boolean isSubtotalRowOrColumn(int index)
index
- the row index if the HeaderTableModel is used in row header of the pivot table. If the
HeaderTableModel is used as column header, the rowIndex should be the column index.
public boolean isGrandTotalRowOrColumn(int index)
index
- the row index if the HeaderTableModel is used in row header of the pivot table. If the
HeaderTableModel is used as column header, the rowIndex should be the column index.
public IPivotDataModel getPivotDataModel()
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public int indexOf(Object[] keys)
keys
- the Objects array
@Deprecated public String getValueAtInString(PivotTablePane pane, int rowIndex, int columnIndex)
HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter)
in AggregateTable scenario.
getValueAtInString(PivotTablePane,
Object, int, int)
pane
- the PivotTablePanerowIndex
- the row index of the cellcolumnIndex
- the column index of the cell
@Deprecated public String getValueAtInString(Locale locale, int rowIndex, int columnIndex)
HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter)
in AggregateTable scenario.
getValueAtInString(PivotTablePane,
Object, int, int)
locale
- the locale to get the correct string.rowIndex
- the row index of the cellcolumnIndex
- the column index of the cell
@Deprecated public String getValueAtInString(PivotTablePane pane, Object value, int rowIndex, int columnIndex)
HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter)
in AggregateTable scenario.
pane
- the PivotTablePanevalue
- the valuerowIndex
- the row index of the cellcolumnIndex
- the column index of the cell
@Deprecated public String getValueAtInString(Locale locale, Object value, int rowIndex, int columnIndex)
HeaderTable.getValueAtInString(int, int, com.jidesoft.hssf.HssfTableUtils.CellValueConverter)
in PivotTablePane scenario or AggregateTable.getValueAtInString(int, int,
com.jidesoft.grid.ValueConverter)
in AggregateTable scenario.
locale
- the locale to get the correct string.value
- the valuerowIndex
- the row index of the cellcolumnIndex
- the column index of the cell
public Map<String,Boolean> getExpansionState()
setExpansionState(java.util.Map)
to restore the expansion
state.
In high performance mode, it will always return null to avoid going through the tree hierarchy.
public void setExpansionState(Map<String,Boolean> expandedMap)
expandedMap
- the expansion state.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |