public Color getResidueBoxColour(ColourSchemeI cs, SequenceI seq, int i)\r
{\r
Color c = Color.white;\r
- try{\r
- c = cs.findColour(seq, seq.getSequence(i, i + 1), i, null);\r
- }catch(Exception ex){}\r
+try{\r
+ if (cs != null)\r
+ c = cs.findColour(seq.getSequence(i, i + 1), i, av.getConsensus(false));\r
+ }catch(Exception ex){}\r
\r
return c;\r
}\r
int curStart = x1;\r
int curWidth = width;\r
\r
- if(currentSequenceGroup!=null && currentSequenceGroup.getDisplayBoxes())\r
- {\r
- curStart = currentSequenceGroup.getStartRes();\r
- curWidth = currentSequenceGroup.getEndRes();\r
- }\r
-\r
- // int threshold = 80;\r
-\r
while (i <= end && i < length)\r
{\r
+ color = color.white;\r
+\r
if(inCurrentSequenceGroup(i))\r
{\r
- color = getResidueBoxColour(currentSequenceGroup.cs, seq, i);\r
+ if( currentSequenceGroup.getDisplayBoxes())\r
+ color = getResidueBoxColour(currentSequenceGroup.cs, seq, i);\r
}\r
- else\r
- color = getResidueBoxColour(av.getGlobalColourScheme(), seq, i);\r
-\r
- // Hashtable hash = (Hashtable)freq.elementAt(i-start);\r
- // String s = (String)hash.get("maxResidue");\r
- // int count = ((Integer)hash.get("maxCount")).intValue();\r
- // int max = ((Integer)hash.get("size")).intValue();\r
- // int nongap = ((Integer)hash.get("nongap")).intValue();\r
- // float frac = (float)(count*1.0/(1.0*nongap));\r
-\r
- //System.out.println("Frac/count/nongap " + frac + " " + count + " " + nongap);\r
- /* if (!seq.getSequence().substring(i,i+1).equals(s) ||\r
- s.equals("-") ||\r
- s.equals(".") ||\r
- s.equals(" "))\r
- {\r
- c = Color.white;\r
- } else {\r
- if (frac > 0.9) {\r
- c = Color.red;\r
- } else if (frac > 0.8) {\r
- c = Color.orange;\r
- } else if (frac > 0.7) {\r
- c = Color.pink;\r
- } else if (frac > 0.5) {\r
- c = Color.yellow;\r
- } else if (frac> 0.3) {\r
- c = Color.lightGray;\r
- }\r
- }*/\r
+ else if(av.getShowBoxes())\r
+ color = getResidueBoxColour(av.getGlobalColourScheme(), seq, i);\r
+\r
\r
if (color != currentColor || color != null)\r
{\r
else\r
s = ' ';\r
\r
- if(!renderGaps && (s=='-' || s=='.' || s==' '))\r
+ if(!renderGaps && jalview.util.Comparison.isGap(s))\r
continue;\r
\r
+ g.setColor(Color.black);\r
\r
if (inCurrentSequenceGroup(i))\r
{\r
g.setColor(getResidueBoxColour(currentSequenceGroup.cs, seq, i).darker());\r
}\r
else\r
- g.setColor(Color.black);\r
+ {\r
+ if(!av.getShowText())\r
+ continue;\r
+\r
+ if(av.getColourText())\r
+ g.setColor(getResidueBoxColour(av.getGlobalColourScheme(), seq, i).darker());\r
+ }\r
\r
charOffset = (width - fm.charWidth(s))/2;\r
g.drawString(String.valueOf(s), charOffset + x1 + width * (i - start), y1 + height - pady);\r