import jalview.util.MapList;
import jalview.util.StringUtils;
+import java.awt.Color;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
// otherwise, sequence was completely hidden
return 0;
}
+
+ @Override
+ public Color getColor(int i)
+ {
+ return null;
+ }
+
+ @Override
+ public Color setColor(int i, Color c)
+ {
+ return c;
+ }
+
+ @Override
+ public void resetColors()
+ {
+ }
}
import jalview.util.MapList;
import jalview.ws.params.InvalidArgumentException;
+import java.awt.Color;
import java.util.BitSet;
import java.util.Iterator;
import java.util.List;
*/
public int firstResidueOutsideIterator(Iterator<int[]> it);
+ public Color getColor(int i);
+
+ public Color setColor(int i, Color c);
+
+ public void resetColors();
}
});
- /*
- * Javascript does not call componentResized on initial display,
- * so do the update here
- */
- if (Platform.isJS())
- {
- updateOverviewImage();
- }
+ // /*
+ // * Javascript does not call componentResized on initial display,
+ // * so do the update here
+ // */
+ // if (Platform.isJS())
+ // {
+ // updateOverviewImage();
+ // }
}
/**
}
/**
- * Updates the overview image when the related alignment panel is updated
+ * Updates the overview image when the related alignment panel is updated.
+ *
+ * Cases:
+ *
+ *
*/
public void updateOverviewImage()
{
@Override
public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i)
{
- Color resBoxColour = RESIDUE_COLOUR;
+ seq.resetColors();
+ Color c = seq.getColor(i);
+ if (c != null)
+ {
+ return c;
+ }
char currentChar = seq.getCharAt(i);
-
// In the overview window, gaps are coloured grey, unless the colour scheme
// specifies a gap colour, in which case gaps honour the colour scheme
// settings
- if (shader.getColourScheme() != null)
+ boolean isGap = Comparison.isGap(currentChar);
+ if (shader.getColourScheme() == null)
{
- if (Comparison.isGap(currentChar)
- && (!shader.getColourScheme().hasGapColour()))
- {
- resBoxColour = GAP_COLOUR;
- }
- else
- {
- resBoxColour = shader.findColour(currentChar, i, seq);
- }
+ return seq.setColor(i, isGap ? GAP_COLOUR : RESIDUE_COLOUR);
}
- else if (Comparison.isGap(currentChar))
- {
- resBoxColour = GAP_COLOUR;
- }
-
- return resBoxColour;
+ return seq.setColor(i,
+ isGap && !shader.getColourScheme().hasGapColour() ? GAP_COLOUR
+ : shader.findColour(currentChar, i, seq));
}
/**
*/
@Override
protected Color getResidueBoxColour(boolean showBoxes,
- ResidueShaderI shader,
- SequenceGroup[] allGroups, SequenceI seq, int i)
+ ResidueShaderI shader, SequenceGroup[] allGroups, SequenceI seq,
+ int i)
{
- ResidueShaderI currentShader;
SequenceGroup currentSequenceGroup = getCurrentSequenceGroup(allGroups,
i);
- if (currentSequenceGroup != null)
- {
- currentShader = currentSequenceGroup.getGroupColourScheme();
- }
- else
- {
- currentShader = shader;
- }
-
+ ResidueShaderI currentShader = (currentSequenceGroup == null ? shader
+ : currentSequenceGroup.getGroupColourScheme());
return getBoxColour(currentShader, seq, i);
}