org.emboss.jemboss.gui
Class SequenceListTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.emboss.jemboss.gui.SequenceListTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

class SequenceListTableModel
extends javax.swing.table.AbstractTableModel

Model for the sequence table


Field Summary
static int COL_BEG
           
static int COL_DEF
           
static int COL_END
           
static int COL_LIST
           
static int COL_NAME
           
static ColumnData[] modelColumns
          Define the columns as file/start/end/list and default
protected static java.util.Vector modelVector
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
SequenceListTableModel()
           
 
Method Summary
 boolean deleteRow(int row)
          Delete a row from the table
 java.lang.Class getColumnClass(int c)
          DragJTable uses this method to determine the default renderer/ editor for each cell.
 int getColumnCount()
          Return the number of columns in the table
 java.lang.String getColumnName(int c)
          Return the name columns in the table
 int getRowCount()
          Return the number of rows in the table
protected  SequenceData getSequenceData(int nrow)
          The SequenceData for a given row number.
 java.lang.Object getValueAt(int nRow, int nCol)
          Get the Object in a cell in the table
 void insertRow(int row)
          Insert a blank row
 boolean isCellEditable(int nRow, int nCol)
          Define if a cell is editable by the user
protected  void loadStoredSeqList(java.io.File fseq)
          Load from stored file the SequenceList created from a previous session.
protected  void setDefaultData()
          Setup a blank square table
 void setValueAt(java.lang.Object value, int nRow, int nCol)
          Set the Object in a cell in the table
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelVector

protected static java.util.Vector modelVector

COL_NAME

public static final int COL_NAME
See Also:
Constant Field Values

COL_BEG

public static final int COL_BEG
See Also:
Constant Field Values

COL_END

public static final int COL_END
See Also:
Constant Field Values

COL_LIST

public static final int COL_LIST
See Also:
Constant Field Values

COL_DEF

public static final int COL_DEF
See Also:
Constant Field Values

modelColumns

public static final ColumnData[] modelColumns
Define the columns as file/start/end/list and default

Constructor Detail

SequenceListTableModel

public SequenceListTableModel()
Method Detail

getColumnClass

public java.lang.Class getColumnClass(int c)
DragJTable uses this method to determine the default renderer/ editor for each cell. If we didn't implement this method, then the last column would contain text ("true"/"false"), rather than a check box.

Parameters:
c - column index
Returns:
class represented in that column

loadStoredSeqList

protected void loadStoredSeqList(java.io.File fseq)
Load from stored file the SequenceList created from a previous session.

Parameters:
fseq - contains stored sequence list

setDefaultData

protected void setDefaultData()
Setup a blank square table


getSequenceData

protected SequenceData getSequenceData(int nrow)
The SequenceData for a given row number.

Returns:
SequenceData for the row

getRowCount

public int getRowCount()
Return the number of rows in the table

Returns:
number of rows in the table

getColumnCount

public int getColumnCount()
Return the number of columns in the table

Returns:
number of columns in the table

getColumnName

public java.lang.String getColumnName(int c)
Return the name columns in the table

Parameters:
c - column index
Returns:
name columns in the table

isCellEditable

public boolean isCellEditable(int nRow,
                              int nCol)
Define if a cell is editable by the user

Parameters:
nRow - row number
nCol - column number
Returns:
true if editable

getValueAt

public java.lang.Object getValueAt(int nRow,
                                   int nCol)
Get the Object in a cell in the table

Parameters:
nRow - row number
nCol - column number
Returns:
value of a cell in the table

setValueAt

public void setValueAt(java.lang.Object value,
                       int nRow,
                       int nCol)
Set the Object in a cell in the table

Parameters:
value - to set

insertRow

public void insertRow(int row)
Insert a blank row

Parameters:
row - index to insert at

deleteRow

public boolean deleteRow(int row)
Delete a row from the table

Parameters:
row - number to delete
Returns:
true if deleted