BioLegato 0.7.3 GDE plugin

org.biolegato.gdesupport.canvas.list
Class SequenceListModel

java.lang.Object
  extended by org.biolegato.gdesupport.canvas.list.SequenceListModel
All Implemented Interfaces:
javax.swing.ListModel, GDEModelListener

public class SequenceListModel
extends java.lang.Object
implements javax.swing.ListModel, GDEModelListener

A list model that is based on the sequence names in a sequence document.

Author:
Graham Alvare, Brian Fristensky

Constructor Summary
SequenceListModel(GDEModel data)
          Creates a new instance of SequenceListModel.
 
Method Summary
 void addListDataListener(javax.swing.event.ListDataListener l)
          Adds a data listener to the list model
 java.lang.Object getElementAt(int index)
          Returns the names of sequences based on their line number.
 int getSize()
          Returns the number of sequences in the sequence document.
 void removeListDataListener(javax.swing.event.ListDataListener l)
          Removes a data listener from the list model
 void sequenceAdded(GDEModel source, int index, Cell sequence)
          Passes any sequence additions to the data listeners.
 void sequenceChanged(GDEModel source, int index, Cell sequence, java.lang.String key)
          Passes any sequence modifications to the data listeners.
 void sequenceRemoved(GDEModel source, int index, Cell sequence)
          Passes any sequence deletions to the data listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceListModel

public SequenceListModel(GDEModel data)
Creates a new instance of SequenceListModel.

Parameters:
data - the sequence document to obtain the list data from.
Method Detail

getSize

public int getSize()
Returns the number of sequences in the sequence document.

Specified by:
getSize in interface javax.swing.ListModel
Returns:
returns the number of sequences in the sequence document.

getElementAt

public java.lang.Object getElementAt(int index)
Returns the names of sequences based on their line number.

Specified by:
getElementAt in interface javax.swing.ListModel
Parameters:
index - the line number to obtain the name of.
Returns:
returns the name of sequence in the sequence document at the line number indicated by index.

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener l)
Adds a data listener to the list model

Specified by:
addListDataListener in interface javax.swing.ListModel
Parameters:
l - the data listener to add.

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener l)
Removes a data listener from the list model

Specified by:
removeListDataListener in interface javax.swing.ListModel
Parameters:
l - the data listener to remove.

sequenceChanged

public void sequenceChanged(GDEModel source,
                            int index,
                            Cell sequence,
                            java.lang.String key)
Passes any sequence modifications to the data listeners.

Specified by:
sequenceChanged in interface GDEModelListener
Parameters:
source - the source of the modification.
index - the line number the modification occurred.
sequence - the sequence that the modification occurred.
key - the information within the sequence that has been changed.

sequenceAdded

public void sequenceAdded(GDEModel source,
                          int index,
                          Cell sequence)
Passes any sequence additions to the data listeners.

Specified by:
sequenceAdded in interface GDEModelListener
Parameters:
source - the source of the additon.
index - the line number the additon occurred.
sequence - the sequence added.

sequenceRemoved

public void sequenceRemoved(GDEModel source,
                            int index,
                            Cell sequence)
Passes any sequence deletions to the data listeners.

Specified by:
sequenceRemoved in interface GDEModelListener
Parameters:
source - the source of the deletion.
index - the line number the deletion occurred.
sequence - the sequence deleted.

BioLegato 0.7.3 GDE plugin

Copyright © 2008-2010 University of Manitoba.