public class SequenceRenderer implements RendererI\r
{\r
FontMetrics fm;\r
- AlignViewport av;\r
\r
public Color getResidueBoxColour(ColourSchemeI cs, SequenceI seq, int i) {\r
- Color c = Color.WHITE;\r
-\r
- try{\r
- if (cs != null)\r
- c = cs.findColour(seq, seq.getSequence(i, i + 1), i, null);\r
- }catch(Exception ex)\r
- { }\r
\r
+ Color c = cs.findColour(seq, seq.getSequence(i, i + 1), i, null);\r
return c;\r
+\r
}\r
\r
- public void drawSequence(Graphics g,ColourSchemeI cs,SequenceI seq,int start, int end, int x1, int y1, double width, int height,boolean showScores, boolean displayBoxes, boolean displayText,Vector freq, int seqnum,AlignViewport av) {\r
\r
- this.av = av;\r
+ public void drawSequence(Graphics g,ColourSchemeI cs,SequenceI seq,int start, int end, int x1, int y1, double width, int height,boolean showScores, boolean displayBoxes, boolean displayText, boolean colourText,Vector freq, int seqnum) {\r
\r
- if (displayBoxes == true) {\r
+\r
+ if (displayBoxes)\r
drawBoxes(g,cs,seq,start,end,x1,y1,(int)width, height,freq);\r
- }\r
- if (displayText == true) {\r
+\r
+ if (displayText)\r
+ {\r
fm = g.getFontMetrics();\r
- drawText(g,cs,seq,start,end,x1,y1,(int)width,height);\r
+ drawText(g,cs,colourText,seq,start,end,x1,y1,(int)width,height);\r
}\r
}\r
\r
g.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
}\r
\r
- public void drawText(Graphics g, ColourSchemeI cs, SequenceI seq,int start, int end, int x1, int y1, int width, int height)\r
+ public void drawText(Graphics g, ColourSchemeI cs, boolean colText, SequenceI seq,int start, int end, int x1, int y1, int width, int height)\r
{\r
int pady = height/5;\r
int charOffset=0;\r
g.setColor(Color.black);\r
- boolean colourText = av.getColourText();\r
- Color c;\r
+\r
char s;\r
// Need to find the sequence position here.\r
for (int i = start; i <= end; i++)\r
else\r
s = ' ';\r
\r
- if (colourText)\r
+ if (colText)\r
{\r
- c = getResidueBoxColour(cs, seq, i);\r
+ Color c = getResidueBoxColour(cs, seq, i);\r
g.setColor(c.darker());\r
}\r
\r