\r
// Can set different properties in this seqCanvas than\r
// main visible SeqCanvas\r
- SeqCanvas overviewSeq;\r
+ SequenceRenderer sr;\r
+ //FeatureRenderer fr;\r
\r
\r
Frame nullFrame;\r
nullFrame = new Frame();\r
nullFrame.addNotify();\r
\r
- overviewSeq = new SeqCanvas(av);\r
- overviewSeq.isOverview = true;\r
- overviewSeq.sr.renderGaps = false;\r
+\r
+ sr = new SequenceRenderer(av);\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
\r
\r
// scale the initial size of overviewpanel to shape of alignment\r
float sampleCol = (float) alwidth / (float) width;\r
float sampleRow = (float) alheight / (float) sequencesHeight;\r
\r
+ int lastcol=-1, lastrow=-1;\r
+ Color color = Color.white;\r
for (int col = 0; col < width; col++)\r
{\r
for (int row = 0; row < sequencesHeight; row++)\r
{\r
- overviewSeq.drawPanel(mg,\r
- (int) (col * sampleCol),\r
- (int) (col * sampleCol),\r
- (int) (row * sampleRow),\r
- (int) (row * sampleRow) + 1,\r
- (int) (col * sampleCol),\r
- (int) (row * sampleRow), 0);\r
- mg.translate(0, 1);\r
+ if((int)(col*sampleCol) == lastcol && (int)(row*sampleRow)==lastrow)\r
+ {\r
+ mg.setColor(color);\r
+ mg.fillRect(col,row,1,1);\r
+ continue;\r
+ }\r
+\r
+ lastrow = (int)(row*sampleRow);\r
+ lastcol = (int)(col*sampleCol);\r
+\r
+ color = sr.findSequenceColour(av.alignment.getSequenceAt(lastrow), lastcol);\r
+\r
+ mg.setColor(color);\r
+ mg.fillRect(col,row,1,1);\r
\r
if (av.conservation != null)\r
+ {\r
+ mg.translate(col, sequencesHeight);\r
ap.annotationPanel.drawGraph(mg, av.conservation,\r
(int) (sampleCol) + 1,\r
graphHeight,\r
(int) (col * sampleCol),\r
(int) (col * sampleCol) + 1);\r
-\r
+ mg.translate(-col, -sequencesHeight);\r
+ }\r
}\r
- mg.translate(0, -sequencesHeight);\r
- mg.translate(1, 0);\r
+ }\r
\r
- }\r
System.gc();\r
\r
resizing = false;\r
\r
// Can set different properties in this seqCanvas than\r
// main visible SeqCanvas\r
- SeqCanvas overviewSeq;\r
+ SequenceRenderer sr;\r
+ FeatureRenderer fr;\r
\r
/**\r
* Creates a new OverviewPanel object.\r
this.ap = ap;\r
setLayout(null);\r
\r
- overviewSeq = new SeqCanvas(av);\r
- overviewSeq.isOverview = true;\r
- overviewSeq.sr.renderGaps = false;\r
+ sr = new SequenceRenderer(av);\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
// scale the initial size of overviewpanel to shape of alignment\r
float initialScale = (float) av.alignment.getWidth() / (float) av.alignment.getHeight();\r
\r
\r
Graphics mg = miniMe.getGraphics();\r
+ mg.setColor(Color.orange);\r
+ mg.fillRect(0,0,width, miniMe.getHeight());\r
\r
float sampleCol = (float) alwidth / (float) width;\r
float sampleRow = (float) alheight / (float) sequencesHeight;\r
\r
+ int lastcol=-1, lastrow=-1;\r
+ Color color = Color.white;\r
for (int col = 0; col < width; col++)\r
{\r
for (int row = 0; row < sequencesHeight; row++)\r
{\r
- overviewSeq.drawPanel(mg,\r
- (int) (col * sampleCol),\r
- (int) (col * sampleCol),\r
- (int) (row * sampleRow),\r
- (int) (row * sampleRow) + 1,\r
- (int) (col * sampleCol),\r
- (int) (row * sampleRow), 0);\r
- mg.translate(0, 1);\r
+ if((int)(col*sampleCol) == lastcol && (int)(row*sampleRow)==lastrow)\r
+ {\r
+ miniMe.setRGB(col,row,color.getRGB());\r
+ continue;\r
+ }\r
+\r
+ lastrow = (int)(row*sampleRow);\r
+ lastcol = (int)(col*sampleCol);\r
+\r
+ color = sr.findSequenceColour(Color.white,\r
+ av.alignment.getSequenceAt(lastrow), lastcol);\r
+\r
+ if(av.showSequenceFeatures)\r
+ {\r
+ color = fr.findFeatureColour(color,\r
+ av.alignment.getSequenceAt(lastrow),\r
+ lastcol);\r
+ }\r
+\r
+ miniMe.setRGB(col,row,color.getRGB());\r
\r
if (av.conservation != null)\r
+ {\r
+ mg.translate(col, sequencesHeight);\r
ap.annotationPanel.drawGraph(mg, av.conservation,\r
(int) (sampleCol) + 1,\r
graphHeight,\r
(int) (col * sampleCol),\r
(int) (col * sampleCol) + 1);\r
-\r
+ mg.translate(-col, -sequencesHeight);\r
+ }\r
}\r
- mg.translate(0, -sequencesHeight);\r
- mg.translate(1, 0);\r
-\r
}\r
\r
System.gc();\r