Class SequencePoster

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, SwingConstants, SequenceRenderContext, Changeable

Deprecated.
This doesn't handle loads of stuff. Use SequencePoster.
A panel that displays a Sequence.

A SequencePoster 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 SequencePoster 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 SequencePoster positions them.

Author:
Thomas Down, Matthew Pocock
See Also:
  • Field Details

  • Constructor Details

    • SequencePoster

      public SequencePoster()
      Deprecated.
      Create a new SeqeuncePanel.
  • Method Details

    • addSequenceViewerListener

      Deprecated.
    • removeSequenceViewerListener

      Deprecated.
    • addSequenceViewerMotionListener

      Deprecated.
    • removeSequenceViewerMotionListener

      Deprecated.
    • hasChangeListeners

      protected boolean hasChangeListeners()
      Deprecated.
    • getChangeSupport

      Deprecated.
    • addChangeListener

      Deprecated.
      Description copied from interface: Changeable
      Add a listener that will be informed of all changes.
      Specified by:
      addChangeListener in interface Changeable
      Parameters:
      cl - the ChangeListener to add
    • addChangeListener

      Deprecated.
      Description copied from interface: Changeable
      Add a listener that will be informed of changes of a given type.
      Specified by:
      addChangeListener in interface Changeable
      Parameters:
      cl - the ChangeListener
      ct - the ChangeType it is to be informed of
    • removeChangeListener

      Deprecated.
      Description copied from interface: Changeable
      Remove a listener that was interested in all types of changes.
      Specified by:
      removeChangeListener in interface Changeable
      Parameters:
      cl - a ChangeListener to remove
    • removeChangeListener

      Deprecated.
      Description copied from interface: Changeable
      Remove a listener that was interested in a specific types of changes.
      Specified by:
      removeChangeListener in interface Changeable
      Parameters:
      cl - a ChangeListener to remove
      ct - the ChangeType that it was interested in
    • isUnchanging

      public boolean isUnchanging(ChangeType ct)
      Deprecated.
      Description copied from interface: Changeable

      A particular ChangeType can never be raised by this Changeable.

      If this returns true, then it is guaranteed that change events of this type (and all child types) can never under any circumstances be fired by this Changeable instance. If it returns false, that does not mean that this type of event will or even can be raised, but that it is worth registering listeners incase.

      Specified by:
      isUnchanging in interface Changeable
      Parameters:
      ct - the ChangeType to check
      Returns:
      true if ChangeEvents of this type are guaranteed to never be fired
    • setSequence

      public void setSequence(Sequence s)
      Deprecated.
      Set the SymboList to be rendered. This symbol list will be passed onto the SequenceRenderer instances registered with this SequencePoster.
      Parameters:
      s - the SymboList to render
    • getSequence

      Deprecated.
    • getSymbols

      Deprecated.
      Retrieve the currently rendered SymbolList
      Specified by:
      getSymbols in interface SequenceRenderContext
      Returns:
      the current SymbolList
    • getFeatures

      Deprecated.
      Description copied from interface: SequenceRenderContext
      The features to render.
      Specified by:
      getFeatures in interface SequenceRenderContext
      Returns:
      a FeatureHolder with the Features to render
    • getRange

      Deprecated.
      Description copied from interface: SequenceRenderContext
      The range of the SymbolList to render.
      Specified by:
      getRange in interface SequenceRenderContext
      Returns:
      the RangeLocation specifying which indices (inclusive) to render
    • getVisibleRange

      Deprecated.
    • setDirection

      public void setDirection(int dir) throws IllegalArgumentException
      Deprecated.
      Set the direction that this SequencePoster renders in. The direction can be one of HORIZONTAL or VERTICAL. Once the direction is set, the display will redraw. HORIZONTAL represents left-to-right rendering. VERTICAL represents AceDB-style vertical rendering.
      Parameters:
      dir - the new rendering direction
      Throws:
      IllegalArgumentException
    • getDirection

      public int getDirection()
      Deprecated.
      Retrieve the current rendering direction.
      Specified by:
      getDirection in interface SequenceRenderContext
      Returns:
      the rendering direction (one of HORIZONTAL and VERTICAL)
    • setSpacer

      public void setSpacer(int spacer)
      Deprecated.
      Set the number of pixels to leave blank between each block of sequence information.

      If the SeqeuncePanel chooses to display the sequence information split across multiple lines, then the spacer parameter indicates how many pixles will seperate each line.

      Parameters:
      spacer - the number of pixels seperating each line of sequence information
    • getSpacer

      public int getSpacer()
      Deprecated.
      Retrieve the current spacer value
      Returns:
      the number of pixels between each line of sequence information
    • setScale

      public void setScale(double scale)
      Deprecated.
      Set the scale.

      The scale parameter is interpreted as the number of pixels per symbol. This may take on a wide range of values - for example, to render the symbols as text, you will need a scale of > 8, where as to render chromosome 1 you will want a scale < 0.00000001

      Parameters:
      scale - the new pixles-per-symbol ratio
    • getScale

      public double getScale()
      Deprecated.
      Retrieve the current scale.
      Specified by:
      getScale in interface SequenceRenderContext
      Returns:
      the number of pixles used to render one symbol
    • setLines

      public void setLines(int lines)
      Deprecated.
      Set the absolute number of lines that the sequence will be rendered on. If this is set to 0, then the number of lines will be calculated according to how many lines will be needed to render the sequence in the currently available space. If it is set to any positive non-zero value, the sequence will be rendered using that many lines, and the SequencePoster will request enough space to accomplish this.
      Parameters:
      lines - the number of lines to split the sequence information over
    • getLines

      public int getLines()
      Deprecated.
      Retrieve the number of lines that the sequence will be rendered over.
      Returns:
      the current number of lines (0 if autocalculated)
    • getLeadingBorder

      Deprecated.
      Retrieve the object that encapsulates the leading border area - the space before sequence information is rendered.
      Specified by:
      getLeadingBorder in interface SequenceRenderContext
      Returns:
      a SequenceRenderContext.Border instance
    • getTrailingBorder

      Deprecated.
      Retrieve the object that encapsulates the trailing border area - the space after sequence information is rendered.
      Specified by:
      getTrailingBorder in interface SequenceRenderContext
      Returns:
      a SequenceRenderContext.Border instance
    • paintComponent

      public void paintComponent(Graphics g)
      Deprecated.
      Paint this component.

      This calls the paint method of the currently registered SequenceRenderer after setting up the graphics appropriately.

      Overrides:
      paintComponent in class JComponent
    • setRenderer

      Deprecated.
      Throws:
      ChangeVetoException
    • _setRenderer

      protected void _setRenderer(SequenceRenderer r)
      Deprecated.
    • sequenceToGraphics

      public double sequenceToGraphics(int seqPos)
      Deprecated.
      Description copied from interface: SequenceRenderContext
      Converts a sequence index into a graphical coordinate. You will need to use this in conjunction with getDirection to correctly lay graphics out.
      Specified by:
      sequenceToGraphics in interface SequenceRenderContext
      Parameters:
      seqPos - Index within the sequence
      Returns:
      Equivalent graphical position in pixels
    • graphicsToSequence

      public int graphicsToSequence(double gPos)
      Deprecated.
      Description copied from interface: SequenceRenderContext
      Converts a graphical position into a sequence coordinate. You will need to have used getDirection to decide whether to use the x or y coordinate.
      Specified by:
      graphicsToSequence in interface SequenceRenderContext
      Parameters:
      gPos - A pixel position
      Returns:
      The corresponding sequence index
    • graphicsToSequence

      public int graphicsToSequence(Point2D point)
      Deprecated.
      Description copied from interface: SequenceRenderContext
      Converts a graphical position into a sequence coordinate. This will use getDirection to decide whether to use the x or y coordinate.
      Specified by:
      graphicsToSequence in interface SequenceRenderContext
      Parameters:
      point - a point representing the position
      Returns:
      the corresponding sequence index
    • resizeAndValidate

      public void resizeAndValidate()
      Deprecated.
    • calcLineExtent

      protected int[] calcLineExtent(MouseEvent me)
      Deprecated.
    • isActive

      protected boolean isActive()
      Deprecated.
    • getRenderingHints

      Deprecated.
      Returns:
      the current rendering properties
    • setRenderingHints

      public void setRenderingHints(RenderingHints renderingHints)
      Deprecated.
      Use this to switch on effects like Anti-aliasing etc
      Parameters:
      renderingHints - the desired rendering properties