X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqCanvas.java;h=42424d9dc8a4a30b95cd7f93905ec5d9e0385ec5;hb=32ce9ddb7ce1a68add53dd81785ae428ca136a83;hp=fd19721cd6055a48894f7ed1235e561fff547811;hpb=783520af519c958e10a2af29f1d4242e1ab890a3;p=jalview.git diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index fd19721..42424d9 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -48,8 +48,6 @@ public class SeqCanvas extends JComponent int LABEL_WEST; int LABEL_EAST; - boolean isOverview = false; - /** * Creates a new SeqCanvas object. * @@ -65,11 +63,28 @@ public class SeqCanvas extends JComponent setBackground(Color.white); } + MCview.PDBCanvas pdbCanvas; + public SequenceRenderer getSequenceRenderer() + { + return sr; + } + public FeatureRenderer getFeatureRenderer() { return fr; } + public void setPDBCanvas(MCview.PDBCanvas pc) + { + pdbCanvas = pc; + } + + public AlignViewport getViewport() + { + return av; + } + + /** * DOCUMENT ME! * @@ -264,18 +279,20 @@ public class SeqCanvas extends JComponent // Set this to false to force a full panel paint public void paintComponent(Graphics g) { + super.paintComponent(g); + sr.renderGaps(av.renderGaps); - if ((img != null) && - (fastPaint || (getWidth() != g.getClipBounds().width) || - (getHeight() != g.getClipBounds().height))) + if ( img != null && (fastPaint + || (getVisibleRect().width != g.getClipBounds().width) + || (getVisibleRect().height != g.getClipBounds().height))) { g.drawImage(img, 0, 0, this); fastPaint = false; - return; } + // this draws the whole of the alignment imgWidth = getWidth(); imgHeight = getHeight(); @@ -288,7 +305,6 @@ public class SeqCanvas extends JComponent return; } - img = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB); gg = (Graphics2D) img.getGraphics(); gg.setFont(av.getFont()); @@ -310,6 +326,12 @@ public class SeqCanvas extends JComponent } g.drawImage(img, 0, 0, this); + + if (pdbCanvas != null) + { + pdbCanvas.updateSeqColours(); + } + } /** @@ -516,6 +538,7 @@ public class SeqCanvas extends JComponent repaint(); } + synchronized public void drawPanel(Graphics g1, int x1, int x2, int y1, int y2, int startx, int starty, int offset) { @@ -577,7 +600,6 @@ public class SeqCanvas extends JComponent offset + ( (i - starty) * av.charHeight), av.charWidth, aaHeight); - /* if(av.getShowTranslation()) { av.setGlobalColourScheme(new NucleotideColourScheme()); @@ -592,8 +614,7 @@ public class SeqCanvas extends JComponent if (av.showSequenceFeatures) { - fr.drawSequence(g, nextSeq, - av.alignment.findAllGroups(nextSeq), x1, x2, + fr.drawSequence(g, nextSeq, x1, x2, (x1 - startx) * av.charWidth, offset + ((i - starty) * av.charHeight), av.charWidth, av.charHeight); @@ -617,7 +638,7 @@ public class SeqCanvas extends JComponent groupIndex = 0; } - if (group != null && !isOverview) + if (group != null) { do {