apollo.gui.detailviewers.sequencealigner
Class MultiSequenceAlignerPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by apollo.gui.detailviewers.sequencealigner.MultiSequenceAlignerPanel
All Implemented Interfaces:
AnnotationChangeListener, BaseScrollable, ControlledObjectI, FeatureSelectionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
AAMultiSequenceAlignerPanel, DNAMultiSequenceAlignerPanel

public abstract class MultiSequenceAlignerPanel
extends javax.swing.JPanel
implements FeatureSelectionListener, ControlledObjectI, AnnotationChangeListener, java.beans.PropertyChangeListener, BaseScrollable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static int colorIndex
           
protected static java.awt.Color[] colorList
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MultiSequenceAlignerPanel(GuiCurationState curationState)
           
 
Method Summary
 int addAnnotations(java.util.Collection<SeqFeatureI> features)
          Adds a collection of annotations to the list of annotations (but not the annotation panel)
 void addEditRegion()
          puts up vertical lines in szap(main window) indicating what region that is currently displayed
protected  AbstractTierPanel addFeatureToPanel(SeqFeatureI feature, MultiTierPanel panel)
           
 int addResults(java.util.Collection<SeqFeatureI> features)
          Adds a collection of results to the list of results (but not to the result panel)
abstract  boolean annotationFilter(SeqFeatureI f)
          I don't think this is used in any way...
 boolean canHandleSelection(FeatureSelectionEvent evt, java.lang.Object self)
          Does all the handle selection checks
 void cleanUp()
          cleanup extra components when closing down
abstract  void clearAnnotations()
          removes all the annotations from the annotation list and the annotation panel
abstract  void clearResults()
          removes all of the results from the results list and the result panel
static java.util.Set<SeqFeatureI> filter(java.util.Collection<SeqFeatureI> collection, Filter f)
          Passes a collection of features through a filter
 void flipOrientation()
          Flipping the orientation will not work, more work is needed to implement...
abstract  AbstractScrollablePanel getAddressComponent()
          Gets the address bar (shows the base numbers you are looking at)
abstract  MultiComparator getAnnotationComparator()
          Gets the comparator used to order annotations
abstract  MultiFilter<SeqFeatureI> getAnnotationFilter()
          Gets the filter used to decide which annotations to display
abstract  MultiTierPanelHeaderTable getAnnotationHeader()
          Gets the header for the annotation panel
abstract  javax.swing.JScrollPane getAnnotationPane()
          Gets the JScrollPane which holds the Annotation Panel
abstract  MultiTierPanel getAnnotationPanel()
          Gets the Annotation Panel
abstract  java.util.List<SeqFeatureI> getAnnotations()
          Gets the list of annotations.
static java.util.Set<SeqFeatureI> getAnnotations(SeqFeatureI featureSet)
          Gets all the annotations in a particular feature set
 java.awt.Color[][] getColorArray()
          The inner array is an array of 2 colors, for alternating exon colors.
 GuiCurationState getCurationState()
           
abstract  ReadingFrame getFrame()
          Gets the frame that is currently being viewed
 java.awt.Color getIndicatorColor()
           
abstract  javax.swing.JMenu getMenu()
          Gets the Menu object
 javax.swing.JMenuBar getMenuBar()
          Method for easy access to MenuBar
abstract  Overview getOverview()
          Gets the overview object for the panel
abstract  MultiTierPanel getReferencePanel()
          Gets the reference panel (the one in between the annotation and result)
abstract  SequenceI getReferenceSequence(Strand s, ReadingFrame rf)
          Creates a Sequence object which can be used as a reference for the given strand/frame pair
abstract  MultiComparator getResultComparator()
          Gets the comparator used to order results
abstract  MultiFilter<SeqFeatureI> getResultFilter()
          Gets the filter used to decide which results to display
abstract  MultiTierPanelHeaderTable getResultHeader()
          Gets the header for the result panel
abstract  MultiTierPanel getResultPanel()
          Gets the Result Panel
abstract  java.util.List<SeqFeatureI> getResults()
          Gets the list of results.
static java.util.Set<SeqFeatureI> getResults(SeqFeatureI featureSet, Filter f)
          Gets all the results from a particular feature set that pass the filter
