public class ResizableMatrixPanel
extends Composite
Constructor and Description |
---|
ResizableMatrixPanel(int rows,
int columns)
Create a ResizableMatrixPanel with the specified dimensions.
|
ResizableMatrixPanel(int rows,
int columns,
boolean showDimensions,
boolean allowEditDiagonal,
boolean allowEditOffDiagonal,
boolean isSymmetric)
Create a ResizableMatrixPanel with the specified restrictions
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeHandler(ResizableMatrixChangeHandler handler)
Add a change handler to the matrix panel
|
void |
addColumn(int column)
Add a new column to the matrix data
|
double |
getCellValue(int row,
int column)
Get the value of a specified cell in the matrix
|
int |
getColumnDimension()
Get column dimension of the matrix
|
int |
getRowDimension()
Get row dimension of the matrix
|
void |
loadFromNamedMatrix(NamedMatrix matrix)
FIll in the matrix widgets from a NamedMatrix object
|
void |
loadMatrixData(int dataRows,
int dataColumns,
double[][] data)
Load a submatrix of data into the panel
|
void |
reset(int rows,
int columns)
Reset to the default cell value and remove all labels
|
void |
setCellErrorMessage(String msg) |
void |
setCellValue(int row,
int column,
String value)
Set the value of a specified cell in the matrix
|
void |
setColumnDimension(int newCols)
Change the column dimension of the matrix
|
void |
setColumnLabels(List<String> labelList)
Add column labels to the panel.
|
void |
setDiagonalsEditable(boolean editable)
Specify whether editing of diagonal elements is allowed
|
void |
setEnabledColumnDimension(boolean enabled)
Specify whether the column dimension of the matrix is editable
|
void |
setEnabledRowDimension(boolean enabled)
Specify whether the row dimension of the matrix is editable
|
void |
setMaxCellValue(double maxValue)
Set maximum value for cells in the matrix
|
void |
setMaxColumns(int columns)
Set maximum number of columns allowed in the matrix
|
void |
setMaxRows(int rows)
Set maximum number of rows allowed in the matrix
|
void |
setMinCellValue(double minValue)
Set minimum value for cells in the matrix
|
void |
setRowDimension(int newRows)
Change the row dimension of the matrix display
|
void |
setRowLabels(List<String> labelList)
Add row labels.
|
NamedMatrix |
toNamedMatrix(String name)
Create a NamedMatrix object from the ResizableMatrixPanel
widgets
|
public ResizableMatrixPanel(int rows, int columns)
row
- row dimensioncolumn
- column dimensionshowDimensions
- if true, the row x column dimensions will be displayed in the panelallowEditDiagonal
- if true, diagonal elements will be editableallowEditOffDiagonal
- if true, off diagonal elements will be editableisSymmetric
- indicates if the matrix is symmetricpublic ResizableMatrixPanel(int rows, int columns, boolean showDimensions, boolean allowEditDiagonal, boolean allowEditOffDiagonal, boolean isSymmetric)
row
- row dimensioncolumn
- column dimensionshowDimensions
- if true, the row x column dimensions will be displayed in the panelallowEditDiagonal
- if true, diagonal elements will be editableallowEditOffDiagonal
- if true, off diagonal elements will be editableisSymmetric
- indicates if the matrix is symmetricpublic void setRowDimension(int newRows)
newRows
- new row dimensionpublic void setColumnDimension(int newCols)
newCols
- new column dimensionpublic void addColumn(int column)
column
- column numberpublic void setRowLabels(List<String> labelList)
labelList
- list of labelspublic void setColumnLabels(List<String> labelList)
labelList
- list of labels.public void setCellValue(int row, int column, String value)
row
- cell's row indexcolumn
- cell's column indexvalue
- new cell valuepublic double getCellValue(int row, int column)
row
- cell's row indexcolumn
- cell's column indexpublic void setDiagonalsEditable(boolean editable)
editable
- if true, the diagonal cells can be editedpublic NamedMatrix toNamedMatrix(String name)
name
- name of the matrixpublic void reset(int rows, int columns)
rows
- row dimensioncolumns
- column dimensionpublic void setEnabledRowDimension(boolean enabled)
enabled
- if true, edits are allowed in the row dimensionpublic void setEnabledColumnDimension(boolean enabled)
enabled
- if true, edits are allowed in the column dimensionpublic void setMaxRows(int rows)
rows
- max allowed rowspublic void setMaxColumns(int columns)
columns
- max allowed columnspublic void setMaxCellValue(double maxValue)
rows
- max allowed rowspublic void setMinCellValue(double minValue)
columns
- max allowed columnspublic void setCellErrorMessage(String msg)
public void loadFromNamedMatrix(NamedMatrix matrix)
matrix
- NamedMatrix objectpublic void loadMatrixData(int dataRows, int dataColumns, double[][] data)
dataRows
- number of rows in the datadataColumns
- number of columns in the datadata
- the datapublic int getRowDimension()
public int getColumnDimension()
public void addChangeHandler(ResizableMatrixChangeHandler handler)
handler
- handler for dimension or contents changesUniversity of Colorado Denver, Department of Biostatistics and Informatics