HiRISE

HiRISE.HiPlan.Data_Slacker
Class SsrInputTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by HiRISE.HiPlan.Data_Slacker.SsrInputTableModel
All Implemented Interfaces:
Serializable, TableModel

public class SsrInputTableModel
extends AbstractTableModel

A table model for SSR input records. The model includes an enumeration of its columns.

Version:
1.3
Author:
Christian Schaller - UA/PIRL
See Also:
Serialized Form

Nested Class Summary
static class SsrInputTableModel.Column
          An enumeration of the table model's columns.
 
Field Summary
static String ID
          Class identification name with source code version and date.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
SsrInputTableModel()
          Creates a new SSR input table model with an empty list of SSR inputs.
SsrInputTableModel(List<SsrInput> records)
          Creates a new SSR input table model from a list of SSR inputs.
 
Method Summary
 Class getColumnClass(int col)
          Gets the class of the indicated column.
 int getColumnCount()
          Gets the total number of columns in this table model.
 String getColumnName(int col)
          Gets the name of the indicated column.
 SsrInput getRecord(int row)
          Gets the data record for the indicated model row.
 List<SsrInput> getRecords()
          Gets a copy of this table model's SSR input records.
 int getRowCount()
          Gets the total number of rows in this table model.
 Object getValueAt(int row, int col)
          Gets the value for the cell at the indicated row and column.
 void setRecords(List<SsrInput> records)
          Replaces this table model's current list of records with a new list.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values
Constructor Detail

SsrInputTableModel

public SsrInputTableModel(List<SsrInput> records)
Creates a new SSR input table model from a list of SSR inputs. Upon construction, its fireTableDataChanged() method is invoked.

The list of records may be null, in which case the model is empty.

Parameters:
records - the list of SSR input records for the new table model; may be null.

SsrInputTableModel

public SsrInputTableModel()
Creates a new SSR input table model with an empty list of SSR inputs. Upon construction, its fireTableDataChanged() method is invoked.

Method Detail

setRecords

public void setRecords(List<SsrInput> records)
Replaces this table model's current list of records with a new list. The new list may be null or empty; the current list will then simply be removed.

This method invokes the model's fireTableDataChanged() method.

Parameters:
records - the new list of SSR inputs; may be null.

getRecords

public List<SsrInput> getRecords()
Gets a copy of this table model's SSR input records. The list may be empty, but it will not be null.

Returns:
a copy of this table model's SSR inputs.

getRowCount

public int getRowCount()
Gets the total number of rows in this table model.

Returns:
the total number of rows in this table model.

getColumnCount

public int getColumnCount()
Gets the total number of columns in this table model. This value is equal to the number of members of the SsrInputTableModel.Column enumeration.

Returns:
the total number of columns in this table model.

getValueAt

public Object getValueAt(int row,
                         int col)
Gets the value for the cell at the indicated row and column. The class of the object returned may be obtained from the getColumnClass(int) method.

Parameters:
row - the table model row index.
col - the table model column index.
Returns:
the value object at the specified cell.

getColumnClass

public Class getColumnClass(int col)
Gets the class of the indicated column.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Parameters:
col - the table model column index.
Returns:
the class of the column.

getColumnName

public String getColumnName(int col)
Gets the name of the indicated column.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
col - the table model column index.
Returns:
the name of the column.

getRecord

public SsrInput getRecord(int row)
Gets the data record for the indicated model row.

Parameters:
row - the model row.
Returns:
the data record.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona