Merge remote-tracking branch 'origin/merge/Jalview-JS/develop_feature/JAL-3690_callba...
[jalview.git] / src / jalview / viewmodel / OverviewDimensions.java
index 0235081..c153dc1 100644 (file)
@@ -26,6 +26,7 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.HiddenSequences;
 
+import java.awt.Dimension;
 import java.awt.Graphics;
 
 public abstract class OverviewDimensions
@@ -71,15 +72,22 @@ public abstract class OverviewDimensions
    *          true if the annotation panel is to be shown, false otherwise
    */
   public OverviewDimensions(ViewportRanges ranges,
-          boolean showAnnotationPanel)
+          boolean showAnnotationPanel, Dimension dim)
   {
+    if (!showAnnotationPanel)
+    {
+      graphHeight = 0;
+    }
+
     // scale the initial size of overviewpanel to shape of alignment
     float initialScale = (float) ranges.getAbsoluteAlignmentWidth()
             / (float) ranges.getAbsoluteAlignmentHeight();
 
-    if (!showAnnotationPanel)
+    if (dim != null)
     {
-      graphHeight = 0;
+      width = dim.width;
+      sequencesHeight = dim.height;
+      return;
     }
 
     if (ranges.getAbsoluteAlignmentWidth() > ranges