|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
com.citra.pivot.DefaultPivotTableModel
public class DefaultPivotTableModel
DefaultPivotTableModel is the default PivotTableModel implementation. The models for the row and column header as well as the data area can be assigned with the corresponding set methods. Also, the model listens for table model events received from the row header model, as well as events from the data model, and configures itself accordingly.
Field Summary | |
---|---|
protected PivotColumnAdapter |
columnAdapter
the column header's model |
protected PivotDataModel |
dataModel
the data area's model |
protected PivotRowAdapter |
rowAdapter
the row header's model |
protected boolean |
showColumnHeader
whether to display the column header |
protected boolean |
showColumnSeparator
whether to show the column separator |
protected boolean |
showRowHeader
whether to display the row header |
protected boolean |
showRowSeparator
whether to show the row separator |
protected boolean |
showSummary
whether to show the summary cell |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
DefaultPivotTableModel()
Constructs a DefaultPivotTableModel. |
|
DefaultPivotTableModel(PivotDataModel dataModel)
Constructs a DefaultPivotTableModel. |
Method Summary | |
---|---|
protected PivotDataModel |
createDefaultDataModel()
Creates the default model for the data area. |
void |
dataChanged(ChangeEvent e)
Notification that the data of a pivot data model has changed. |
void |
edgesChanged(ChangeEvent e)
Notification that the edges (row and/or column header) of a pivot data model have changed. |
PivotColumnAdapter |
getColumnAdapter()
Returns the model's column adapter. |
Class |
getColumnClass(int columnIndex)
Returns Object.class regardless of columnIndex . |
Class |
getColumnClass(int row,
int column)
Determines the class of the model's cell at coordinates row and column. |
int |
getColumnCount()
Returns the number of columns in the model. |
String |
getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... |
PivotDataModel |
getDataModel()
Retrieves the pivot data model that contains the actual data, excluding the row and column header. |
PivotRowAdapter |
getRowAdapter()
Returns the model's row adapter. |
int |
getRowCount()
Returns the number of rows in the model. |
boolean |
getShowColumnHeader()
Determines whether to display the column header. |
boolean |
getShowColumnSeparator()
Determines whether to show the column separator. |
boolean |
getShowRowHeader()
Determines whether to display the row header. |
boolean |
getShowRowSeparator()
Determines whether to show the row separator. |
boolean |
getShowSummary()
Determines whether to show the summary cell. |
Object |
getValueAt(int row,
int column)
Returns the value for the cell at columnIndex and
rowIndex . |
void |
setColumnAdapter(PivotColumnAdapter adapter)
Assigns the model for the pivot table's column header. |
void |
setDataModel(PivotDataModel dataModel)
Assigns the model for the pivot table's data area. |
void |
setRowAdapter(PivotRowAdapter adapter)
Assigns the model for the pivot table's row header. |
void |
setShowColumnHeader(boolean showColumnHeader)
Determines whether to display the column header. |
void |
setShowColumnSeparator(boolean showColumnSeparator)
Determines whether to show the column separator. |
void |
setShowRowHeader(boolean showRowHeader)
Determines whether to display the row header. |
void |
setShowRowSeparator(boolean showRowSeparator)
Determines whether to show the row separator. |
void |
setShowSummary(boolean showSummary)
Determines whether to show the summary cell. |
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
This empty implementation is provided so users don't have to implement this method if their data model is not editable. |
void |
tableChanged(TableModelEvent e)
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, 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, isCellEditable, removeTableModelListener |
Field Detail |
---|
protected PivotRowAdapter rowAdapter
protected PivotColumnAdapter columnAdapter
protected PivotDataModel dataModel
protected boolean showRowSeparator
protected boolean showColumnSeparator
protected boolean showSummary
protected boolean showRowHeader
protected boolean showColumnHeader
Constructor Detail |
---|
public DefaultPivotTableModel()
public DefaultPivotTableModel(PivotDataModel dataModel)
Method Detail |
---|
protected PivotDataModel createDefaultDataModel()
DefaultPivotDataModel
.
public void dataChanged(ChangeEvent e)
dataChanged
in interface PivotDataModelListener
e
- the event that triggers the notificationpublic void edgesChanged(ChangeEvent e)
edgesChanged
in interface PivotDataModelListener
e
- the event that triggers the notificationpublic PivotColumnAdapter getColumnAdapter()
getColumnAdapter
in interface PivotTableModel
public Class getColumnClass(int columnIndex)
Object.class
regardless of columnIndex
.
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
columnIndex
- the column being queried
public Class getColumnClass(int row, int column)
getColumnClass
in interface PivotTableModel
row
- the cell's row indexcolumn
- the cell's column index
public int getColumnCount()
JTable
uses this method to determine how many columns it
should create and display by default.
getColumnCount
in interface TableModel
TableModel.getRowCount()
public String getColumnName(int column)
column
cannot be found,
returns an empty string.
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
column
- the column being queried
column
public PivotDataModel getDataModel()
getDataModel
in interface PivotTableModel
public PivotRowAdapter getRowAdapter()
getRowAdapter
in interface PivotTableModel
public int getRowCount()
JTable
uses this method to determine how many rows it
should display. This method should be quick, as it
is called frequently during rendering.
getRowCount
in interface TableModel
TableModel.getColumnCount()
public boolean getShowColumnHeader()
public boolean getShowColumnSeparator()
public boolean getShowRowHeader()
public boolean getShowRowSeparator()
public boolean getShowSummary()
public Object getValueAt(int row, int column)
columnIndex
and
rowIndex
.
getValueAt
in interface TableModel
row
- the row whose value is to be queriedcolumn
- the column whose value is to be queried
public void setColumnAdapter(PivotColumnAdapter adapter)
adapter
- the model to assign for the column headerpublic void setDataModel(PivotDataModel dataModel)
dataModel
- the model to assign for the data areapublic void setRowAdapter(PivotRowAdapter adapter)
adapter
- the model to assign for the row headerpublic void setShowColumnHeader(boolean showColumnHeader)
showColumnHeader
- true if the column header is displayed, false otherwisepublic void setShowColumnSeparator(boolean showColumnSeparator)
showColumnSeparator
- true if the column separator is shown, false otherwisepublic void setShowRowHeader(boolean showRowHeader)
showRowHeader
- true if the row header is displayed, false otherwisepublic void setShowRowSeparator(boolean showRowSeparator)
showRowSeparator
- true if the row separator is shown, false otherwisepublic void setShowSummary(boolean showSummary)
showSummary
- true if the summary cell is shown, false otherwisepublic void setValueAt(Object value, int rowIndex, int columnIndex)
javax.swing.table.AbstractTableModel
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
value
- value to assign to cellrowIndex
- row of cellcolumnIndex
- column of cellTableModel.getValueAt(int, int)
,
TableModel.isCellEditable(int, int)
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |