Merge branch 'feature/JAL-2587' into releases/Release_2_10_2b1_Branch
authorJim Procter <jprocter@issues.jalview.org>
Wed, 6 Sep 2017 11:12:07 +0000 (12:12 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 6 Sep 2017 11:12:07 +0000 (12:12 +0100)
1  2 
src/jalview/gui/OverviewCanvas.java

  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,
  
      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();
-         }
-       }
-     });
    }
  
    /**