package jalview.appletgui;
import jalview.renderer.OverviewRenderer;
+import jalview.renderer.OverviewResColourFinder;
import jalview.viewmodel.OverviewDimensions;
import java.awt.Color;
setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
or = new OverviewRenderer(fr, od, av.getAlignment(),
- av.getResidueShading());
+ av.getResidueShading(), new OverviewResColourFinder());
miniMe = nullFrame.createImage(od.getWidth(), od.getHeight());
offscreen = nullFrame.createImage(od.getWidth(), od.getHeight());
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.Color;
sr = new SequenceRenderer(av);
sr.renderGaps = false;
- // sr.forOverview = true;
fr = new jalview.renderer.seqfeatures.FeatureRenderer(av);
}
setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
+ boolean useLegacy = Cache.getDefault("USE_LEGACY_GAP", false);
+ Color gapCol = Cache.getDefaultColour("GAP_COLOUR", new Color(240, 240, 240));
+ Color hiddenCol = Cache.getDefaultColour("HIDDEN_COLOUR", Color.DARK_GRAY.darker());
+ OverviewResColourFinder cf = new OverviewResColourFinder(useLegacy,
+ gapCol, hiddenCol);
or = new OverviewRenderer(fr, od, av.getAlignment(),
- av.getResidueShading());
+ av.getResidueShading(), cf);
miniMe = or.draw(od.getRows(av.getAlignment()),
od.getColumns(av.getAlignment()));
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.viewmodel.OverviewDimensions;
this.av = alPanel.av;
this.ap = alPanel;
- od = new OverviewDimensionsShowHidden(av.getRanges(),
+ showHidden = Cache.getDefault("SHOW_OV_HIDDEN_AT_START", true);
+ if (showHidden)
+ {
+ od = new OverviewDimensionsShowHidden(av.getRanges(),
(av.isShowAnnotation()
&& av.getAlignmentConservationAnnotation() != null));
+ }
+ else
+ {
+ od = new OverviewDimensionsHideHidden(av.getRanges(),
+ (av.isShowAnnotation()
+ && av.getAlignmentConservationAnnotation() != null));
+ }
setSize(od.getWidth(), od.getHeight());
}
}
else
- // if (!av.getWrapAlignment())
{
if (!od.isPositionInBox(evt.getX(), evt.getY()))
{
// transparency of hidden cols/seqs overlay
private final float TRANSPARENCY = 0.5f;
+ private final Color HIDDEN_COLOUR = Color.DARK_GRAY.darker();
+
private FeatureColourFinder finder;
// image to render on
private ResidueShaderI shader;
- private ResidueColourFinder resColFinder;
+ private OverviewResColourFinder resColFinder;
public OverviewRenderer(FeatureRenderer fr, OverviewDimensions od,
AlignmentI alignment,
- ResidueShaderI resshader)
+ ResidueShaderI resshader, OverviewResColourFinder colFinder)
{
finder = new FeatureColourFinder(fr);
- resColFinder = new OverviewResColourFinder();
+ resColFinder = colFinder;
al = alignment;
shader = resshader;
int colIndex = 0;
int pixelCol = 0;
- Color hidden = Color.DARK_GRAY.darker();
+ Color hidden = resColFinder.getHiddenColour();
Graphics2D g2d = (Graphics2D) hiddenImage.getGraphics();
public class OverviewResColourFinder extends ResidueColourFinder
{
- final Color GAP_COLOUR = new Color(240, 240, 240);
+ final Color GAP_COLOUR;
+
+ final Color RESIDUE_COLOUR;
+
+ final Color HIDDEN_COLOUR;
+
+ boolean useLegacy = false;
+
+ public OverviewResColourFinder()
+ {
+ GAP_COLOUR = new Color(240, 240, 240);
+ RESIDUE_COLOUR = Color.white;
+ HIDDEN_COLOUR = Color.DARK_GRAY.darker();
+ }
+
+ public OverviewResColourFinder(boolean useLegacyColouring, Color gapCol,
+ Color hiddenCol)
+ {
+ if (useLegacyColouring)
+ {
+ GAP_COLOUR = Color.white;
+ RESIDUE_COLOUR = new Color(240, 240, 240);
+ HIDDEN_COLOUR = hiddenCol;
+ }
+ else
+ {
+ GAP_COLOUR = gapCol;
+ RESIDUE_COLOUR = Color.white;
+ HIDDEN_COLOUR = hiddenCol;
+ }
+ }
@Override
public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i)
{
- Color resBoxColour = Color.white;
+ Color resBoxColour = RESIDUE_COLOUR;
char currentChar = seq.getCharAt(i);
// In the overview window, gaps are coloured grey, unless the colour scheme
return getBoxColour(currentShader, seq, i);
}
+
+ protected Color getHiddenColour()
+ {
+ return HIDDEN_COLOUR;
+ }
}