|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.peace_tools.data.ESTTableModel
public class ESTTableModel
A bridge class between FASTA entries in a FASTA file and a JTable. This class serves as a bridge between the in-memory representation of fragments in a FASTA file to the actual display in JTable. This class enables reusing/sharing fragment data and displaying it different views with minimal memory footprint. The terminology used in this class is from the context of the Model-View-Controller (MVC) object-oriented design pattern.
Note: The number of columns displayed by this table model can be varied based on the column width set via a call to setColumnSize() method. By default this model provides only 2 columns.
Field Summary | |
---|---|
private int |
basesPerCol
The number of base pairs per column. |
private ESTList |
estList
Reference to the list of fragments that is actually exposed by this table model. |
private int |
maxESTLen
The maximum length of an EST sequence to be adapted by this model. |
private static long |
serialVersionUID
A generated serialization UID included just to keep the compiler happy. |
private java.lang.Integer[] |
sortedIndexs
This array contains a sorted list of indexes of fragments if a sorting scheme has been applied to the data set. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
ESTTableModel(ESTList estList)
The default constructor. |
Method Summary | |
---|---|
java.lang.Class<?> |
getColumnClass(int column)
Obtain the class that describes the data type of a given column. |
int |
getColumnCount()
This method overrides the interface method in TableModel to return the number of columns in the Table. |
java.lang.String |
getColumnName(int column)
This method overrides the interface method in RowModel to return the title for the columns. |
EST |
getESTAt(int row)
Obtain the EST entry at a given row. |
ESTList |
getESTList()
Obtain the list of ESTs associated with this model. |
int |
getRowCount()
Method to return the number of rows to be displayed in the table. |
java.lang.Object |
getValueAt(int row,
int col)
This method returns the subset of base pairs to be displayed in a given column for a given row. |
boolean |
isCellEditable(int row,
int column)
Interface method to determine if an entry in the JTable is editable. |
void |
setBasesPerCol(int basesPerCol)
Method to change the number of bases to be displayed in each column. |
void |
sort(int order)
Method to change the order in which fragments are ordered. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ESTList estList
private final int maxESTLen
private int basesPerCol
private java.lang.Integer[] sortedIndexs
private static final long serialVersionUID
Constructor Detail |
---|
public ESTTableModel(ESTList estList)
estList
- The list of fragments from a FASTA file to be used and
suitably exposed by this model class. This parameter cannot be null.Method Detail |
---|
public int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row, int col)
row
- The row for which the data is desired.col
- The column for which the data is desired.
public EST getESTAt(int row)
row
- The logical row from where the EST is to be retrieved.
Note that this method pays heed to the sorted order. So the row is
the logical row in the sorted list of entries and not the absolute
index in the EST list.
public void sort(int order)
order
- The order in which the clusters are to be sorted. The
following values are valid for this parameter: 0: no sorting,
1: shorter fragments first, 2: shorter fragments last.public void setBasesPerCol(int basesPerCol)
basesPerCol
- If this parameter is -1, then all sequences are
presented as a single column. Otherwise the sequences are presented
as multiple columns, with each column having no more than the
specified number of neucleotides.public java.lang.Class<?> getColumnClass(int column)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
column
- The zero-based index of the column whose
Class type is to be returned.
public boolean isCellEditable(int row, int column)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public ESTList getESTList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |