From f52d7fc6ab9bf2c926f0208c225d3dc6e65c8ecf Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 20 May 2013 15:35:04 +0100 Subject: [PATCH] JAL-1161 changed signature to allow clipping bounds for panel to be obtained --- src/jalview/appletgui/AnnotationPanel.java | 10 ++++++++++ src/jalview/gui/AnnotationPanel.java | 9 +++++++++ src/jalview/renderer/AwtRenderPanelI.java | 6 ++++++ 3 files changed, 25 insertions(+) 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(); + } -- 1.7.10.2