|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
apollo.gui.detailviewers.sequencealigner.SeqAlignPanel
public class SeqAlignPanel
Generates a scrollable base level display for sequences. A
| 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 |
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 |
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 |
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 |
|---|
protected static final org.apache.log4j.Logger logger
public static final int NO_BOUNDARY
public static final int START_BOUNDARY
public static final int END_BOUNDARY
public static final int NO_TYPE
public static final int STOP_CODON
public static final int START_CODON
public static final int INTRON
public static final int EXON
protected java.util.Vector<apollo.gui.detailviewers.sequencealigner.SeqWrapper> sequences
public int cols
protected int stripeWidth
protected int rowMargin
protected boolean horizontalMode
public boolean reverseStrand
protected int lowestBase
protected int highestBase
| Constructor Detail |
|---|
public SeqAlignPanel(int numCols,
int lowestBase,
int highestBase)
numCols - lowestBase - highestBase - | Method Detail |
|---|
public void setAutoscroll(boolean autoscroll)
public void setReverseStrand(boolean aFlag)
aFlag - a flag indicating whether or not the
view is for the forward or reverse strand
TODO: change to setDirection? remove from api?public boolean getReverseStrand()
public void setHorizontalMode(boolean mode)
mode - public void setStripeWidth(int width)
width - the number of bases that will be included in a stripepublic int getStripeWidth()
stripeWidth propertypublic int getRowMargin()
rowMargin propertypublic int getTierCount()
public void addTier(SequenceI seq,
int phase,
java.lang.String seq_type,
int index)
seq - the sequence to be used as a reference for this tierphase - the phase of the sequence being readseq_type - the the type of sequence being addedtier - the index at which this tier is to be placed
public void attachRendererToTier(int tier,
BaseRenderer renderer)
tier - the tier to attach the base renderer toorenderer - the specified renderer
public int getBoundaryType(int position,
int tier)
SeqAlignPanel.NO_BOUNDARY
SeqAlignPanel.LEFT_BOUNDARY
SeqAlignPanel.RIGHT_BOUNDARY
FIXME:what if the feature at that position is only a single base?
position - the position in the tier to looktier - the tier to look at
public SeqFeatureI getFeatureAtPosition(int position,
int tier)
position - the position in the tier to looktier - the to look at
public java.util.Vector<SeqFeatureI> getFeaturesInRange(int startpos,
int endpos,
int tier)
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
public SeqFeatureI getFeatureForPixelPosition(int x,
int y)
x - the x coordinate of this displayy - the y coordinate of this display
public SeqFeatureI getFeatureForPixelPosition(int x,
int y,
boolean noSet)
x - the x coordinate of this displayy - the y coordinate of this displaynoSet - flag indicating whether or not the
sequence feature will also be a sequence feature set
public FeatureSetI getFeatureSetAtPosition(int position,
int tier)
protected apollo.gui.detailviewers.sequencealigner.SeqWrapper getSeqWrapperForTier(int tier)
public int getTypeAtPosition(int tier,
int base)
public double[] getRangeAtPosition(int tier,
int pos)
public int getRangeIndex(int tier,
int low,
int high)
public int getExonRangeIndex(int tier,
int low,
int high)
public int getExonRangeIndex(int tier,
int low,
int high,
boolean exact)
public SeqFeatureI getFeatureAtIndex(int tier,
int index)
public int getFeatureCount(int tier)
public void clear()
public int addAlignFeature(SequenceI seq,
SeqFeatureI feature)
protected void removeFeature(FeatureSetI feature,
int tier)
public void moveSequence(int oldpos,
int newpos)
public int getSequenceCount()
public char getCharAt(int tier,
int pos)
public SequenceI getSequenceForTier(int tier)
public void setVisibilityForSequence(int seqIndex,
boolean visible)
public BaseRenderer getRendererAt(int seqIndex)
public void attachFeatureToSequence(int seqIndex,
SeqFeatureI sf)
protected int getTierForFeature(SeqFeatureI sf)
protected static java.lang.String padPerChar(java.lang.String target,
java.lang.String padString)
public int getCharHeight()
public void validateTree()
validateTree in class java.awt.Containerpublic void validate()
validate in class java.awt.Containerprotected void reformat()
public void addNotify()
addNotify in class javax.swing.JComponentpublic int getRowHeight()
public int getRowWidth()
public int getCharWidth()
public java.awt.Rectangle getRectangleForCharPosition(int pos,
int tier)
public java.awt.Point getPixelLocForPosition(int pos,
int tier)
pos - row/col coord, not bppublic java.awt.Rectangle getRectangleForTierPosition(int pos)
public int getRowForPosition(int pos)
public int getColumnCount()
public int getRowCount()
public int getColForPosition(int pos)
public int getRowForPixelPosition(int y)
public int getTierForPixelPosition(int y)
protected java.awt.Point getPixelLocForColAndRow(int col,
int row)
public void scrollToRow(int row)
public int getVisibleBase()
getVisibleBase in interface BaseScrollablepublic int posToBasePair(int pos)
public int basePairToPos(int basePair)
public int posToResidue(int pos)
public int residueToPos(int residue)
public int residueToBasePair(int residue)
public int getLowestBase()
public int getHighestBase()
public int getVisibleBaseCount()
getVisibleBaseCount in interface BaseScrollablepublic void scrollToBase(int basepair)
scrollToBase in interface BaseScrollablepublic void scrollToPosition(int pos)
public void scrollToFeature(SeqFeatureI feature)
public int getColForPixelPosition(int x)
public java.awt.Rectangle getPosRectangleForPixels(java.awt.Rectangle r)
public void repaint(int startPos,
int endPos)
public void repaint(int x,
int y,
int width,
int height)
repaint in class java.awt.Componentpublic void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentprotected java.awt.Color getBackgroundColor1()
protected java.awt.Color getBackgroundColor2()
protected java.awt.Graphics createGraphics(java.awt.Graphics g,
int x,
int y,
int w,
int h)
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableBlockIncrement in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableUnitIncrement in interface javax.swing.Scrollableprotected void haltThread(SeqAlignPanel.AutoscrollThread thread)
protected void handleAutoscroll(int x,
int y)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||