- }\r
-\r
- public void drawBoxes(Graphics g,ColourSchemeI cs, SequenceI seq,int start, int end, int x1, int y1, int width, int height,Vector freq) {\r
- int i = start;\r
- int length = seq.getLength();\r
-\r
- Color currentColor = Color.WHITE;\r
-\r
- int curStart = x1;\r
- int curWidth = width;\r
-\r
- // int threshold = 80;\r
-\r
- while (i <= end && i < length) {\r
- Color c = getResidueBoxColour(cs,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
-\r
- if (c != currentColor || c != null)\r
- {\r
- g.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
-\r
- currentColor = c;\r
- g.setColor(c);\r
-\r
- curStart = i;\r
- curWidth = width;\r
- }\r
- else\r
- curWidth += width;\r
-\r
- i++;\r
+\r
+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param seq DOCUMENT ME!\r
+ * @param start DOCUMENT ME!\r
+ * @param end DOCUMENT ME!\r
+ * @param x1 DOCUMENT ME!\r
+ * @param y1 DOCUMENT ME!\r
+ * @param width DOCUMENT ME!\r
+ * @param height DOCUMENT ME!\r
+ */\r
+ public void drawBoxes(SequenceI seq, int start, int end, int x1, int y1,\r
+ int width, int height)\r
+ {\r
+ int i = start;\r
+ int length = seq.getLength();\r
+\r
+ int curStart = -1;\r
+ int curWidth = width;\r
+\r
+ Color tempColour = null;\r
+\r
+ while (i <= end)\r
+ {\r
+ resBoxColour = Color.white;\r
+\r
+ if (i < length)\r
+ {\r
+ if (inCurrentSequenceGroup(i))\r
+ {\r
+ if (currentSequenceGroup.getDisplayBoxes())\r
+ {\r
+ getBoxColour(currentSequenceGroup.cs, seq, i);\r
+ }\r
+ }\r
+ else if (av.getShowBoxes())\r
+ {\r
+ getBoxColour(av.getGlobalColourScheme(), seq, i);\r
+ }\r
+\r
+ }\r
+\r
+ if (resBoxColour != tempColour)\r
+ {\r
+ if (tempColour != null)\r
+ {\r
+ int xxx = x1 + (int) (av.charWidth * (curStart - start));\r
+ if (width != av.charWidth)\r
+ {\r
+ xxx = x1 + (int) (av.charWidth * (curStart - start)) / 3;\r
+ }\r
+\r
+\r
+ graphics.fillRect(xxx, y1,\r
+ curWidth, height);\r
+ }\r
+\r
+ graphics.setColor(resBoxColour);\r
+\r
+ curStart = i;\r
+ curWidth = width;\r
+ tempColour = resBoxColour;\r
+ }\r
+ else\r
+ {\r
+ curWidth += width;\r
+ }\r
+\r
+ i++;\r
+ }\r
+\r
+ int xxx = x1 + (int) (av.charWidth * (curStart - start));\r
+ if (width != av.charWidth)\r
+ {\r
+ xxx = x1 + (int) (av.charWidth * (curStart - start)) / 3;\r
+ }\r
+\r
+\r
+ graphics.fillRect(xxx, y1, curWidth,\r
+ height);\r