From 6341c795371d5a2c5922ecb977894b10cec78b59 Mon Sep 17 00:00:00 2001 From: kiramt Date: Wed, 19 Jul 2017 15:26:55 +0100 Subject: [PATCH] JAL-2587 first tweaks to change overview update --- src/jalview/gui/OverviewCanvas.java | 14 ++++++++++---- src/jalview/gui/OverviewPanel.java | 9 +++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/OverviewCanvas.java b/src/jalview/gui/OverviewCanvas.java index 27f9c3f..468deb1 100644 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@ -155,6 +155,13 @@ public class OverviewCanvas extends JComponent } @Override + public void setSize(int width, int height) + { + // TODO Auto-generated method stub + super.setSize(width, height); + } + + @Override public void paintComponent(Graphics g) { if (restart) @@ -173,16 +180,15 @@ public class OverviewCanvas extends JComponent } else if (lastMiniMe != null) { - g.drawImage(lastMiniMe, 0, 0, this); - if (lastMiniMe != miniMe) + g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this); + /* if (lastMiniMe != miniMe) { g.setColor(TRANS_GREY); g.fillRect(0, 0, getWidth(), getHeight()); - } + }*/ } g.setColor(Color.red); od.drawBox(g); } - } diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 3fa674e..8a76211 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -96,6 +96,15 @@ public class OverviewPanel extends JPanel implements Runnable, if ((getWidth() != od.getWidth()) || (getHeight() != (od.getHeight()))) { + if ((getWidth() > 0) && (getHeight() > 0)) + { + od.setWidth(getWidth()); + od.setHeight(getHeight()); + } + + setPreferredSize(new Dimension(od.getWidth(), od.getHeight())); + setBoxPosition(); + updateOverviewImage(); setBoxPosition(); } -- 1.7.10.2