\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
+ sr.forOverview = true;\r
+ fr = new FeatureRenderer(av);\r
+ fr.overview = true;\r
+\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
- if(av.vconsensus==null)\r
+ if(av.conservation==null)\r
graphHeight = 0;\r
\r
\r
{\r
public void mouseDragged(MouseEvent evt)\r
{\r
+ if(!av.wrapAlignment)\r
doMouseDragged(evt);\r
}\r
});\r
{\r
public void mousePressed(MouseEvent evt)\r
{\r
+ if(!av.wrapAlignment)\r
doMousePressed(evt);\r
}\r
\r
public void mouseReleased(MouseEvent evt)\r
{\r
+ if(!av.wrapAlignment)\r
doMouseReleased(evt);\r
}\r
});\r
{\r
miniMe = null;\r
\r
+ if (av.showSequenceFeatures)\r
+ {\r
+ fr.featureGroups = ap.seqPanel.seqCanvas.getFeatureRenderer().featureGroups;\r
+ fr.featureColours = ap.seqPanel.seqCanvas.getFeatureRenderer().featureColours;\r
+ fr.transparency = ap.seqPanel.seqCanvas.getFeatureRenderer().transparency;\r
+ fr.sequenceFeatures = ap.seqPanel.seqCanvas.getFeatureRenderer().sequenceFeatures;\r
+ }\r
+\r
int alwidth = av.alignment.getWidth();\r
int alheight = av.alignment.getHeight();\r
\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
- for (int col = 0; col < width; col++)\r
+ int lastcol=-1, lastrow=-1;\r
+ int color = Color.white.getRGB();\r
+ int row, col;\r
+ for (row = 0; row < sequencesHeight; row++)\r
+ {\r
+ for (col = 0; col < width; col++)\r
+ {\r
+ if((int)(col*sampleCol) == lastcol && (int)(row*sampleRow)==lastrow)\r
+ {\r
+ miniMe.setRGB(col,row,color);\r
+ continue;\r
+ }\r
+\r
+ lastrow = (int)(row*sampleRow);\r
+ lastcol = (int)(col*sampleCol);\r
+\r
+ if(av.alignment.getSequenceAt(lastrow).getLength()>lastcol)\r
+ {\r
+ color = sr.getResidueBoxColour(\r
+ av.alignment.getSequenceAt(lastrow), lastcol).getRGB();\r
+\r
+ if(av.showSequenceFeatures)\r
+ color = fr.findFeatureColour(color, lastrow, lastcol);\r
+\r
+ }\r
+ else\r
+ {\r
+ color = -1; //White\r
+ }\r
+\r
+ miniMe.setRGB(col,row,color);\r
+\r
+\r
+ }\r
+ }\r
+\r
+ if (av.conservation != null)\r
{\r
- for (int row = 0; row < sequencesHeight; row++)\r
+ for (col = 0; col < width; col++)\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
-\r
- if (av.conservation != null)\r
+ lastcol = (int) (col * sampleCol);\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