From: Jim Procter Date: Mon, 20 May 2013 14:35:04 +0000 (+0100) Subject: JAL-1161 changed signature to allow clipping bounds for panel to be obtained X-Git-Tag: Jalview_2_9~249^2~25 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f52d7fc6ab9bf2c926f0208c225d3dc6e65c8ecf;p=jalview.git JAL-1161 changed signature to allow clipping bounds for panel to be obtained --- diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 540a0e0..f4b2212 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -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; + } + } diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 93647a8..90f4595 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -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; + } } diff --git a/src/jalview/renderer/AwtRenderPanelI.java b/src/jalview/renderer/AwtRenderPanelI.java index 70bbc7b..e73a673 100644 --- a/src/jalview/renderer/AwtRenderPanelI.java +++ b/src/jalview/renderer/AwtRenderPanelI.java @@ -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(); + }