\r
import java.util.*;\r
\r
-\r
/**\r
* DOCUMENT ME!\r
*\r
AlignViewport av;\r
SequenceGroup currentSequenceGroup = null;\r
SequenceGroup[] allGroups = null;\r
- Color resBoxColour;\r
Graphics graphics;\r
float transparency = .4f;\r
\r
// to be added, in the correct order or rendering\r
Vector featuresDisplayed;\r
\r
+ Color currentColour = null;\r
+\r
/**\r
* Creates a new FeatureRenderer object.\r
*\r
\r
}\r
\r
-boolean highlightTransparent = true;\r
+ boolean highlightTransparent = true;\r
/**\r
* DOCUMENT ME!\r
*\r
* @param width DOCUMENT ME!\r
* @param height DOCUMENT ME!\r
*/\r
- public void drawSequence(Graphics g, SequenceI seq, SequenceGroup[] sg,\r
+ public void drawSequence(Graphics g, SequenceI seq,\r
int start, int end, int x1, int y1, int width, int height)\r
{\r
\r
\r
if (fstart == fend)\r
{\r
- g.setColor(getColour(type));\r
+ currentColour = getColour(type);\r
+ g.setColor(currentColour);\r
g.fillRoundRect((fstart - start) * width, y1, width,\r
height, 4, 4);\r
g.setColor(Color.white);\r
{\r
continue;\r
}\r
+ currentColour = getColour(type);\r
+ g.setColor(currentColour);\r
\r
- g.setColor(getColour(type));\r
g.fillRect((i - start) * width, y1, width, height);\r
\r
g.setColor(Color.white);\r
}\r
}\r
\r
+\r
+ Image offscreen;\r
+ Frame nullframe;\r
+ public Color findFeatureColour(Color initialCol, SequenceI seq, int i)\r
+ {\r
+ currentColour = initialCol;\r
+ if(offscreen == null)\r
+ {\r
+ nullframe = new Frame();\r
+ nullframe.addNotify();\r
+ offscreen = nullframe.createImage(1, 1);\r
+ }\r
+\r
+ drawSequence(offscreen.getGraphics(), seq, i, i, 0, 0, 1, 1);\r
+ return currentColour;\r
+ }\r
+\r
+\r
+\r
public Color getColour(String featureType)\r
{\r
return (Color)featureColours.get(featureType);\r
// Can set different properties in this seqCanvas than\r
// main visible SeqCanvas\r
SequenceRenderer sr;\r
- //FeatureRenderer fr;\r
+ FeatureRenderer fr;\r
\r
\r
Frame nullFrame;\r
sr = new SequenceRenderer(av);\r
sr.graphics = nullFrame.getGraphics();\r
sr.renderGaps( false );\r
- //fr = new FeatureRenderer(av);\r
- //fr.transparency = ap.seqPanel.seqCanvas.getFeatureRenderer().transparency;\r
- //fr.featuresDisplayed = ap.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed;\r
-\r
+ fr = new FeatureRenderer(av);\r
+ fr.transparency = ap.seqPanel.seqCanvas.getFeatureRenderer().transparency;\r
+ fr.featuresDisplayed = ap.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed;\r
\r
\r
// scale the initial size of overviewpanel to shape of alignment\r
lastrow = (int)(row*sampleRow);\r
lastcol = (int)(col*sampleCol);\r
\r
- color = sr.findSequenceColour(av.alignment.getSequenceAt(lastrow), lastcol);\r
+ if(av.alignment.getSequenceAt(lastrow).getLength()>lastcol)\r
+ {\r
+ color = sr.findSequenceColour(av.alignment.getSequenceAt(lastrow), lastcol);\r
+\r
+ if (av.showSequenceFeatures)\r
+ color = fr.findFeatureColour(color,\r
+ av.alignment.getSequenceAt(lastrow),\r
+ lastcol);\r
+ }\r
+\r
\r
mg.setColor(color);\r
mg.fillRect(col,row,1,1);\r