JAL-3253-applet JAL-3383 Overview
[jalview.git] / src / jalview / gui / OverviewPanel.java
index 387d3dd..5694c3d 100755 (executable)
@@ -120,37 +120,7 @@ public class OverviewPanel extends JPanel
       @Override
       public void componentResized(ComponentEvent evt)
       {
-        int ph = (progressPanel.getParent() == null ? 0
-                : progressPanel.getHeight());
-        // Resize is called on the initial display of the overview.
-        // This code adjusts sizes to account for the progress bar if it has not
-        // already been accounted for, which triggers another resize call for
-        // the correct sizing, at which point the overview image is updated.
-        // (This avoids a double recalculation of the image.)
-        if (getWidth() == od.getWidth()
-                && getHeight() == od.getHeight() + ph)
-        {
-          updateOverviewImage();
-        }
-        else
-        {
-          int w = getWidth();
-          int h = getHeight();
-          if ((w > 0) && (h > 0))
-          {
-            if (dim != null)
-            {
-              dim.setSize(w, h - ph);
-            }
-            od.setWidth(w);
-            od.setHeight(h - ph);
-            repaint();
-          }
-          // BH 2019.07.29 this is unnecessary -- it is what layout managers are
-          // for:
-          // setPreferredSize(new Dimension(od.getWidth(), od.getHeight() +
-          // ph));
-        }
+        resizePanel();
       }
 
     });
@@ -268,6 +238,43 @@ public class OverviewPanel extends JPanel
     // }
   }
 
+  protected void resizePanel()
+  {
+    int ph = (progressPanel.getParent() == null ? 0
+            : progressPanel.getHeight());
+    // Resize is called on the initial display of the overview.
+    // This code adjusts sizes to account for the progress bar if it has not
+    // already been accounted for, which triggers another resize call for
+    // the correct sizing, at which point the overview image is updated.
+    // (This avoids a double recalculation of the image.)
+    if (getWidth() == od.getWidth() && getHeight() == od.getHeight() + ph)
+    {
+      if (canvas.lastMiniMe == null)
+      {
+        updateOverviewImage();
+      }
+    }
+    else
+    {
+      int w = getWidth();
+      int h = getHeight();
+      if ((w > 0) && (h > 0))
+      {
+        if (dim != null)
+        {
+          dim.setSize(w, h - ph);
+        }
+        od.setWidth(w);
+        od.setHeight(h - ph);
+        updateOverviewImage();
+      }
+      // BH 2019.07.29 this is unnecessary -- it is what layout managers are
+      // for:
+      // setPreferredSize(new Dimension(od.getWidth(), od.getHeight() +
+      // ph));
+    }
+  }
+
   /**
    * Create the appropriate type of OverViewDimensions, with the desired size.
    */
@@ -330,6 +337,15 @@ public class OverviewPanel extends JPanel
    * 
    * Cases:
    * 
+   * AlignFrame.setFeatureGroupState
+   * 
+   * AlignmentPanel.paintAlignment(true,...) (117 references)
+   * 
+   * OverviewPanel..componentResized() OverviewPanel.toggleHiddenColumns()
+   * 
+   * PopupMenu for action.reveal_sequences, action.reveal_all
+   * 
+   * SliderPanel.mouseReleased()
    * 
    */
   public void updateOverviewImage()
@@ -367,11 +383,11 @@ public class OverviewPanel extends JPanel
   {
     if (canvas != null)
     {
+      setBoxPosition();
       canvas.draw(av.isShowSequenceFeatures(),
               (av.isShowAnnotation()
                       && av.getAlignmentConservationAnnotation() != null),
               ap.getFeatureRenderer());
-      setBoxPosition();
     }
   }