Package cnuphys.splot.edit
Class CurveDataModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
cnuphys.splot.edit.CurveDataModel
- All Implemented Interfaces:
Serializable
,TableModel
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<DataColumn>
protected static final String[]
protected static final int[]
static final int
Constant used to designate name column;static final int
Constant used to designate display column;Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(DataColumn curve) Add a new curve into the table.void
clear()
Clear all the dataint
Get the number of columnsgetCurveAtRow
(int row) Get the curve (DataColumn) in the model at the given row.int
Get the number of rowsgetValueAt
(int row, int col) Get the value at a given row and columnboolean
isCellEditable
(int rowIndex, int columnIndex) void
remove
(DataColumn curve) remove an curve from the table.void
setData
(Vector<DataColumn> data) void
setValueAt
(Object value, int row, int col) Set the value at a given row and column.Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnName, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
VIS_COLUMN
public static final int VIS_COLUMNConstant used to designate display column;- See Also:
-
NAME_COLUMN
public static final int NAME_COLUMNConstant used to designate name column;- See Also:
-
colNames
-
columnWidths
protected static final int[] columnWidths -
_data
-
-
Constructor Details
-
CurveDataModel
public CurveDataModel()Constructor -
CurveDataModel
Constructor
-
-
Method Details
-
getColumnCount
public int getColumnCount()Get the number of columns- Specified by:
getColumnCount
in interfaceTableModel
- Overrides:
getColumnCount
in classDefaultTableModel
- Returns:
- the number of columns
-
getRowCount
public int getRowCount()Get the number of rows- Specified by:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classDefaultTableModel
- Returns:
- the number of rows
-
setValueAt
Set the value at a given row and column.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classDefaultTableModel
- Parameters:
value
- The string to set.row
- The zero based row.col
- The zero based column.
-
getValueAt
Get the value at a given row and column- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classDefaultTableModel
- Returns:
- the value at a given row and column
-
add
Add a new curve into the table.- Parameters:
curve
- the new object to add to the model.
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classDefaultTableModel
-
remove
remove an curve from the table.- Parameters:
curve
- the curveto remove.
-
clear
public void clear()Clear all the data -
setData
- Parameters:
data
- the data to set
-
getCurveAtRow
Get the curve (DataColumn) in the model at the given row.- Parameters:
row
- the zero based row- Returns:
- the curve corresponding to the row.
-