From: kiramt Date: Wed, 30 Aug 2017 06:35:51 +0000 (+0100) Subject: JAL-2587 Removed dissolve X-Git-Tag: Release_2_10_2b1~4^2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2d137c4d89286572fba9e1f81eee9b35e4ca4a97;p=jalview.git JAL-2587 Removed dissolve --- diff --git a/src/jalview/gui/OverviewCanvas.java b/src/jalview/gui/OverviewCanvas.java index 57070f2..daa602d 100644 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@ -24,23 +24,14 @@ import jalview.api.AlignViewportI; import jalview.renderer.OverviewRenderer; import jalview.viewmodel.OverviewDimensions; -import java.awt.AlphaComposite; import java.awt.Color; 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 @@ -55,8 +46,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; @@ -69,12 +58,6 @@ public class OverviewCanvas extends JComponent private AlignViewportI av; - private float alpha = 0f; - - private long startTime = -1; - - private final Timer timer; - private ProgressPanel progressPanel; public OverviewCanvas(OverviewDimensions overviewDims, @@ -90,36 +73,6 @@ public class OverviewCanvas extends JComponent fr = new jalview.renderer.seqfeatures.FeatureRenderer(av); 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(); - } - } - }); } /** @@ -171,7 +124,6 @@ public class OverviewCanvas extends JComponent FeatureRenderer transferRenderer) { miniMe = null; - veryLastMiniMe = lastMiniMe; if (showSequenceFeatures) { @@ -209,8 +161,6 @@ public class OverviewCanvas extends JComponent { updaterunning = false; lastMiniMe = miniMe; - alpha = 1f; - timer.start(); } } @@ -278,25 +228,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); } }