JAL-2587 fiddling with dimensions
authorkiramt <k.mourao@dundee.ac.uk>
Wed, 9 Aug 2017 10:34:55 +0000 (11:34 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Wed, 9 Aug 2017 10:34:55 +0000 (11:34 +0100)
src/jalview/gui/OverviewCanvas.java
src/jalview/gui/OverviewPanel.java

index 6071e75..536301e 100644 (file)
@@ -88,6 +88,8 @@ public class OverviewCanvas extends JComponent
     sr.forOverview = true;
     fr = new jalview.renderer.seqfeatures.FeatureRenderer(av);
 
+    setSize(od.getWidth(), od.getHeight());
+
     timer = new Timer(SPEED, new ActionListener()
     {
 
@@ -167,6 +169,11 @@ public class OverviewCanvas extends JComponent
   public void draw(boolean showSequenceFeatures, boolean showAnnotation,
           FeatureRenderer transferRenderer)
   {
+    System.out.println(this.getHeight());
+    //od.setHeight(this.getHeight());
+    //od.setWidth(this.getWidth());
+    setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
+
     miniMe = null;
     veryLastMiniMe = lastMiniMe;
 
@@ -175,8 +182,6 @@ public class OverviewCanvas extends JComponent
       fr.transferSettings(transferRenderer);
     }
 
-    setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
-
     or = new OverviewRenderer(sr, fr, od);
     or.addPropertyChangeListener(progressPanel);
     miniMe = or.draw(od.getRows(av.getAlignment()),
@@ -288,12 +293,12 @@ public class OverviewCanvas extends JComponent
 
           g2d.dispose();
         }
-        else if (lastMiniMe != miniMe)
+        /*       else if (lastMiniMe != miniMe)
         {
           g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
           g.setColor(TRANS_GREY);
           g.fillRect(0, 0, getWidth(), getHeight());
-        }
+        }*/
         else
         {
           // fall back to normal behaviour
index 791de99..ef064f4 100755 (executable)
@@ -86,8 +86,6 @@ public class OverviewPanel extends JPanel implements Runnable,
             (av.isShowAnnotation() && av
                     .getAlignmentConservationAnnotation() != null));
 
-
-
     setLayout(new BorderLayout());
     progressPanel = new ProgressPanel(OverviewRenderer.UPDATE,
             MessageManager.getString("label.oview_calc"));
@@ -95,7 +93,6 @@ public class OverviewPanel extends JPanel implements Runnable,
     oviewCanvas = new OverviewCanvas(od, av, progressPanel);
 
     add(oviewCanvas, BorderLayout.CENTER);
-    setSize(od.getWidth(), od.getHeight());
 
     av.getRanges().addPropertyChangeListener(this);
 
@@ -106,6 +103,7 @@ public class OverviewPanel extends JPanel implements Runnable,
       {
         updateOverviewImage();
       }
+
     });
 
     addMouseMotionListener(new MouseMotionAdapter()
@@ -201,7 +199,7 @@ public class OverviewPanel extends JPanel implements Runnable,
       }
     });
 
-    updateOverviewImage();
+    // updateOverviewImage();
   }
 
   /*
@@ -269,7 +267,7 @@ public class OverviewPanel extends JPanel implements Runnable,
     if ((getWidth() > 0) && (getHeight() > 0))
     {
       od.setWidth(getWidth());
-      od.setHeight(getHeight());
+      od.setHeight(getHeight() - progressPanel.getHeight());
     }
     
     setPreferredSize(new Dimension(od.getWidth(),