Class SequencePoster

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

    public class SequencePoster
    extends JComponent
    implements 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:
    Serialized Form
    • Constructor Detail

      • SequencePoster

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

      • 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
      • 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)
      • 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
      • 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
      • isActive

        protected boolean isActive()
        Deprecated.
      • setRenderingHints

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