## org.biojava.bio.gui
Class SequencePanel

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--javax.swing.JComponent
                        |
                        +--org.biojava.bio.gui.SequencePanel

public class SequencePanel
extends javax.swing.JComponent
implements javax.swing.SwingConstants

A panel that visualy displays a Sequence.

A SequencePanel can either display the sequence from left-to-right (HORIZONTAL) or from top-to-bottom (VERTICAL). It has an associated scale which is the number of pixels per symbol. It also has a lines property that controls how to wrap the sequence off one end and onto the other.

Each line in the SequencePanel is broken down into a list of strips, each rendered by an individual SequenceRenderer object. You could add a SequenceRenderer that draws on genes, another that draws repeats and another that prints out the DNA sequence. They are responsible for rendering their view of the sequence in the place that the SequencePanel positions them.

Author:
  Thomas Down, Matthew Pocock
See Also:
  Serialized Form

Inner Class Summary
`class` `SequencePanel.Border`

Inner classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

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 javax.swing.SwingConstants
`BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST`

Constructor Summary
`SequencePanel()`

Method Summary
`void` `addRenderer(SequenceRenderer r)`
`int` `getDirection()`
`SequencePanel.Border` `getLeadingBorder()`
`int` `getLines()`
`double` `getScale()`
`Sequence` `getSequence()`
`int` `getSpacer()`
`SequencePanel.Border` `getTrailingBorder()`
`int` `graphicsToSequence(double gPos)`
`void` `paintComponent(java.awt.Graphics g)`
`void` `resizeAndValidate()`
`double` `sequenceToGraphics(int seqPos)`
`void` `setDirection(int dir)`
`void` `setLines(int lines)`
`void` `setScale(double scale)`
`void` `setSequence(Sequence s)`
`void` `setSpacer(int spacer)`

Methods inherited from class javax.swing.JComponent

`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI`

Methods inherited from class java.awt.Container

`add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree`

Methods inherited from class java.awt.Component

`action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SequencePanel

    public SequencePanel()

Method Detail

### setSequence

    public void setSequence(Sequence s)

### getSequence

    public Sequence getSequence()

### setDirection

    public void setDirection(int dir)
                      throws java.lang.IllegalArgumentException

### getDirection

    public int getDirection()

### setSpacer

    public void setSpacer(int spacer)

### getSpacer

    public int getSpacer()

### setScale

    public void setScale(double scale)

### getScale

    public double getScale()

### setLines

    public void setLines(int lines)

### getLines

    public int getLines()

### getLeadingBorder

    public SequencePanel.Border getLeadingBorder()

### getTrailingBorder

    public SequencePanel.Border getTrailingBorder()

### paintComponent

    public void paintComponent(java.awt.Graphics g)

  Overrides:
    paintComponent in class javax.swing.JComponent

### addRenderer

    public void addRenderer(SequenceRenderer r)

### sequenceToGraphics

    public double sequenceToGraphics(int seqPos)

### graphicsToSequence

    public int graphicsToSequence(double gPos)

### resizeAndValidate

    public void resizeAndValidate()