apollo.gui.detailviewers.sequencealigner
Class SeqAlignPanel

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.SeqAlignPanel
All Implemented Interfaces:
BaseScrollable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable
Direct Known Subclasses:
BaseEditorPanel

public class SeqAlignPanel
extends javax.swing.JPanel
implements javax.swing.Scrollable, BaseScrollable

Generates a scrollable base level display for sequences. A SeqAlignPanel can be thought of logically as a set of SeqFeature objects, each of which is displayed on some tier. A tier is a row on which a sequence can be placed, with lower number tiers being above higher number tiers. The tier on which a newly added sequence will be placed is determined by the TierManager. A SeqAlignPanel can only display either forward stranded features or reverse stranded features but not both. XXX: allow for forward and reverse stranded features to be displayed together? When discussing the location of a particular base in this display there are two types of coordinates you can use: pixel: refers to the x/y coordinate of a base position: refers to row/column position. basePair: refers to the actual base pair, on forward strand basePair = pos + lowestBase

See Also:
Serialized Form

Nested Class Summary
protected  class SeqAlignPanel.AutoscrollThread
          Inner class.
protected  class SeqAlignPanel.ScrollMouseListener
          Inner class.
 
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
 int cols
          The number of base pairs displayed in a single row
static int END_BOUNDARY
           
static int EXON
           
protected  int highestBase
          The base pair the panel ends at in outside world(chromosomal)
protected  boolean horizontalMode
          Related to the scroll policy.
static int INTRON
           
protected static org.apache.log4j.Logger logger
           
protected  int lowestBase
          The base pair the panel starts at in outside world(chromosomal)
static int NO_BOUNDARY
           
static int NO_TYPE
           
 boolean reverseStrand
          What type of sequence is being displayed
protected  int rowMargin
          Maybe this controls the space between rows when in vertical mode?
protected  java.util.Vector<apollo.gui.detailviewers.sequencealigner.SeqWrapper> sequences
          Holds a sequence (SeqWrapper) for every tier, element # is tier number
static int START_BOUNDARY
           
static int START_CODON
           
static int STOP_CODON
           
protected  int stripeWidth
          The default size of the background color stripes, in number of bases
 
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
SeqAlignPanel(int numCols, int lowestBase, int highestBase)
          Constructor.
 
Method Summary
 int addAlignFeature(SequenceI seq, SeqFeatureI feature)
          Adds feature to an existing SeqWrapper if it doesn't overlap with it, otherwise creates a new SeqWrapper for it,
 void addNotify()
           
 void addTier(SequenceI seq, int phase, java.lang.String seq_type, int index)
          Adds a new tier to the panel.
 void attachFeatureToSequence(int seqIndex, SeqFeatureI sf)
           
 void attachRendererToTier(int tier, BaseRenderer renderer)
          Attaches a new BaseRenderer to the given tier
 int basePairToPos(int basePair)
           
 void clear()
           
protected  java.awt.Graphics createGraphics(java.awt.Graphics g, int x, int y, int w, int h)
           
protected  java.awt.Color getBackgroundColor1()
          For now these just get configs ede bg color - this means alignment viewer gets same colors as ede, i alignment wants to be different needs to override these methods
protected  java.awt.Color getBackgroundColor2()
           
 int getBoundaryType(int position, int tier)
          Returns the boundary type of the SeqFeature at a particular position on a tier.
 char getCharAt(int tier, int pos)
           
 int getCharHeight()
           
 int getCharWidth()
           
 int getColForPixelPosition(int x)
           
 int getColForPosition(int pos)
           
 int getColumnCount()
           
 int getExonRangeIndex(int tier, int low, int high)
           
 int getExonRangeIndex(int tier, int low, int high, boolean exact)
           
 SeqFeatureI getFeatureAtIndex(int tier, int index)
           
 SeqFeatureI getFeatureAtPosition(int position, int tier)
          Returns the SeqFeatureI at a position on a tier.
 int getFeatureCount(int tier)
           
 SeqFeatureI getFeatureForPixelPosition(int x, int y)
          Returns the sequence feature that is shown at the given display coordinates.
 SeqFeatureI getFeatureForPixelPosition(int x, int y, boolean noSet)
          Returns the sequence feature that is shown at the given display coordinates.
 FeatureSetI getFeatureSetAtPosition(int position, int tier)
           
 java.util.Vector<SeqFeatureI> getFeaturesInRange(int startpos, int endpos, int tier)
          XXX:Dont think this is in use Returns all of the sequence features within a given range on a tier.
 int getHighestBase()
           
 int getLowestBase()
           
