uk.ac.man.bioinf.apps.cinema.motif
Class NamedAlignmentSelectionModel

java.lang.Object
  |
  +--uk.ac.man.bioinf.apps.cinema.motif.NamedAlignmentSelectionModel
All Implemented Interfaces:
AlignmentSelectionListener, AlignmentSelectionModel, EventListener

public class NamedAlignmentSelectionModel
extends Object
implements AlignmentSelectionModel, AlignmentSelectionListener

NamedAlignmentSelectionModel.java Stores multiple selections each one with a name. Created: Wed Dec 27 15:20:30 2000

Version:
$Id: NamedAlignmentSelectionModel.java,v 1.4 2001/04/11 17:04:42 lord Exp $
Author:
Phillip Lord

Constructor Summary
NamedAlignmentSelectionModel()
           
 
Method Summary
 void addAlignmentSelectionListener(AlignmentSelectionListener listener)
           
 void clearAllSelections()
           
 void clearSelection()
          Clear all the selections in this model
 void clearSelection(String name)
           
 void extendSelection(SequenceAlignmentPoint point)
          Start a selection at the given point
 SequenceAlignmentRectangle getCurrentSelection()
          Returns the current selection or null if there is no selection.
 String getCurrentSelectionName()
           
 int getNumberSelections()
          Get the number of selections.
 SequenceAlignmentRectangle getRectangleAtPoint(SequenceAlignmentPoint point)
          Get the first selection rectangle which surrounds the point, or null if there is not one.
 SequenceAlignmentRectangle[] getRectanglesAtPoint(SequenceAlignmentPoint point)
          Get all selection rectangles which surround this point, or null if there is not one
 SequenceAlignmentRectangle getSelectionAt(int index)
          Gets the given selection.
 SequenceAlignmentRectangle getSelectionForName(String name)
           
 Iterator getSelectionNameIterator()
           
 boolean isPointSelected(SequenceAlignmentPoint point)
          Is the point within one of the selection rectangles
 boolean isSelecting()
          is the current selection in the process of being selected.
 void removeAlignmentSelectionListener(AlignmentSelectionListener listener)
           
 void resizeSelection(String selection, Direction dir, int size)
           
 void setNameForSelection(String oldName, String newName)
           
 void sortMotifs()
           
 void stopSelection(SequenceAlignmentPoint point)
          Complete the selection at the given point
 void valueChanged(AlignmentSelectionEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedAlignmentSelectionModel

public NamedAlignmentSelectionModel()
Method Detail

sortMotifs

public void sortMotifs()

getSelectionNameIterator

public Iterator getSelectionNameIterator()

getCurrentSelectionName

public String getCurrentSelectionName()

getSelectionForName

public SequenceAlignmentRectangle getSelectionForName(String name)

setNameForSelection

public void setNameForSelection(String oldName,
                                String newName)

clearAllSelections

public void clearAllSelections()

clearSelection

public void clearSelection(String name)

resizeSelection

public void resizeSelection(String selection,
                            Direction dir,
                            int size)

isSelecting

public boolean isSelecting()
Description copied from interface: AlignmentSelectionModel
is the current selection in the process of being selected.

Specified by:
isSelecting in interface AlignmentSelectionModel
Returns:
true is selection is changing

getCurrentSelection

public SequenceAlignmentRectangle getCurrentSelection()
Description copied from interface: AlignmentSelectionModel
Returns the current selection or null if there is no selection. If there is more than one selection this should return the most recently made selection

Specified by:
getCurrentSelection in interface AlignmentSelectionModel
Returns:
the selection

getNumberSelections

public int getNumberSelections()
Description copied from interface: AlignmentSelectionModel
Get the number of selections.

Specified by:
getNumberSelections in interface AlignmentSelectionModel
Returns:
the number of selections

getSelectionAt

public SequenceAlignmentRectangle getSelectionAt(int index)
                                          throws IndexOutOfBoundsException
Description copied from interface: AlignmentSelectionModel
Gets the given selection. The index should reflect the chronological order in which the selections were made, with the smallest index first

Specified by:
getSelectionAt in interface AlignmentSelectionModel
Parameters:
index - the index
Returns:
the selection array index at the given index
IndexOutOfBoundsException

isPointSelected

public boolean isPointSelected(SequenceAlignmentPoint point)
Description copied from interface: AlignmentSelectionModel
Is the point within one of the selection rectangles

Specified by:
isPointSelected in interface AlignmentSelectionModel
Parameters:
point - the point
Returns:
true if point is within a rectangle

clearSelection

public void clearSelection()
Description copied from interface: AlignmentSelectionModel
Clear all the selections in this model

Specified by:
clearSelection in interface AlignmentSelectionModel

getRectanglesAtPoint

public SequenceAlignmentRectangle[] getRectanglesAtPoint(SequenceAlignmentPoint point)
Description copied from interface: AlignmentSelectionModel
Get all selection rectangles which surround this point, or null if there is not one

Specified by:
getRectanglesAtPoint in interface AlignmentSelectionModel
Parameters:
point - the point in question
Returns:
the rectangles surrounding point

getRectangleAtPoint

public SequenceAlignmentRectangle getRectangleAtPoint(SequenceAlignmentPoint point)
Description copied from interface: AlignmentSelectionModel
Get the first selection rectangle which surrounds the point, or null if there is not one.

Specified by:
getRectangleAtPoint in interface AlignmentSelectionModel
Parameters:
point - the point in question
Returns:
the rectangle surrounding point

extendSelection

public void extendSelection(SequenceAlignmentPoint point)
Description copied from interface: AlignmentSelectionModel
Start a selection at the given point

Specified by:
extendSelection in interface AlignmentSelectionModel
Parameters:
point - the start of the selection

stopSelection

public void stopSelection(SequenceAlignmentPoint point)
Description copied from interface: AlignmentSelectionModel
Complete the selection at the given point

Specified by:
stopSelection in interface AlignmentSelectionModel
Parameters:
point - the point to complete the selection

addAlignmentSelectionListener

public void addAlignmentSelectionListener(AlignmentSelectionListener listener)
Specified by:
addAlignmentSelectionListener in interface AlignmentSelectionModel

removeAlignmentSelectionListener

public void removeAlignmentSelectionListener(AlignmentSelectionListener listener)
Specified by:
removeAlignmentSelectionListener in interface AlignmentSelectionModel

valueChanged

public void valueChanged(AlignmentSelectionEvent event)
Specified by:
valueChanged in interface AlignmentSelectionListener