static java.util.Set<SeqFeatureI> getResults(java.lang.String type, SeqFeatureI featureSet)
          Gets all the results from a particular feature set Don't think this is used...
abstract  javax.swing.JScrollBar getScrollBar()
          Gets the main horizontal scrollbar for the window
 AnnotatedFeatureI getSelection()
          Gets the currently sellected annotation
abstract  Strand getStrand()
          Gets the strand of the annotations currently being viewed
 MultiSequenceAlignerPanel getThis()
           
 AnnotatedFeatureI getTransOrOneLevelAnn(AnnotatedFeatureI af)
          AssemblyFeature is the only GAI at the moment that has no relation to // a transcript.
abstract  java.lang.String getType()
          Gets the type
 boolean handleAnnotationChangeEvent(AnnotationChangeEvent evt)
           
abstract  void init()
          Creates all of the components and lays everything out
static MultiSequenceAlignerPanel makeAligner(java.lang.String type, GuiCurationState curationState, int strand, ReadingFrame frame)
          Factory method to create the correct display panel based on the type
 javax.swing.JMenu makeMenu()
          Creates a drop down menu for this component
 void nextAnnotation()
          Scrolls the window to the start/end of the next annotation to the right.
 boolean noExternalSelection()
          true if no external selection is allowed false otherwise
 void prevAnnotation()
          Scrolls the window to the start/end of the next annotation to the left
 void reformatAnnotationPanel()
          clears and repopulates the annotation panel based on current state
abstract  void reformatReferenceHeader()
          updates the header for the reference panel
 void reformatReferencePanel(Orientation orientation)
          updates and paints the reference panel based on current state
 void reformatResultPanel()
          clears and repopulates the result panel based on the current state
abstract  boolean resultFilter(SeqFeatureI f)
          I don't think this is used in any way...
abstract  void setAnnotations(java.util.List<SeqFeatureI> annotations)
          Sets the annotations (no side effects)
 void setCurationState(GuiCurationState cs)
           
 void setIndicatorColor(java.awt.Color c)
           
 void setNoExternalSelection(boolean noExternalselection)
           
abstract  void setResults(java.util.List<SeqFeatureI> results)
          Sets the results (no side effects)
 void setSelection(AnnotatedFeatureI gai)
          Sets the selection the the feature given
abstract  void setStrand(Strand s)
          Sets the currently selected strand (no side effects)
 java.util.List<SeqFeatureI> sort(java.util.Collection<SeqFeatureI> collection, java.util.Comparator comparator)
          Sorts a collection of features using the given comparator
 void sortAnnotations(java.util.Comparator comparator)
          Sorts the annotation list using the given comparator I dont' think this is used anymore...
 void sortResults(java.util.Comparator comparator)
          Sorts the result list using the given comparator I dont think this is used anymore...
 void switchAnnotations()
          Changes the view to look at the annotations on the opposite strand
 void switchResults()
          Switches the strand for the result panel.
protected  void updateEditRegion()
          Something to do with the box that shows what part is being displayed in the main apollo window
 void updateTitle()
          Sets the title for the window
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface apollo.gui.event.FeatureSelectionListener
handleFeatureSelectionEvent
 
Methods inherited from interface apollo.gui.ControlledObjectI
getController, getControllerWindow, needsAutoRemoval, setController
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface apollo.gui.BaseScrollable
getVisibleBase, getVisibleBaseCount, scrollToBase
 

Field Detail

colorIndex

protected static int colorIndex

colorList

protected static final java.awt.Color[] colorList
Constructor Detail

MultiSequenceAlignerPanel

public MultiSequenceAlignerPanel(GuiCurationState curationState)
Method Detail

getColorArray