protected  java.awt.Point getPixelLocForColAndRow(int col, int row)
           
 java.awt.Point getPixelLocForPosition(int pos, int tier)
          The pixel coordinates for the position at a particular tier
 java.awt.Rectangle getPosRectangleForPixels(java.awt.Rectangle r)
          Converts a pixel rectangle to a pos(row/col) rectangle
 java.awt.Dimension getPreferredScrollableViewportSize()
           
 double[] getRangeAtPosition(int tier, int pos)
           
 int getRangeIndex(int tier, int low, int high)
           
 java.awt.Rectangle getRectangleForCharPosition(int pos, int tier)
           
 java.awt.Rectangle getRectangleForTierPosition(int pos)
           
 BaseRenderer getRendererAt(int seqIndex)
           
 boolean getReverseStrand()
           
 int getRowCount()
           
 int getRowForPixelPosition(int y)
           
 int getRowForPosition(int pos)
           
 int getRowHeight()
           
 int getRowMargin()
          FIXME: Returns the row margin property value, whatever that is...
 int getRowWidth()
           
 int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
           
 int getSequenceCount()
           
 SequenceI getSequenceForTier(int tier)
           
protected  apollo.gui.detailviewers.sequencealigner.SeqWrapper getSeqWrapperForTier(int tier)
           
 int getStripeWidth()
          Returns the number of bases that will be included in a stripe
 int getTierCount()
          Returns the number of sequence tiers in the panel
protected  int getTierForFeature(SeqFeatureI sf)
          Returns tier number that SeqFeatureI is in.
 int getTierForPixelPosition(int y)
           
 int getTypeAtPosition(int tier, int base)
           
 int getVisibleBase()
          From BaseScrollable interface.
 int getVisibleBaseCount()
           
protected  void haltThread(SeqAlignPanel.AutoscrollThread thread)
           
protected  void handleAutoscroll(int x, int y)
           
 void moveSequence(int oldpos, int newpos)
           
protected static java.lang.String padPerChar(java.lang.String target, java.lang.String padString)
           
 void paint(java.awt.Graphics g)
           
 int posToBasePair(int pos)
          Takes a row/col 1 based pos and converts to global base pairs lowest base does not seem to be accurate, highest probably isn't either...
 int posToResidue(int pos)
          Takes a row/col zero based pos and converts it to offset into the dna/aa string !!! SHOULD THESE REALLY BE basePairToPos? I dont think its right
protected  void reformat()
           
protected  void removeFeature(FeatureSetI feature, int tier)
          Removes feature from an existing SeqWrapper
 void repaint(int startPos, int endPos)
           
 void repaint(int x, int y, int width, int height)
           
 int residueToBasePair(int residue)
          takes a zero based string offset for the residues and converts it to an offset in zero based pos space
 int residueToPos(int residue)
          Takes an offset into the dna/aa string and converts it to a row/col zero based pos
 void scrollToBase(int basepair)
          from BaseScrollable interface, there is both a scrollToBase and a scrollToPos.
 void scrollToFeature(SeqFeatureI feature)
           
 void scrollToPosition(int pos)
           
 void scrollToRow(int row)
           
 void setAutoscroll(boolean autoscroll)
          TODO: Find out what this does
 void setHorizontalMode(boolean mode)
          TODO: put someting here
 void setReverseStrand(boolean aFlag)
          Sets the reverse strand property value
 void setStripeWidth(int width)
          Sets the size of the background color stripes, in number of bases.
 void setVisibilityForSequence(int seqIndex, boolean visible)
           
 void validate()
           
 void validateTree()
          This fixes a resize bug on solaris and linux.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, 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
 
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, 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

