001/*
002 * BioJava development code
003 * 
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 * 
009 * http://www.gnu.org/copyleft/lesser.html
010 * 
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 * 
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 * 
018 * http://www.biojava.org
019 * 
020 */
021
022package org.biojava.bio.gui.sequence;
023
024import java.awt.Point;
025
026import org.biojava.bio.seq.FeatureHolder;
027import org.biojava.bio.symbol.RangeLocation;
028import org.biojava.bio.symbol.SymbolList;
029
030/**
031 * <code>PairwiseRenderContext</code> encapsulates information
032 * required for the rendering of a pair of sequences. No assumption is
033 * made as to whether the sequences are to be rendered in different
034 * directions (as in a dotplot) or in the same direction; this is left
035 * to the implementation. The leading and trailing borders refer to
036 * the primary sequence only.
037 *
038 * @author Keith James
039 * @since 1.2
040 */
041public interface PairwiseRenderContext extends SequenceRenderContext
042{
043    /**
044     * <code>getSecondaryDirection</code> returns the direction in
045     * which the secondary sequence is rendered. This may be either
046     * HORIZONTAL or VERTICAL.
047     *
048     * @return an <code>int</code>.
049     */
050    public int getSecondaryDirection();
051
052    /**
053     * <code>getSecondarySymbols</code> returns the symbols of the
054     * secondary sequence.
055     *
056     * @return a <code>SymbolList</code>.
057     */
058    public SymbolList getSecondarySymbols();
059
060    /**
061     * <code>getSecondaryFeatures</code> returns the features on the
062     * secondary sequence.
063     *
064     * @return a <code>FeatureHolder</code>.
065     */
066    public FeatureHolder getSecondaryFeatures();
067
068    /**
069     * <code>getSecondaryRange</code> returns the range of the
070     * secondary sequence currently rendered.
071     *
072     * @return a <code>RangeLocation</code>.
073     */
074    public RangeLocation getSecondaryRange();
075
076    /**
077     * <code>secondarySequenceToGraphics</code> converts a sequence
078     * coordinate on the secondary sequence to a graphical position.
079     *
080     * @param sequencePos an <code>int</code>.
081     *
082     * @return a <code>double</code>.
083     */
084    public double secondarySequenceToGraphics(int sequencePos);
085
086    /**
087     * <code>graphicsToSecondarySequence</code> converts a graphical
088     * position to a sequence coordinate on the secondary sequence.
089     *
090     * @param graphicsPos a <code>double</code>.
091     *
092     * @return an <code>int</code>.
093     */
094    public int graphicsToSecondarySequence(double graphicsPos);
095
096    /**
097     * <code>graphicsToSecondarySequence</code> converts a graphical
098     * position to a secondary sequence index.
099     *
100     * @param point a <code>Point</code>.
101     *
102     * @return an <code>int</code>.
103     */
104    public int graphicsToSecondarySequence(Point point);
105}