From: kiramt Date: Wed, 30 Aug 2017 06:35:51 +0000 (+0100) Subject: JAL-2587 Removed dissolve X-Git-Tag: Release_2_10_3b1~138 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2ff9268291ebf9d1d8d10c0108ea4f8b50c2885f;p=jalview.git JAL-2587 Removed dissolve Conflicts: src/jalview/gui/OverviewCanvas.java --- diff --git a/src/jalview/gui/OverviewCanvas.java b/src/jalview/gui/OverviewCanvas.java index 64bf15c..7371eb5 100644 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@ -26,24 +26,15 @@ import jalview.renderer.OverviewRenderer; import jalview.renderer.OverviewResColourFinder; import jalview.viewmodel.OverviewDimensions; -import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import javax.swing.JComponent; -import javax.swing.Timer; public class OverviewCanvas extends JComponent { - private static final long RUNNING_TIME = 1000; - - private static final int SPEED = 40; - private static final Color TRANS_GREY = new Color(100, 100, 100, 25); // This is set true if the alignment view changes whilst @@ -58,8 +49,6 @@ public class OverviewCanvas extends JComponent private BufferedImage lastMiniMe = null; - private BufferedImage veryLastMiniMe = null; - // Can set different properties in this seqCanvas than // main visible SeqCanvas private SequenceRenderer sr; @@ -72,15 +61,8 @@ public class OverviewCanvas extends JComponent private AlignViewportI av; - private OverviewResColourFinder cf; - private float alpha = 0f; - - private long startTime = -1; - - private final Timer timer; - private ProgressPanel progressPanel; public OverviewCanvas(OverviewDimensions overviewDims, @@ -102,37 +84,6 @@ public class OverviewCanvas extends JComponent cf = new OverviewResColourFinder(useLegacy, gapCol, hiddenCol); setSize(od.getWidth(), od.getHeight()); - - timer = new Timer(SPEED, new ActionListener() - { - - @Override - public void actionPerformed(ActionEvent e) - { - if (startTime < 0) - { - startTime = System.currentTimeMillis(); - } - else - { - - long time = System.currentTimeMillis(); - long duration = time - startTime; - if (duration >= RUNNING_TIME) - { - startTime = -1; - ((Timer) e.getSource()).stop(); - alpha = 0f; - } - else - { - alpha = 1f - ((float) duration / (float) RUNNING_TIME); - } - repaint(); - } - } - }); - } /** @@ -184,7 +135,6 @@ public class OverviewCanvas extends JComponent FeatureRenderer transferRenderer) { miniMe = null; - veryLastMiniMe = lastMiniMe; if (showSequenceFeatures) { @@ -227,8 +177,6 @@ public class OverviewCanvas extends JComponent { updaterunning = false; lastMiniMe = miniMe; - alpha = 1f; - timer.start(); } } @@ -296,25 +244,8 @@ public class OverviewCanvas extends JComponent } else // not a resize { - if (alpha != 0) // this is a timer triggered dissolve - { - Graphics2D g2d = (Graphics2D) g.create(); - - // draw the original image - g2d.drawImage(veryLastMiniMe, 0, 0, getWidth(), getHeight(), - this); - - // draw the new image on top with varying degrees of transparency - g2d.setComposite(AlphaComposite.SrcOver.derive(1f - alpha)); - g2d.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this); - - g2d.dispose(); - } - else - { - // fall back to normal behaviour - g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this); - } + // fall back to normal behaviour + g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this); } }