NO_BOUNDARY

public static final int NO_BOUNDARY
See Also:
Constant Field Values

START_BOUNDARY

public static final int START_BOUNDARY
See Also:
Constant Field Values

END_BOUNDARY

public static final int END_BOUNDARY
See Also:
Constant Field Values

NO_TYPE

public static final int NO_TYPE
See Also:
Constant Field Values

STOP_CODON

public static final int STOP_CODON
See Also:
Constant Field Values

START_CODON

public static final int START_CODON
See Also:
Constant Field Values

INTRON

public static final int INTRON
See Also:
Constant Field Values

EXON

public static final int EXON
See Also:
Constant Field Values

sequences

protected java.util.Vector<apollo.gui.detailviewers.sequencealigner.SeqWrapper> sequences
Holds a sequence (SeqWrapper) for every tier, element # is tier number


cols

public int cols
The number of base pairs displayed in a single row


stripeWidth

protected int stripeWidth
The default size of the background color stripes, in number of bases


rowMargin

protected int rowMargin
Maybe this controls the space between rows when in vertical mode?


horizontalMode

protected boolean horizontalMode
Related to the scroll policy. Controls how display is generated


reverseStrand

public boolean reverseStrand
What type of sequence is being displayed


lowestBase

protected int lowestBase
The base pair the panel starts at in outside world(chromosomal)


highestBase

protected int highestBase
The base pair the panel ends at in outside world(chromosomal)

Constructor Detail

SeqAlignPanel

public SeqAlignPanel(int numCols,
                     int lowestBase,
                     int highestBase)
Constructor. TODO: create a factory? make this a

Parameters:
numCols -
lowestBase -
highestBase -
Method Detail

setAutoscroll

public void setAutoscroll(boolean autoscroll)
TODO: Find out what this does


setReverseStrand

public void setReverseStrand(boolean aFlag)
Sets the reverse strand property value

Parameters:
aFlag - a flag indicating whether or not the view is for the forward or reverse strand TODO: change to setDirection? remove from api?

getReverseStrand

public boolean getReverseStrand()

setHorizontalMode

public void setHorizontalMode(boolean mode)
TODO: put someting here

Parameters:
mode -

setStripeWidth

public void setStripeWidth(int width)
Sets the size of the background color stripes, in number of bases.

Parameters:
width - the number of bases that will be included in a stripe

getStripeWidth

public int getStripeWidth()
Returns the number of bases that will be included in a stripe

Returns:
the stripeWidth property

getRowMargin

public int getRowMargin()
FIXME: Returns the row margin property value, whatever that is...

Returns:
the rowMargin property

getTierCount

public int getTierCount()
Returns the number of sequence tiers in the panel

Returns:
the number of sequence tiers in the panel

addTier

public void addTier(SequenceI seq,
                    int phase,
                    java.lang.String seq_type,
                    int index)
Adds a new tier to the panel.

Parameters:
seq - the sequence to be used as a reference for this tier
phase - the phase of the sequence being read
seq_type - the the type of sequence being added
tier - the index at which this tier is to be placed

attachRendererToTier

public void attachRendererToTier(int tier,
                                 BaseRenderer renderer)
Attaches a new BaseRenderer to the given tier

Parameters:
tier - the tier to attach the base renderer too
renderer - the specified renderer

getBoundaryType

public int getBoundaryType(int position,
                           int tier)
Returns the boundary type of the SeqFeature at a particular position on a tier. Can be one of: SeqAlignPanel.NO_BOUNDARY SeqAlignPanel.LEFT_BOUNDARY SeqAlignPanel.RIGHT_BOUNDARY FIXME:what if the feature at that position is only a single base?

Parameters:
position - the position in the tier to look
tier - the tier to look at
Returns:
the boundary type of at a position on a tier

getFeatureAtPosition

