Class MultipleAlignmentCoordManager


  • public class MultipleAlignmentCoordManager
    extends Object
    Generalization of the Coodinate Manager to include an arbitrary number of sequences (lines) for MultipleAlignment visualization.
    Author:
    Aleix Lafita
    • Constructor Detail

      • MultipleAlignmentCoordManager

        public MultipleAlignmentCoordManager​(int size,
                                             int length)
        Constructor.
        Parameters:
        size - number of structures/sequences aligned (rows).
        length - number of aligned residues (columns)
    • Method Detail

      • getPreferredWidth

        public int getPreferredWidth()
        X coordinate size
        Returns:
        the preferred width
      • getPreferredHeight

        public int getPreferredHeight()
        Y coordinate size
        Returns:
        the preferred height
      • getSeqPos

        public int getSeqPos​(int aligSeq,
                             Point p)
        Convert from an X position in the JPanel to the position in the sequence alignment.
        Parameters:
        aligSeq - sequence number
        p - point on panel
        Returns:
        the sequence position for a point on the Panel
      • getPanelPos

        public Point getPanelPos​(int structure,
                                 int pos)
        Get the X position on the Panel of a particular sequence position.
        Parameters:
        structure - index of the structure for the sequence position.
        pos - sequence position, the aligned position index
        Returns:
        the point on a panel for a sequence position
      • getAligSeq

        public int getAligSeq​(Point point)
        Returns the index of the structure, for a given point in the Panel. Returns -1 if not over a position in the sequence alignment.
        Parameters:
        point - x and y coordinates in the panel
        Returns:
        which structure a point on the panel corresponds to
      • getLegendPosition

        public Point getLegendPosition​(int lineNr,
                                       int structure)
        Provide the coordinates for where to draw the legend for line X given the structure index.
        Parameters:
        lineNr - line of the Panel
        structure - the structure index
        Returns:
        get the point where to draw the legend