org.emboss.jemboss.gui
Class SequenceListTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.emboss.jemboss.gui.SequenceListTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

class SequenceListTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

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
           
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, 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

COL_BEG

public static final int COL_BEG

COL_END

public static final int COL_END

COL_LIST

public static final int COL_LIST

COL_DEF

public static final int COL_DEF

modelColumns

public static final ColumnData[] modelColumns
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.
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
column - index
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:
File - 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.
Parameters:
row - number
Returns:
SequenceData for the row

getRowCount

public int getRowCount()
Return the number of rows in the table
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel
Returns:
number of rows in the table

getColumnCount

public int getColumnCount()
Return the number of columns in the table
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel
Returns:
number of columns in the table

getColumnName

public java.lang.String getColumnName(int c)
Return the name columns in the table
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Returns:
name columns in the table

isCellEditable

public boolean isCellEditable(int nRow,
                              int nCol)
Define if a cell is editable by the user
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Returns:
true if editable

getValueAt

public java.lang.Object getValueAt(int nRow,
                                   int nCol)
Get the Object in a cell in the table
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Parameters:
row - number
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
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
value - to set
row - number
column - number

insertRow

public void insertRow(int row)
Insert a blank row
Parameters:
row - number to insert at

deleteRow

public boolean deleteRow(int row)
Delete a row from the table
Parameters:
row - number to delete
Returns:
true if deleted