X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqCanvas.java;h=42424d9dc8a4a30b95cd7f93905ec5d9e0385ec5;hb=eacce9627f059fc2f9e880c81d8d1bdfbe7fe5b3;hp=d1223642cded603bdff23d4294f8110a985f9acf;hpb=1f5534498699035da9074df97552e5094c4f750d;p=jalview.git diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index d122364..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) { @@ -615,7 +638,7 @@ public class SeqCanvas extends JComponent groupIndex = 0; } - if (group != null && !isOverview) + if (group != null) { do {