- /**
- * Get start residue of viewport
- */
- public int getStartRes(boolean countHidden)
- {
- if (countHidden)
- {
- return 0; // av.getColumnSelection().adjustForHiddenColumns(startRes);
- }
- else
- {
- return startRes;
- }
- }
-
- /**
- * Convert distance x in viewport pixels to a distance in number of residues
- *
- * @param x
- * number of pixels
- * @return number of residues
- */
- public int convertPixelsToResidues(int x)
- {
- return Math.round((float) x / viewstyle.getCharWidth());
- // return (int) ((float) x / viewstyle.getCharWidth());
- }
-
- /**
- * Convert distance y in viewport pixels to a distance in number of sequences
- *
- * @param y
- * number of pixels
- * @return number of sequences
- */
- public int convertPixelsToSequences(int y)
- {
- return Math.round((float) y / viewstyle.getCharHeight());
- // return (int) ((float) y / viewstyle.getCharHeight());
- }
-
- /**
- * Convert number of sequences s to a height in viewport pixels
- *
- * @param s
- * number of sequences
- * @return number of pixels
- */
- public int convertSequencesToPixels(int s)
- {
- return (s * viewstyle.getCharHeight());
- }
-
- /**
- * Convert number of residues r to a width in viewport pixels
- *
- * @param r
- * number of residues
- * @return number of pixels
- */
- public int convertResiduesToPixels(int r)
- {
- return (r * viewstyle.getCharWidth());
- }