X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FOverviewPanel.java;h=3662ec298f88f3d1b8293faf61951b5f37b92c3e;hb=43a9f559bb49f579ce153c812052c149963a99de;hp=7086a5123a712b6b36693a386c50ba24c5af088c;hpb=8878681ec11f85c050248236a96ffbcaf2f0497b;p=jalview.git diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 7086a51..3662ec2 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -49,7 +49,8 @@ public class OverviewPanel extends JPanel implements Runnable // Can set different properties in this seqCanvas than // main visible SeqCanvas - SeqCanvas overviewSeq; + SequenceRenderer sr; + FeatureRenderer fr; /** * Creates a new OverviewPanel object. @@ -62,14 +63,16 @@ public class OverviewPanel extends JPanel implements Runnable this.ap = ap; setLayout(null); - overviewSeq = new SeqCanvas(av); - overviewSeq.isOverview = true; - overviewSeq.sr.renderGaps = false; + sr = new SequenceRenderer(av); + sr.renderGaps( false ); + fr = new FeatureRenderer(av); + fr.transparency = ap.seqPanel.seqCanvas.getFeatureRenderer().transparency; + fr.featuresDisplayed = ap.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed; // scale the initial size of overviewpanel to shape of alignment float initialScale = (float) av.alignment.getWidth() / (float) av.alignment.getHeight(); - if(av.vconsensus==null) + if(av.conservation==null) graphHeight = 0; @@ -109,6 +112,7 @@ public class OverviewPanel extends JPanel implements Runnable { public void mouseDragged(MouseEvent evt) { + if(!av.wrapAlignment) doMouseDragged(evt); } }); @@ -117,11 +121,13 @@ public class OverviewPanel extends JPanel implements Runnable { public void mousePressed(MouseEvent evt) { + if(!av.wrapAlignment) doMousePressed(evt); } public void mouseReleased(MouseEvent evt) { + if(!av.wrapAlignment) doMouseReleased(evt); } }); @@ -254,34 +260,50 @@ public class OverviewPanel extends JPanel implements Runnable Graphics mg = miniMe.getGraphics(); + mg.setColor(Color.orange); + mg.fillRect(0,0,width, miniMe.getHeight()); float sampleCol = (float) alwidth / (float) width; float sampleRow = (float) alheight / (float) sequencesHeight; + int lastcol=-1, lastrow=-1; + Color color = Color.white; for (int col = 0; col < width; col++) { for (int row = 0; row < sequencesHeight; row++) { - overviewSeq.drawPanel(mg, - (int) (col * sampleCol), - (int) (col * sampleCol), - (int) (row * sampleRow), - (int) (row * sampleRow) + 1, - (int) (col * sampleCol), - (int) (row * sampleRow), 0); - mg.translate(0, 1); + if((int)(col*sampleCol) == lastcol && (int)(row*sampleRow)==lastrow) + { + miniMe.setRGB(col,row,color.getRGB()); + continue; + } + + lastrow = (int)(row*sampleRow); + lastcol = (int)(col*sampleCol); + + color = sr.getResidueBoxColour( + av.alignment.getSequenceAt(lastrow), lastcol); + + if(av.showSequenceFeatures) + { + color = fr.findFeatureColour(color, + av.alignment.getSequenceAt(lastrow), + lastcol); + } + + miniMe.setRGB(col,row,color.getRGB()); if (av.conservation != null) + { + mg.translate(col, sequencesHeight); ap.annotationPanel.drawGraph(mg, av.conservation, (int) (sampleCol) + 1, graphHeight, (int) (col * sampleCol), (int) (col * sampleCol) + 1); - + mg.translate(-col, -sequencesHeight); + } } - mg.translate(0, -sequencesHeight); - mg.translate(1, 0); - } System.gc();