\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