JAL-1161 changed signature to allow clipping bounds for panel to be obtained
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Mon, 20 May 2013 14:35:04 +0000 (15:35 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 24 May 2013 14:10:54 +0000 (15:10 +0100)
src/jalview/appletgui/AnnotationPanel.java
src/jalview/gui/AnnotationPanel.java
src/jalview/renderer/AwtRenderPanelI.java

index 540a0e0..f4b2212 100755 (executable)
@@ -653,4 +653,14 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
   {
     return imgWidth;
   }
+  private int[] bounds = new int[2];
+  @Override
+  public int[] getVisibleVRange()
+  {
+    int sOffset=-ap.alabels.scrollOffset;
+    int visHeight = sOffset+ap.annotationPanelHolder.getHeight();
+    bounds[0] = sOffset; bounds[1]=visHeight;
+    return bounds;
+  }
+
 }
index 93647a8..90f4595 100755 (executable)
@@ -950,4 +950,13 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   {
     return imgWidth;
   }
+  private int[] bounds = new int[2];
+  @Override
+  public int[] getVisibleVRange()
+  {
+    int sOffset=-ap.alabels.scrollOffset;
+    int visHeight = sOffset+ap.annotationSpaceFillerHolder.getHeight();
+    bounds[0] = sOffset; bounds[1]=visHeight;
+    return bounds;
+  }
 }
index 70bbc7b..e73a673 100644 (file)
@@ -41,4 +41,10 @@ public interface AwtRenderPanelI extends ImageObserver
    */
   int getFadedImageWidth();
 
+  /**
+   * height of visible area on to the image - used to draw only what is visible.
+   * @return [start, end of visible region]
+   */
+  int[] getVisibleVRange();
+
 }