JAL-2388 Renamed viewport position props to viewport ranges
[jalview.git] / src / jalview / viewmodel / OverviewDimensions.java
index b34c85d..1e9eaf7 100644 (file)
@@ -69,24 +69,24 @@ public class OverviewDimensions
   /**
    * Create an OverviewDimensions object
    * 
-   * @param props
+   * @param ranges
    *          positional properties of the viewport
    * @param showAnnotationPanel
    *          true if the annotation panel is to be shown, false otherwise
    */
-  public OverviewDimensions(ViewportPositionProps props,
+  public OverviewDimensions(ViewportRanges ranges,
           boolean showAnnotationPanel)
   {
     // scale the initial size of overviewpanel to shape of alignment
-    float initialScale = (float) props.getAbsoluteAlignmentWidth()
-            / (float) props.getAbsoluteAlignmentHeight();
+    float initialScale = (float) ranges.getAbsoluteAlignmentWidth()
+            / (float) ranges.getAbsoluteAlignmentHeight();
 
     if (!showAnnotationPanel)
     {
       graphHeight = 0;
     }
 
-    if (props.getAbsoluteAlignmentWidth() > props
+    if (ranges.getAbsoluteAlignmentWidth() > ranges
             .getAbsoluteAlignmentHeight())
     {
       // wider
@@ -121,18 +121,18 @@ public class OverviewDimensions
    *          hidden sequences
    * @param hiddenCols
    *          hidden columns
-   * @param props
+   * @param ranges
    *          viewport position properties
    */
   public void updateViewportFromMouse(int mousex, int mousey,
           HiddenSequences hiddenSeqs, ColumnSelection hiddenCols,
-          ViewportPositionProps props)
+          ViewportRanges ranges)
   {
     int x = mousex;
     int y = mousey;
 
-    int alwidth = props.getAbsoluteAlignmentWidth();
-    int alheight = props.getAbsoluteAlignmentHeight();
+    int alwidth = ranges.getAbsoluteAlignmentWidth();
+    int alheight = ranges.getAbsoluteAlignmentHeight();
 
     if (x < 0)
     {
@@ -156,7 +156,7 @@ public class OverviewDimensions
     int xAsRes = Math.round((float) x * alwidth / width);
 
     // get viewport width in residues
-    int vpwidth = props.getEndRes() - props.getStartRes() + 1;
+    int vpwidth = ranges.getEndRes() - ranges.getStartRes() + 1;
 
     // get where x should be when accounting for hidden cols
     // if x is in a hidden col region, shift to left - but we still need
@@ -191,7 +191,7 @@ public class OverviewDimensions
 
     // get viewport height in sequences
     // add 1 because height includes both endSeq and startSeq
-    int vpheight = props.getEndSeq() - props.getStartSeq() + 1;
+    int vpheight = ranges.getEndSeq() - ranges.getStartSeq() + 1;
 
     // get where y should be when accounting for hidden rows
     // if y is in a hidden row region, shift up - but we still need absolute
@@ -231,22 +231,22 @@ public class OverviewDimensions
    *          hidden sequences
    * @param hiddenCols
    *          hidden columns
-   * @param props
+   * @param ranges
    *          viewport position properties
    */
   public void setBoxPosition(HiddenSequences hiddenSeqs,
-          ColumnSelection hiddenCols, ViewportPositionProps props)
+          ColumnSelection hiddenCols, ViewportRanges ranges)
   {
-    int alwidth = props.getAbsoluteAlignmentWidth();
-    int alheight = props.getAbsoluteAlignmentHeight();
+    int alwidth = ranges.getAbsoluteAlignmentWidth();
+    int alheight = ranges.getAbsoluteAlignmentHeight();
 
     // work with absolute values of startRes and endRes
-    int startRes = hiddenCols.adjustForHiddenColumns(props.getStartRes());
-    int endRes = hiddenCols.adjustForHiddenColumns(props.getEndRes());
+    int startRes = hiddenCols.adjustForHiddenColumns(ranges.getStartRes());
+    int endRes = hiddenCols.adjustForHiddenColumns(ranges.getEndRes());
 
     // work with absolute values of startSeq and endSeq
-    int startSeq = hiddenSeqs.adjustForHiddenSeqs(props.getStartSeq());
-    int endSeq = hiddenSeqs.adjustForHiddenSeqs(props.getEndSeq());
+    int startSeq = hiddenSeqs.adjustForHiddenSeqs(ranges.getStartSeq());
+    int endSeq = hiddenSeqs.adjustForHiddenSeqs(ranges.getEndSeq());
 
     // boxX, boxY is the x,y location equivalent to startRes, startSeq
     boxX = Math.round((float) startRes * width / alwidth);