Class CurveDataModel

All Implemented Interfaces:
Serializable, TableModel

public class CurveDataModel extends DefaultTableModel
See Also:
  • Field Details

    • VIS_COLUMN

      public static final int VIS_COLUMN
      Constant used to designate display column;
      See Also:
    • NAME_COLUMN

      public static final int NAME_COLUMN
      Constant used to designate name column;
      See Also:
    • colNames

      protected static final String[] colNames
    • columnWidths

      protected static final int[] columnWidths
    • _data

      protected Vector<DataColumn> _data
  • Constructor Details

    • CurveDataModel

      public CurveDataModel()
      Constructor
    • CurveDataModel

      public CurveDataModel(Vector<DataColumn> curves)
      Constructor
  • Method Details

    • getColumnCount

      public int getColumnCount()
      Get the number of columns
      Specified by:
      getColumnCount in interface TableModel
      Overrides:
      getColumnCount in class DefaultTableModel
      Returns:
      the number of columns
    • getRowCount

      public int getRowCount()
      Get the number of rows
      Specified by:
      getRowCount in interface TableModel
      Overrides:
      getRowCount in class DefaultTableModel
      Returns:
      the number of rows
    • setValueAt

      public void setValueAt(Object value, int row, int col)
      Set the value at a given row and column.
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class DefaultTableModel
      Parameters:
      value - The string to set.
      row - The zero based row.
      col - The zero based column.
    • getValueAt

      public Object getValueAt(int row, int col)
      Get the value at a given row and column
      Specified by:
      getValueAt in interface TableModel
      Overrides:
      getValueAt in class DefaultTableModel
      Returns:
      the value at a given row and column
    • add

      public void add(DataColumn curve)
      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 interface TableModel
      Overrides:
      isCellEditable in class DefaultTableModel
    • remove

      public void remove(DataColumn curve)
      remove an curve from the table.
      Parameters:
      curve - the curveto remove.
    • clear

      public void clear()
      Clear all the data
    • setData

      public void setData(Vector<DataColumn> data)
      Parameters:
      data - the data to set
    • getCurveAtRow

      public DataColumn getCurveAtRow(int row)
      Get the curve (DataColumn) in the model at the given row.
      Parameters:
      row - the zero based row
      Returns:
      the curve corresponding to the row.