001package org.biojava.bio.gui.sequence;
002
003import org.biojava.bio.seq.FeatureHolder;
004import org.biojava.bio.symbol.SymbolList;
005
006
007/**
008 * A context providing information for rendering sequences into circular coordinate systems.
009 *
010 * <p>
011 * <b>Note:</b> All angles are measured in radians, using the normal Java graphics concepts of
012 * angles.
013 * </p>
014 *
015 * @author Matthew Pocock
016 * @since 1.4
017 */
018public interface CircularRendererContext {
019  /**
020   * Get the angle through which the origin of the sequence is rotated through.
021   *
022   * <p>
023   * This is equivalent to adding the offset to all calculated angles.
024   * </p>
025   *
026   * @return the rotation offset
027   */
028  public double getOffset();
029
030  /**
031   * Return the angle for an index into a sequence.
032   *
033   * @param indx  the sequence offset
034   * @return  the angle this offset is to be rendered to
035   */
036  public double getAngle(int indx);
037
038  /**
039   * Calculate the position in the sequence relating to the angle.
040   *
041   * @param angle  the angle arround the circle
042   * @return  the index of the symbol rendered at that angle
043   */
044  public int getIndex(double angle);
045
046  /**
047   * Get the current radius at which data should be rendered.
048   *
049   * @return the radius
050   */
051  public double getRadius();
052
053
054  /**
055   *  The SymbolList that is currently rendered by this context.
056   *
057   * @return    the Sequence value
058   */
059  SymbolList getSymbols();
060
061  /**
062   * The features to render.
063   *
064   * @return a FeatureHolder with the Features to render
065   */
066  FeatureHolder getFeatures();
067}