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