|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.data.ClusterTreeTableModel
public class ClusterTreeTableModel
The tree table model that provides a facade to display cluster information in a tree-table.
This class servers as a light weight wrapper to adapt the in-memory cluster representation to be displayed in a tree-table. The first column in the tree-table displays an hierarchical view of the clusters. The remaining columns display the EST sequence base pair information. This class serves as the "Model" as in a the Model-View-Controller design pattern.
The tree-table or Outline model is a generic non-standard GUI component developed by Sun Microsystems as part of the NetBeans IDE. This jar has been obtain from the NetBeans package as a part. The tree-table is a combination both a JTree and a JTable. The first column in the tree-table is a tree that provides the user with a convenient interface to access and control view of hierarchical information. The remaining columns in the tree-table display detailed information about each entry in the tree table.
Field Summary | |
---|---|
private int |
basesPerCol
The number of base pairs per column. |
private ClusterFile |
clusterFile
Reference to the cluster file that contains the cluster data to be adapted and interfaced by this model. |
private ESTList |
estList
Reference to the EST file that contains the cluster data to be adapted and interfaced by this model. |
private int |
maxESTLen
The maximum length of an EST sequence to be adapted by this model. |
private java.lang.Integer[] |
sortedSubClusterIndexs
This array contains a sorted list of indexes of fragments if a sorting scheme has been applied to the data set. |
private java.util.ArrayList<javax.swing.event.TreeModelListener> |
treeModelListeners
The list of tree mode listeners that were added to this tree model. |
private MSTClusterData |
wsEntry
A handy reference to the workspace entry from which the data for this cluster table model was actually obtained. |
Constructor Summary | |
---|---|
ClusterTreeTableModel(ClusterFile clusters,
ESTList ests,
MSTClusterData wsEntry)
The constructor. |
Method Summary | |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener tml)
Adds a listener to be notified when the data associated with the data set changes. |
protected void |
fireTableStructureChanged()
Helper method to broadcast notification to all model listeners. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns the child cluster or EST node for a given parent node. |
int |
getChildCount(java.lang.Object parent)
Return the number of child nodes for a given cluster node. |
ClusterFile |
getClusterFile()
Obtain the cluster file from where cluster data was obtained. |
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 RowModel to return the number of columns in the TreeTable. |
java.lang.String |
getColumnName(int column)
This method overrides the interface method in RowModel to return the title for the columns. |
ESTList |
getESTList()
Obtain the list of ESTs associated with this model. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Obtain the index of a given child node within its immediate parent. |
ClusterNode |
getRoot()
Obtain the top-level root node. |
java.lang.Object |
getValueFor(java.lang.Object node,
int column)
This method returns the subset of base pairs to be displayed in a given column for a given RowModel. |
MSTClusterData |
getWsEntry()
Obtain the actual workspace entry whose data is contained in this model. |
boolean |
isCellEditable(java.lang.Object node,
int column)
Determine if the cell in this column is editable for the passed node. |
boolean |
isLeaf(java.lang.Object node)
Determine if a given node in the tree is a leaf node. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener tml)
Removes a listener from the list of listeners maintained by this class. |
void |
setValueFor(java.lang.Object node,
int column,
java.lang.Object value)
Set the value of the object in this column. |
void |
sort(int order)
Method to change the order in which top-level clusters are ordered. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
Messaged when the user has altered the value for the item identified by path to newValue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ClusterFile clusterFile
private final MSTClusterData wsEntry
private final ESTList estList
private final int maxESTLen
private int basesPerCol
private java.lang.Integer[] sortedSubClusterIndexs
private java.util.ArrayList<javax.swing.event.TreeModelListener> treeModelListeners
Constructor Detail |
---|
public ClusterTreeTableModel(ClusterFile clusters, ESTList ests, MSTClusterData wsEntry)
clusters
- The set of clusters to be displayed by this class.ests
- The set of ESTs that contain information about each
EST in the clusters.wsEntry
- The workspace entry corresponding to the clusters being
adapted by this object.Method Detail |
---|
public java.lang.Class<?> getColumnClass(int column)
getColumnClass
in interface org.netbeans.swing.outline.RowModel
column
- The zero-based index of the column whose
Class type is to be returned.public int getColumnCount()
getColumnCount
in interface org.netbeans.swing.outline.RowModel
public java.lang.String getColumnName(int column)
getColumnName
in interface org.netbeans.swing.outline.RowModel
public java.lang.Object getValueFor(java.lang.Object node, int column)
getValueFor
in interface org.netbeans.swing.outline.RowModel
public boolean isCellEditable(java.lang.Object node, int column)
isCellEditable
in interface org.netbeans.swing.outline.RowModel
node
- The node corresponding to the entry in the tree.column
- The zero-based index of the column to be edited.
public void setValueFor(java.lang.Object node, int column, java.lang.Object value)
setValueFor
in interface org.netbeans.swing.outline.RowModel
node
- The node corresponding to the entry in the tree.column
- The zero-based index of the column to be edited.value
- The new value to be set for the given column and
node (row).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: smaller clusters first, 2: smaller clusters last.protected void fireTableStructureChanged()
public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
addTreeModelListener
in interface javax.swing.tree.TreeModel
tml
- The listener to be added to the list of listeners to
be notified when the data associated with the workspace changes.public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public ClusterNode getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
node
- The node must be a valid node obtained via an
earlier call to the getChild.
public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
tml
- The listener to be removed from the list of listeners
to receive updates.public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
public ESTList getESTList()
public ClusterFile getClusterFile()
public MSTClusterData getWsEntry()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |