apollo.gui.synteny
Class SyntenyLinkPanel

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.synteny.SyntenyLinkPanel
All Implemented Interfaces:
PropSchemeChangeListener, BaseFocusListener, ChainedRepaintListener, FeatureSelectionListener, RubberbandListener, ScrollListener, ZoomListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class SyntenyLinkPanel
extends javax.swing.JPanel
implements BaseFocusListener, ChainedRepaintListener, FeatureSelectionListener, java.awt.event.MouseMotionListener, RubberbandListener, PropSchemeChangeListener, ZoomListener, ScrollListener

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 org.apache.log4j.Logger logger
           
 
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
SyntenyLinkPanel(StrandedZoomableApolloPanel szap1, StrandedZoomableApolloPanel szap2)
           
 
Method Summary
 void displayBothLinks()
           
 void displayJustDnaLinks()
           
 void displayJustProteinLinks()
           
 Link findFeaturePair(java.awt.Point pos)
           
 boolean getAutoStraighten()
           
 boolean getShadeByPercId()
           
 boolean getUseOpaqueLinks()
           
 boolean handleBaseFocusEvent(BaseFocusEvent evt)
           
 boolean handleChainedRepaint(ChainedRepaintEvent event)
           
 boolean handleFeatureSelectionEvent(FeatureSelectionEvent event)
          If we had a FeatureSelectionEvent fired AT us, then we
 boolean handlePropSchemeChangeEvent(PropSchemeChangeEvent evt)
           
 boolean handleRubberbandEvent(RubberbandEvent evt)
          Rubberbanding a link centers on the link (no selection)
 boolean handleScrollEvent(ScrollEvent event)
           
 boolean handleZoomEvent(ZoomEvent evt)
          Zoom events are delivered by one of the two controllers I listen to.
 void homeInOnSelectedLink()
          Zoom to features of link and hide strands not linked
 boolean isBottomForwardVisible()
           
 boolean isBottomReverseVisible()
           
 boolean isManagingSZAP(StrandedZoomableApolloPanel szap)
           
 boolean isTopForwardVisible()
           
 boolean isTopReverseVisible()
           
 void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseMoved(java.awt.event.MouseEvent evt)
           
 void paintComponent(java.awt.Graphics g)
          A whole new set of SyntenyLinkPolygons get created with every paint.
 void print(java.io.File file, java.lang.String orientation, java.lang.String scale)
           
 void setAutoStraighten(boolean state)
           
 void setLinks(LinkSet links)
           
 void setShadeByPercId(boolean value)
           
 void setSingleStrandVisibility(boolean szap1Forward, boolean szap2Forward)
          Puts both szaps in a single strand state.
 void setStatusBar(StatusBar bar)
           
 void setUseOpaqueLinks(boolean value)
           
 void showAllStrands()
           
 boolean syncScales()
           
 
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, 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
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

SyntenyLinkPanel

public SyntenyLinkPanel(StrandedZoomableApolloPanel szap1,
                        StrandedZoomableApolloPanel szap2)
Method Detail

print

public void print(java.io.File file,
                  java.lang.String orientation,
                  java.lang.String scale)

handleFeatureSelectionEvent

public boolean handleFeatureSelectionEvent(FeatureSelectionEvent event)

If we had a FeatureSelectionEvent fired AT us, then we

  1. For ensembl: Find the stable gene id corresponding to the feature selected - I expect the selection(s) will be either exons (for a selection in each ResultView) or a FeaturePair's worth of stable geneid's (if the selection was made in the link panel).
  2. In the case of selected exons, search the FeatureSet of cross-species Homology links to find the stable gene id(s) MATCHING the selected stable gene id's.
  3. Find the exons corresponding to the homologous gene we just retrieved and fire a selection event on each of them.

Specified by:
handleFeatureSelectionEvent in interface FeatureSelectionListener

isManagingSZAP

public boolean isManagingSZAP(StrandedZoomableApolloPanel szap)

handleRubberbandEvent

public boolean handleRubberbandEvent(RubberbandEvent evt)
Rubberbanding a link centers on the link (no selection)

Specified by:
handleRubberbandEvent in interface RubberbandListener

syncScales

public boolean syncScales()

getAutoStraighten

public boolean getAutoStraighten()

setAutoStraighten

public void setAutoStraighten(boolean state)

setStatusBar

public void setStatusBar(StatusBar bar)

paintComponent

public void paintComponent(java.awt.Graphics g)
A whole new set of SyntenyLinkPolygons get created with every paint. Is this inefficient?

Overrides:
paintComponent in class javax.swing.JComponent

handleBaseFocusEvent

public boolean handleBaseFocusEvent(BaseFocusEvent evt)
Specified by:
handleBaseFocusEvent in interface BaseFocusListener

handlePropSchemeChangeEvent

public boolean handlePropSchemeChangeEvent(PropSchemeChangeEvent evt)
Specified by:
handlePropSchemeChangeEvent in interface PropSchemeChangeListener

handleZoomEvent

public boolean handleZoomEvent(ZoomEvent evt)
Zoom events are delivered by one of the two controllers I listen to. They trigger - a propagation (if the user zoomed with the SHIFT key held) of the zoom event to the "other" controller (in turn causing a redraw of a stranded-zoomable-panel etc), and - a repaint in this panel: that will re-display the appropriate links given the szap's have zoomed.

Specified by:
handleZoomEvent in interface ZoomListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

findFeaturePair

public Link findFeaturePair(java.awt.Point pos)

setLinks

public void setLinks(LinkSet links)

handleChainedRepaint

public boolean handleChainedRepaint(ChainedRepaintEvent event)
Specified by:
handleChainedRepaint in interface ChainedRepaintListener

setUseOpaqueLinks

public void setUseOpaqueLinks(boolean value)

setShadeByPercId

public void setShadeByPercId(boolean value)

getUseOpaqueLinks

public boolean getUseOpaqueLinks()

getShadeByPercId

public boolean getShadeByPercId()

handleScrollEvent

public boolean handleScrollEvent(ScrollEvent event)
Specified by:
handleScrollEvent in interface ScrollListener

displayJustDnaLinks

public void displayJustDnaLinks()

displayJustProteinLinks

public void displayJustProteinLinks()

displayBothLinks

public void displayBothLinks()

setSingleStrandVisibility

public void setSingleStrandVisibility(boolean szap1Forward,
                                      boolean szap2Forward)
Puts both szaps in a single strand state. If szap1Forward is true, set forward strand visible in szap1, reverse hidden. Vice verse if false. Same for szap2Forward with szap2(species2)


showAllStrands

public void showAllStrands()

isTopForwardVisible

public boolean isTopForwardVisible()

isTopReverseVisible

public boolean isTopReverseVisible()

isBottomForwardVisible

public boolean isBottomForwardVisible()

isBottomReverseVisible

public boolean isBottomReverseVisible()

homeInOnSelectedLink

public void homeInOnSelectedLink()
Zoom to features of link and hide strands not linked