public SeqFeatureI getFeatureAtPosition(int position,
                                        int tier)
Returns the SeqFeatureI at a position on a tier.

Parameters:
position - the position in the tier to look
tier - the to look at
Returns:
the feature at a position on a tier

getFeaturesInRange

public java.util.Vector<SeqFeatureI> getFeaturesInRange(int startpos,
                                                        int endpos,
                                                        int tier)
XXX:Dont think this is in use Returns all of the sequence features within a given range on a tier.

Parameters:
startpos - the position that the search begins with (inclusive?)
endpos - the position that the search ends at (inclusive?)
tier - the tier that the search is executed on
Returns:
a list of sequence features within the given range

getFeatureForPixelPosition

public SeqFeatureI getFeatureForPixelPosition(int x,
                                              int y)
Returns the sequence feature that is shown at the given display coordinates.

Parameters:
x - the x coordinate of this display
y - the y coordinate of this display
Returns:
the sequence feature at the given coordinates

getFeatureForPixelPosition

public SeqFeatureI getFeatureForPixelPosition(int x,
                                              int y,
                                              boolean noSet)
Returns the sequence feature that is shown at the given display coordinates.

Parameters:
x - the x coordinate of this display
y - the y coordinate of this display
noSet - flag indicating whether or not the sequence feature will also be a sequence feature set
Returns:
returns the sequence feature at the given coordinates or null if no feature exists

getFeatureSetAtPosition

public FeatureSetI getFeatureSetAtPosition(int position,
                                           int tier)

getSeqWrapperForTier

protected apollo.gui.detailviewers.sequencealigner.SeqWrapper getSeqWrapperForTier(int tier)

getTypeAtPosition

public int getTypeAtPosition(int tier,
                             int base)

getRangeAtPosition

public double[] getRangeAtPosition(int tier,
                                   int pos)

getRangeIndex

public int getRangeIndex(int tier,
                         int low,
                         int high)

getExonRangeIndex

public int getExonRangeIndex(int tier,
                             int low,
                             int high)

getExonRangeIndex

public int getExonRangeIndex(int tier,
                             int low,
                             int high,
                             boolean exact)

getFeatureAtIndex

public SeqFeatureI getFeatureAtIndex(int tier,
                                     int index)

getFeatureCount

public int getFeatureCount(int tier)

clear

public void clear()

addAlignFeature

public int addAlignFeature(SequenceI seq,
                           SeqFeatureI feature)
Adds feature to an existing SeqWrapper if it doesn't overlap with it, otherwise creates a new SeqWrapper for it,

Returns:
The element number in sequences, which is synonomous with tier number

removeFeature

protected void removeFeature(FeatureSetI feature,
                             int tier)
Removes feature from an existing SeqWrapper


moveSequence

public void moveSequence(int oldpos,
                         int newpos)

getSequenceCount

public int getSequenceCount()

getCharAt

public char getCharAt(int tier,
                      int pos)

getSequenceForTier

public SequenceI getSequenceForTier(int tier)

setVisibilityForSequence

public void setVisibilityForSequence(int seqIndex,
                                     boolean visible)

getRendererAt

public BaseRenderer getRendererAt(int seqIndex)

attachFeatureToSequence

public void attachFeatureToSequence(int seqIndex,
                                    SeqFeatureI sf)

getTierForFeature

protected int getTierForFeature(SeqFeatureI sf)
Returns tier number that SeqFeatureI is in. SeqFeatureI can be an exon or a transcript as it searches on both the feature itself and its refFeature.


padPerChar

protected static java.lang.String padPerChar(java.lang.String target,
                                             java.lang.String padString)

getCharHeight

public int getCharHeight()

validateTree

