From cafed4b842952c6a6e4add2a0d112f7f6331d8d7 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 2 Aug 2016 15:46:58 +0100 Subject: [PATCH] JAL-2034 show greyed out image during overview update --- src/jalview/gui/OverviewPanel.java | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index c2a401d..d09c756 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -414,13 +414,17 @@ public class OverviewPanel extends JPanel implements Runnable resizing = false; - setBoxPosition(); - if (resizeAgain) { resizeAgain = false; updateOverviewImage(); } + else + { + lastMiniMe = miniMe; + } + + setBoxPosition(); } /** @@ -475,6 +479,7 @@ public class OverviewPanel extends JPanel implements Runnable repaint(); } + private BufferedImage lastMiniMe = null; /** * DOCUMENT ME! * @@ -484,19 +489,32 @@ public class OverviewPanel extends JPanel implements Runnable @Override public void paintComponent(Graphics g) { - if (resizing) + if (resizing || resizeAgain) { - g.setColor(Color.white); + if (lastMiniMe == null) + { + g.setColor(Color.white); + g.fillRect(0, 0, getWidth(), getHeight()); + } + else + { + g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this); + } + g.setColor(new Color(100, 100, 100, 25)); g.fillRect(0, 0, getWidth(), getHeight()); } - else if (miniMe != null) + else if (lastMiniMe != null) { - g.drawImage(miniMe, 0, 0, this); + g.drawImage(lastMiniMe, 0, 0, this); + if (lastMiniMe != miniMe) + { + g.setColor(new Color(100, 100, 100, 25)); + g.fillRect(0, 0, getWidth(), getHeight()); + } } - + // TODO: render selected regions g.setColor(Color.red); g.drawRect(boxX, boxY, boxWidth, boxHeight); g.drawRect(boxX + 1, boxY + 1, boxWidth - 2, boxHeight - 2); - } } -- 1.7.10.2