public class FeatureRenderer\r
{\r
AlignViewport av;\r
- SequenceGroup currentSequenceGroup = null;\r
- SequenceGroup[] allGroups = null;\r
Color resBoxColour;\r
- Graphics graphics;\r
float transparency = 1.0f;\r
FontMetrics fm;\r
int charOffset;\r
\r
// The following vector holds the features which are\r
// to be added, in the correct order or rendering\r
- Vector featuresDisplayed;\r
+ Vector featuresDisplayed = null;\r
\r
/**\r
* Creates a new FeatureRenderer object.\r
* of the rendered sequence\r
*/\r
BufferedImage bi;\r
- public Color findFeatureColour(Color initialCol, SequenceI seq, int i)\r
+ public synchronized Color findFeatureColour(Color initialCol, SequenceI seq, int i)\r
{\r
if(!av.showSequenceFeatures)\r
return initialCol;\r
\r
- if(bi==null)\r
- bi = new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB);\r
+ if (bi == null)\r
+ bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);\r
+\r
+ bi.setRGB(0,0, initialCol.getRGB());\r
\r
drawText = false;\r
- bi.getGraphics().setColor(initialCol);\r
- bi.getGraphics().fillRect(0, 0, 1, 1);\r
drawSequence(bi.getGraphics(), seq, i, i, 0, 0, 1, 1);\r
drawText = true;\r
\r
int start, int end, int x1, int y1, int width, int height)\r
{\r
\r
+//System.out.println(start+" "+end+" "+x1+" "+y1);\r
if (seq.getDatasetSequence().getSequenceFeatures() == null\r
|| seq.getDatasetSequence().getSequenceFeatures().size()==0)\r
return;\r
// The feature table will display high priority\r
// features at the top, but theses are the ones\r
// we need to render last, so invert the data\r
- featuresDisplayed = new Vector();\r
+ featuresDisplayed.clear();\r
for(int i=data.length-1; i>-1; i--)\r
{\r
String type = data[i][0].toString();\r
if (bi == null)\r
bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);\r
\r
- bi.getGraphics().setColor(initialCol);\r
- bi.getGraphics().fillRect(0, 0, 1, 1);\r
- allGroups = av.alignment.findAllGroups(seq);\r
graphics = bi.getGraphics();\r
\r
+ bi.setRGB(0,0, initialCol.getRGB());\r
+\r
+ allGroups = av.alignment.findAllGroups(seq);\r
+\r
drawBoxes(seq, i,i, 0, 0, 1,1);\r
\r
return new Color(bi.getRGB(0, 0));\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
+ public synchronized void drawBoxes(SequenceI seq, int start, int end, int x1, int y1,\r
int width, int height)\r
{\r
int i = start;\r