Merge remote-tracking branch 'origin/develop' into features/JAL-2388OverviewWindow
[jalview.git] / src / jalview / viewmodel / ViewportRanges.java
index 5c8cdb6..18703b4 100644 (file)
@@ -25,7 +25,9 @@ import jalview.datamodel.AlignmentI;
 /**
  * Embryonic class which: Supplies and updates viewport properties relating to
  * position such as: start and end residues and sequences; ideally will serve
- * hidden columns/rows too
+ * hidden columns/rows too. Intention also to support calculations for
+ * positioning, scrolling etc. such as finding the middle of the viewport,
+ * checking for scrolls off screen
  */
 public class ViewportRanges extends ViewportProperties
 {
@@ -77,6 +79,23 @@ public class ViewportRanges extends ViewportProperties
   }
 
   /**
+   * Get alignment width in cols, excluding hidden cols
+   */
+  public int getVisibleAlignmentWidth()
+  {
+    // TODO need access to hidden columns here
+    return al.getWidth(); // - hidden columns
+  }
+
+  /**
+   * Get alignment height in rows, excluding hidden rows
+   */
+  public int getVisibleAlignmentHeight()
+  {
+    return al.getHeight();
+  }
+
+  /**
    * Set first residue visible in the viewport
    * 
    * @param res