Package org.nuiton.math.matrix.gui
Class MatrixTableModelOption
java.lang.Object
org.nuiton.math.matrix.gui.MatrixTableModelOption
- All Implemented Interfaces:
TableModel,MatrixTableModel
Model that take a delegate model to add additional lines during
rendering (such as row sum, column sum, row mean, column mean...)
Created: 21 mars 2006 19:01:27
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MatrixTableModelprotected booleanprotected booleanprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionMatrixTableModelOption(MatrixTableModel delegate) MatrixTableModelOption(MatrixTableModel delegate, boolean sumOption, boolean meanOption, boolean transposeOption) -
Method Summary
Modifier and TypeMethodDescriptionvoidintGet how many additional columns table model need to renderer matrix.intGet how many additional rows table model need to renderer matrix.Class<?> getColumnClass(int columnIndex) intgetColumnName(int columnIndex) protected DoublegetComputedValueForColumn(int delegateColumnIndex, boolean mean) Compute sum for delegate model column index.protected DoublegetComputedValueForRow(int delegateRowIndex, boolean mean) Compute sum for delegate model row index.intgetValueAt(int rowIndex, int columnIndex) protected ObjectgetValueAtTranposable(int rowIndex, int columnIndex, int rowCount, int columnCount) Get value qui fonctionne aussi en transposée.booleanisCellEditable(int rowIndex, int columnIndex) booleanbooleanbooleanvoidvoidvoidsetMeanOption(boolean meanOption) voidsetSumOption(boolean sumOption) voidsetTransposeOption(boolean transposeOption) voidsetValueAt(Object aValue, int rowIndex, int columnIndex)
-
Field Details
-
delegate
-
sumOption
protected boolean sumOption -
meanOption
protected boolean meanOption -
transposeOption
protected boolean transposeOption
-
-
Constructor Details
-
MatrixTableModelOption
-
MatrixTableModelOption
public MatrixTableModelOption(MatrixTableModel delegate, boolean sumOption, boolean meanOption, boolean transposeOption)
-
-
Method Details
-
isSumOption
public boolean isSumOption() -
setSumOption
public void setSumOption(boolean sumOption) -
isMeanOption
public boolean isMeanOption() -
setMeanOption
public void setMeanOption(boolean meanOption) -
isTransposeOption
public boolean isTransposeOption() -
setTransposeOption
public void setTransposeOption(boolean transposeOption) -
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceTableModel
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditablein interfaceTableModel
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
getValueAtTranposable
protected Object getValueAtTranposable(int rowIndex, int columnIndex, int rowCount, int columnCount) Get value qui fonctionne aussi en transposée. Le principe est que des que les bornes sur modele delegé sont dépassées on réalise des opération (mean/sum). Actuellement le code n'est vraiment pas evident.- Parameters:
rowIndex- rowIndexcolumnIndex- columnIndexrowCount- rowCountcolumnCount- columnCount- Returns:
- object at rowIndex/columnCount
-
getComputedValueForRow
Compute sum for delegate model row index.- Parameters:
delegateRowIndex- delegate model row index- Returns:
- sum for row
-
getComputedValueForColumn
Compute sum for delegate model column index.- Parameters:
delegateColumnIndex- delegate model column index- Returns:
- sum for column
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel
-
addTableModelListener
- Specified by:
addTableModelListenerin interfaceTableModel
-
removeTableModelListener
- Specified by:
removeTableModelListenerin interfaceTableModel
-
setMatrix
- Specified by:
setMatrixin interfaceMatrixTableModel
-
getMatrix
- Specified by:
getMatrixin interfaceMatrixTableModel
-
getMatrixCellRenderer
- Specified by:
getMatrixCellRendererin interfaceMatrixTableModel
-
getAdditionalRows
public int getAdditionalRows()Description copied from interface:MatrixTableModelGet how many additional rows table model need to renderer matrix.- Specified by:
getAdditionalRowsin interfaceMatrixTableModel- Returns:
- additional rows
-
getAdditionalColumns
public int getAdditionalColumns()Description copied from interface:MatrixTableModelGet how many additional columns table model need to renderer matrix.- Specified by:
getAdditionalColumnsin interfaceMatrixTableModel- Returns:
- additional columns
-