From 0c49a8319653fac1ae25e8d5bb99b2917f8e9975 Mon Sep 17 00:00:00 2001 From: kiramt Date: Wed, 9 Aug 2017 11:34:55 +0100 Subject: [PATCH] JAL-2587 fiddling with dimensions --- src/jalview/gui/OverviewCanvas.java | 13 +++++++++---- src/jalview/gui/OverviewPanel.java | 8 +++----- 2 files changed, 12 insertions(+), 9 deletions(-) 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(), -- 1.7.10.2