Class PairwiseDiagonalRenderer

  • All Implemented Interfaces:
    Serializable, PairwiseSequenceRenderer, Changeable

    public class PairwiseDiagonalRenderer
    extends AbstractChangeable
    implements PairwiseSequenceRenderer, Serializable

    PairwiseDiagonalRenderer renders a region of similarity between two sequences as a straight line. The effect produced is similar to a dotplot. This implementation requires that these regions be represented by SimilarityPairFeatures.

    Drawing outside the visible area using a range of valid doubles may cause Java to hang (Sun JDK 1.3.1 on Linux, Compaq JDK 1.3.1 on Tru64, but not Sun JDK 1.4.0-beta2-b77 on Linux). I got round this by manual clipping of the lines to the clip area. The code uses an implementation of the Cohen-Sutherland line-clipping algorithm which clips lines to within a rectangle.

    The clipping code is taken from Computer Graphics for Java Programmers by Leen Ammeraal (1998, ISBN 0-471-98142-7) and cosmetically altered to support Java2D objects. Any bugs introduced are my responsibility.

    Since:
    1.2
    Author:
    Keith James, Leen Ammeraal
    See Also:
    Serialized Form