int chunkWidth;\r
\r
Graphics debugG;\r
- FeatureRenderer fr = new FeatureRenderer();\r
- BlockRenderer br = new BlockRenderer();\r
- CpGRenderer cgr = new CpGRenderer();\r
+ // FeatureRenderer fr = new FeatureRenderer();\r
+ // BlockRenderer br = new BlockRenderer();\r
+ // CpGRenderer cgr = new CpGRenderer();\r
\r
ColourSchemeI cs = new ZappoColourScheme();\r
\r
if (oldendx == -1) {\r
fillBackground(gg,Color.WHITE,0,0,imgWidth,imgHeight);\r
\r
- /* if (av.getWrapAlignment() == true) {\r
+ if (av.getWrapAlignment()) {\r
startx = (int)(offy/chunkWidth)*chunkWidth;\r
endx = startx + chunkWidth;\r
starty = offy%chunkHeight;\r
}\r
\r
}\r
- } else*/ {\r
+ }\r
+ else\r
+ {\r
drawPanel(gg,startx,endx,starty,endy,startx,starty,0);\r
\r
oldstartx = startx;\r
}\r
\r
\r
+ gg.setColor(Color.red);\r
+ gg.drawRect( groupX, groupY, groupendX-groupX, groupendY-groupY );\r
+ gg.drawRect( groupX+1, groupY+1, groupendX-groupX-2, groupendY-groupY-2 );\r
+\r
+\r
g.drawImage(img,0,0,this);\r
\r
}\r
\r
\r
/*Vector pid = av.getConsensus(false);\r
-\r
Vector tmpseq = new Vector();\r
-\r
for (int i = 0; i < av.getAlignment().getHeight(); i++)\r
if (!av.getSelection().contains(av.getAlignment().getSequenceAt(i)))\r
tmpseq.addElement(av.getAlignment().getSequenceAt(i));\r
\r
-\r
-\r
if (sr instanceof SequenceRenderer)\r
pid = AAFrequency.calculate(tmpseq,x1,x2);\r
\r
\r
*/\r
\r
- if (y2 > starty && y1 < av.getEndSeq()) {\r
-\r
- fillBackground(g,\r
- Color.white,\r
+ if (y2 > starty && y1 < av.getEndSeq())\r
+ {\r
+ fillBackground(g,\r
+ Color.WHITE,\r
(int)((x1-startx)*charWidth),\r
offset + AlignmentUtil.getPixelHeight(starty,y1,av.getCharHeight()),\r
(int)((x2-x1+1)*charWidth),\r
offset + AlignmentUtil.getPixelHeight(y1,y2,av.getCharHeight()));\r
}\r
\r
- for (int i = y1 ; i < y2 ;i++) {\r
-\r
+ SequenceI nextSeq;\r
+ SequenceGroup group;\r
+ for (int i = y1 ; i < y2 ;i++)\r
+ {\r
RendererI r = sr;\r
-/*\r
- if (av.getSelection().contains(av.getAlignment().getSequenceAt(i))) {\r
+ /* if (av.getSelection().contains(av.getAlignment().getSequenceAt(i))) {\r
r = fr;\r
System.out.println("use feature renderer");\r
} else if ( i == 0) {\r
System.out.println("cg renderer");\r
}\r
*/\r
-\r
- r.drawSequence(g,cs,av.getAlignment().getSequenceAt(i),\r
+ nextSeq = av.getAlignment().getSequenceAt(i);\r
+ group = av.alignment.findGroup( nextSeq );\r
+ if( group!=null )\r
+ {\r
+ r.drawSequence(g, group.cs, nextSeq,\r
x1,\r
x2,\r
- (int)((x1-startx)*charWidth),\r
- offset + AlignmentUtil.getPixelHeight(starty,i,av.getCharHeight()),\r
- charWidth,\r
- charHeight,showScores,av.getShowBoxes(),av.getShowText(),null,i,av);\r
+ (int) ( (x1 - startx) * charWidth),\r
+ offset + AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()),\r
+ charWidth, charHeight,\r
+ false, group.getDisplayBoxes(), group.getDisplayText(), group.getColourText(),\r
+ null, i);\r
+ }\r
+ else\r
+ {\r
+ r.drawSequence(g, cs, nextSeq,\r
+ x1,\r
+ x2,\r
+ (int) ( (x1 - startx) * charWidth),\r
+ offset + AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()),\r
+ charWidth,charHeight,\r
+ showScores, av.getShowBoxes(), av.getShowText(), av.getColourText(),\r
+ null, i);\r
+\r
+ }\r
+\r
\r
}\r
+\r
}\r
\r
+ public int groupX, groupY, groupendX, groupendY;\r
\r
\r
public void fillBackground(Graphics g,Color c, int x1,int y1,int width,int height) {\r