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 intConstant used to designate name column;static final intConstant used to designate display column;Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVectorFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DataColumn curve) Add a new curve into the table.voidclear()Clear all the dataintGet the number of columnsgetCurveAtRow(int row) Get the curve (DataColumn) in the model at the given row.intGet the number of rowsgetValueAt(int row, int col) Get the value at a given row and columnbooleanisCellEditable(int rowIndex, int columnIndex) voidremove(DataColumn curve) remove an curve from the table.voidsetData(Vector<DataColumn> data) voidsetValueAt(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, setRowCountMethods 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:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classDefaultTableModel- Returns:
- the number of columns
-
getRowCount
public int getRowCount()Get the number of rows- Specified by:
getRowCountin interfaceTableModel- Overrides:
getRowCountin classDefaultTableModel- Returns:
- the number of rows
-
setValueAt
Set the value at a given row and column.- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin 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:
getValueAtin interfaceTableModel- Overrides:
getValueAtin 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:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein 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.
-