public void validateTree()
This fixes a resize bug on solaris and linux. When the ede was resizing sometimes the SeqAlignPanel was not resizing. I dont understand this but in the JViewPort/Container.validateTree it would call either validate() or validateTree() on SeqAlignPanel depending on if it was valid. It is was valid validate was called, and validate below caused a reformat and everything was ok. If it was not valid, validateTree was called which previously just went to the superclass and the needed reformat did not get called. So I added this validateTree that just emulates validate. Why it sometimes is valid and sometimes not on resize I dont know. But this did fix the bug. Very strange. This doesnt seem to make a difference in terms of the 1.4 jdk bug, but it seems like if we are commenting out validate we should also comment out validateTree

Overrides:
validateTree in class java.awt.Container

validate

public void validate()
Overrides:
validate in class java.awt.Container

reformat

protected void reformat()

addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

getRowHeight

public int getRowHeight()

getRowWidth

public int getRowWidth()

getCharWidth

public int getCharWidth()

getRectangleForCharPosition

public java.awt.Rectangle getRectangleForCharPosition(int pos,
                                                      int tier)

getPixelLocForPosition

public java.awt.Point getPixelLocForPosition(int pos,
                                             int tier)
The pixel coordinates for the position at a particular tier

Parameters:
pos - row/col coord, not bp

getRectangleForTierPosition

public java.awt.Rectangle getRectangleForTierPosition(int pos)

getRowForPosition

public int getRowForPosition(int pos)

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getColForPosition

public int getColForPosition(int pos)

getRowForPixelPosition

public int getRowForPixelPosition(int y)

getTierForPixelPosition

public int getTierForPixelPosition(int y)

getPixelLocForColAndRow

protected java.awt.Point getPixelLocForColAndRow(int col,
                                                 int row)

scrollToRow

public void scrollToRow(int row)

getVisibleBase

public int getVisibleBase()
From BaseScrollable interface. Returns basepair that SeqAlignPanel is currently at. SZAP queries this to know which base to highlight

Specified by:
getVisibleBase in interface BaseScrollable

posToBasePair

public int posToBasePair(int pos)
Takes a row/col 1 based pos and converts to global base pairs lowest base does not seem to be accurate, highest probably isn't either...


basePairToPos

public int basePairToPos(int basePair)

posToResidue

public int posToResidue(int pos)
Takes a row/col zero based pos and converts it to offset into the dna/aa string !!! SHOULD THESE REALLY BE basePairToPos? I dont think its right


residueToPos

public int residueToPos(int residue)
Takes an offset into the dna/aa string and converts it to a row/col zero based pos


residueToBasePair

public int residueToBasePair(int residue)
takes a zero based string offset for the residues and converts it to an offset in zero based pos space


getLowestBase

public int getLowestBase()

getHighestBase

public int getHighestBase()

getVisibleBaseCount

public int getVisibleBaseCount()
Specified by:
getVisibleBaseCount in interface BaseScrollable

scrollToBase

public void scrollToBase(int basepair)
from BaseScrollable interface, there is both a scrollToBase and a scrollToPos. scrollToBase calls scrollToPosition after transforming into window sequence coordinates

Specified by:
scrollToBase in interface BaseScrollable

scrollToPosition

public void scrollToPosition(int pos)

scrollToFeature

public void scrollToFeature(SeqFeatureI feature)

getColForPixelPosition

public int getColForPixelPosition(int x)

getPosRectangleForPixels

public java.awt.Rectangle getPosRectangleForPixels(java.awt.Rectangle r)
Converts a pixel rectangle to a pos(row/col) rectangle


repaint

public void repaint(int startPos,
                    int endPos)

repaint

public void repaint(int x,
                    int y,
                    int width,
                    int height)
Overrides:
repaint in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

getBackgroundColor1

protected java.awt.Color getBackgroundColor1()
For now these just get configs ede bg color - this means alignment viewer gets same colors as ede, i alignment wants to be different needs to override these methods


getBackgroundColor2

protected java.awt.Color getBackgroundColor2()

createGraphics

protected java.awt.Graphics createGraphics(java.awt.Graphics g,
                                           int x,
                                           int y,
                                           int w,
                                           int h)

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable

haltThread

protected void haltThread(SeqAlignPanel.AutoscrollThread thread)

handleAutoscroll

protected void handleAutoscroll(int x,
                                int y)