public Color getResidueBoxColour(ColourSchemeI cs, SequenceI seq, int i)\r
{\r
Color c = Color.white;\r
-\r
+try{\r
if (cs != null)\r
- c = cs.findColour(seq, seq.getSequence(i, i + 1), i, av.getConsensus(false));\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
- // int threshold = 80;\r
-\r
while (i <= end && i < length)\r
{\r
color = color.white;\r
color = getResidueBoxColour(av.getGlobalColourScheme(), seq, i);\r
\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
-\r
if (color != currentColor || color != null)\r
{\r
g.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
cs = ap.av.getGlobalColourScheme();\r
\r
if(cs!=null)\r
- col = cs.findColour(null, aa, -1, null);\r
+ col = cs.findColour( aa, -1, null);\r
\r
button.setBackground( col );\r
oldColours.addElement( col );\r