From: Jim Procter Date: Wed, 6 Sep 2017 11:12:07 +0000 (+0100) Subject: Merge branch 'feature/JAL-2587' into releases/Release_2_10_2b1_Branch X-Git-Tag: Release_2_10_2b1~4^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=937444414f2ff7d48f6ea8505144c2695d495e8c;p=jalview.git Merge branch 'feature/JAL-2587' into releases/Release_2_10_2b1_Branch --- 937444414f2ff7d48f6ea8505144c2695d495e8c diff --cc src/jalview/gui/OverviewCanvas.java index 64bf15c,daa602d..7371eb5 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@@ -21,18 -21,11 +21,14 @@@ package jalview.gui; import jalview.api.AlignViewportI; +import jalview.bin.Cache; 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; @@@ -72,15 -58,6 +61,8 @@@ public class OverviewCanvas extends JCo 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, @@@ -92,47 -69,10 +74,16 @@@ sr = new SequenceRenderer(av); sr.renderGaps = false; - sr.forOverview = true; fr = new jalview.renderer.seqfeatures.FeatureRenderer(av); + boolean useLegacy = Cache.getDefault(Preferences.USE_LEGACY_GAP, false); + Color gapCol = Cache.getDefaultColour(Preferences.GAP_COLOUR, + jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_GAP); + Color hiddenCol = Cache.getDefaultColour(Preferences.HIDDEN_COLOUR, + jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_HIDDEN); + 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(); - } - } - }); - } /**