public java.awt.Color[][] getColorArray()
The inner array is an array of 2 colors, for alternating exon colors. The "outer" array represents transcript coloring. Transcripts can have different exon coloring pairs(see SelectableDNARenderer's exonColorIndex and transcriptColorIndex). This now takes in 2 colors from Config edeFeatureColor. It no longer is setting up 4 colors for alternating transcripts as well as exons. Easy enough to reinstate if desired.


getIndicatorColor

public java.awt.Color getIndicatorColor()

setIndicatorColor

public void setIndicatorColor(java.awt.Color c)

getCurationState

public GuiCurationState getCurationState()

setCurationState

public void setCurationState(GuiCurationState cs)

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Method for easy access to MenuBar

Returns:

getThis

public MultiSequenceAlignerPanel getThis()

makeMenu

public javax.swing.JMenu makeMenu()
Creates a drop down menu for this component

Returns:
a menu

flipOrientation

public void flipOrientation()
Flipping the orientation will not work, more work is needed to implement...


getReferenceSequence

public abstract SequenceI getReferenceSequence(Strand s,
                                               ReadingFrame rf)
Creates a Sequence object which can be used as a reference for the given strand/frame pair

Parameters:
s - the strand
rf - the frame
Returns:
a reference sequence

getScrollBar

public abstract javax.swing.JScrollBar getScrollBar()
Gets the main horizontal scrollbar for the window

Returns:

getOverview

public abstract Overview getOverview()
Gets the overview object for the panel

Returns:

switchResults

public void switchResults()
Switches the strand for the result panel.
side effects: repaint result panel, repaint reference panel


setSelection

public void setSelection(AnnotatedFeatureI gai)
Sets the selection the the feature given

Parameters:
gai - the new selection
side effects: update the overview, and update the title

getSelection

public AnnotatedFeatureI getSelection()
Gets the currently sellected annotation

Returns:

updateTitle

public void updateTitle()
Sets the title for the window


getAnnotationPanel

public abstract MultiTierPanel getAnnotationPanel()
Gets the Annotation Panel


getAnnotationPane

public abstract javax.swing.JScrollPane getAnnotationPane()
Gets the JScrollPane which holds the Annotation Panel


getAnnotationHeader

public abstract MultiTierPanelHeaderTable getAnnotationHeader()
Gets the header for the annotation panel


getResultPanel

public abstract MultiTierPanel getResultPanel()
Gets the Result Panel


getResultHeader

public abstract MultiTierPanelHeaderTable getResultHeader()
Gets the header for the result panel


getReferencePanel

public abstract MultiTierPanel getReferencePanel()
Gets the reference panel (the one in between the annotation and result)


getAddressComponent

public abstract AbstractScrollablePanel getAddressComponent()
Gets the address bar (shows the base numbers you are looking at)

Returns:

getType

public abstract java.lang.String getType()
Gets the type


getStrand

public abstract Strand getStrand()
Gets the strand of the annotations currently being viewed


setStrand

public abstract void setStrand(Strand s)
Sets the currently selected strand (no side effects)


getFrame

public abstract ReadingFrame getFrame()
Gets the frame that is currently being viewed


getMenu

public abstract javax.swing.JMenu getMenu()
Gets the Menu object


init

public abstract void init()
Creates all of the components and lays everything out


cleanUp

public void cleanUp()
cleanup extra components when closing down


getAnnotations

public abstract java.util.List<SeqFeatureI> getAnnotations()
Gets the list of annotations. This list is used to determine if an annotation is already added to the panel. TODO redesign use of annotations, probably a better way to do this.


setAnnotations

public abstract void setAnnotations(java.util.List<SeqFeatureI> annotations)
Sets the annotations (no side effects)


getResults

public abstract java.util.List<SeqFeatureI> getResults()
Gets the list of results. This list is used to determine if a result is already added to the panel. TODO redesign use of results, probably a better way to do this.


setResults

public abstract void setResults(java.util.List<SeqFeatureI> results)
Sets the results (no side effects)


clearAnnotations

public abstract void clearAnnotations()
removes all the annotations from the annotation list and the annotation panel


clearResults

public abstract void clearResults()
removes all of the results from the results list and the result panel


reformatResultPanel

public void reformatResultPanel()
clears and repopulates the result panel based on the current state


reformatAnnotationPanel

public void reformatAnnotationPanel()
clears and repopulates the annotation panel based on current state


reformatReferencePanel

public void reformatReferencePanel(Orientation orientation)
updates and paints the reference panel based on current state


reformatReferenceHeader

public abstract void reformatReferenceHeader()
updates the header for the reference panel


switchAnnotations

public void switchAnnotations()
Changes the view to look at the annotations on the opposite strand


annotationFilter

public abstract boolean annotationFilter(SeqFeatureI f)
I don't think this is used in any way... should probably remove


resultFilter

public abstract boolean resultFilter(SeqFeatureI f)
I don't think this is used in any way... should probably remove


addAnnotations

public int addAnnotations(java.util.Collection<SeqFeatureI> features)
Adds a collection of annotations to the list of annotations (but not the annotation panel)

Parameters:
features - a list of annotations
Returns:
the number of annotations added

addResults

public int addResults(java.util.Collection<SeqFeatureI> features)
Adds a collection of results to the list of results (but not to the result panel)

Parameters:
features - a list of results
Returns:
the number of results added

getResultComparator

public abstract MultiComparator getResultComparator()
Gets the comparator used to order results


getAnnotationComparator

public abstract MultiComparator getAnnotationComparator()
Gets the comparator used to order annotations


getResultFilter

public abstract MultiFilter<SeqFeatureI> getResultFilter()
Gets the filter used to decide which results to display


getAnnotationFilter

public abstract MultiFilter<SeqFeatureI> getAnnotationFilter()
Gets the filter used to decide which annotations to display


sortResults

public void sortResults(java.util.Comparator comparator)
Sorts the result list using the given comparator I dont think this is used anymore...

Parameters:
comparator -

sortAnnotations

public void sortAnnotations(java.util.Comparator comparator)
Sorts the annotation list using the given comparator I dont' think this is used anymore...

Parameters:
comparator -

sort

public java.util.List<SeqFeatureI> sort(java.util.Collection<SeqFeatureI> collection,
                                        java.util.Comparator comparator)
Sorts a collection of features using the given comparator

Parameters:
collection -
comparator -
Returns:
the sorted set

handleAnnotationChangeEvent

public boolean handleAnnotationChangeEvent(AnnotationChangeEvent evt)
Specified by:
handleAnnotationChangeEvent in interface AnnotationChangeListener

makeAligner

public static MultiSequenceAlignerPanel makeAligner(java.lang.String type,
                                                    GuiCurationState curationState,
                                                    int strand,
                                                    ReadingFrame frame)
Factory method to create the correct display panel based on the type


getAnnotations

public static java.util.Set<SeqFeatureI> getAnnotations(SeqFeatureI featureSet)
Gets all the annotations in a particular feature set

Parameters:
featureSet -
Returns:

getResults

public static java.util.Set<SeqFeatureI> getResults(java.lang.String type,
                                                    SeqFeatureI featureSet)
Gets all the results from a particular feature set Don't think this is used...

Parameters:
type - the type of results wanted, ether AA or DNA
featureSet -
Returns:

getResults

public static java.util.Set<SeqFeatureI> getResults(SeqFeatureI featureSet,
                                                    Filter f)
Gets all the results from a particular feature set that pass the filter

Parameters:
featureSet -
f - the filter used to decide which results to get
Returns:

filter

public static java.util.Set<SeqFeatureI> filter(java.util.Collection<SeqFeatureI> collection,
                                                Filter f)
Passes a collection of features through a filter

Parameters:
collection -
f -
Returns:
the features in the given collection that pass the filter

addEditRegion

public void addEditRegion()
puts up vertical lines in szap(main window) indicating what region that is currently displayed


updateEditRegion

protected void updateEditRegion()
Something to do with the box that shows what part is being displayed in the main apollo window


nextAnnotation

public void nextAnnotation()
Scrolls the window to the start/end of the next annotation to the right.


prevAnnotation

public void prevAnnotation()
Scrolls the window to the start/end of the next annotation to the left


noExternalSelection

public boolean noExternalSelection()
true if no external selection is allowed false otherwise

Returns:

setNoExternalSelection

public void setNoExternalSelection(boolean noExternalselection)

canHandleSelection

public boolean canHandleSelection(FeatureSelectionEvent evt,
                                  java.lang.Object self)
Does all the handle selection checks


getTransOrOneLevelAnn

public AnnotatedFeatureI getTransOrOneLevelAnn(AnnotatedFeatureI af)
AssemblyFeature is the only GAI at the moment that has no relation to // a transcript. Dont think they can end up in ede (??). // Would be nice to have an interface that was solely for the exon // trans gene heirarchy? Should we actively make sure AssemblyFeatures dont // get into ede? (filter in AnnotationMenu?) returns null if no transcript can be found.


addFeatureToPanel

protected AbstractTierPanel addFeatureToPanel(SeqFeatureI feature,
                                              MultiTierPanel panel)