From: kiramt Date: Wed, 9 Aug 2017 10:34:55 +0000 (+0100) Subject: JAL-2587 fiddling with dimensions X-Git-Tag: Release_2_10_2b1~4^2^2~11 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0c49a8319653fac1ae25e8d5bb99b2917f8e9975;p=jalview.git JAL-2587 fiddling with dimensions --- diff --git a/src/jalview/gui/OverviewCanvas.java b/src/jalview/gui/OverviewCanvas.java index 6071e75..536301e 100644 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@ -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 diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 791de99..ef064f4 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -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(),