X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqCanvas.java;h=42424d9dc8a4a30b95cd7f93905ec5d9e0385ec5;hb=32ce9ddb7ce1a68add53dd81785ae428ca136a83;hp=c3972ee7e229cb3478d54f2b5590e4238d95cf0a;hpb=e69437d3308e865d0d651461d44dfa63cffab746;p=jalview.git diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index c3972ee..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,7 +63,7 @@ public class SeqCanvas extends JComponent setBackground(Color.white); } - MCview.PDBCanvas pdbViewer; + MCview.PDBCanvas pdbCanvas; public SequenceRenderer getSequenceRenderer() { return sr; @@ -76,11 +74,17 @@ public class SeqCanvas extends JComponent return fr; } - public void setPDBViewer(MCview.PDBCanvas pc) + public void setPDBCanvas(MCview.PDBCanvas pc) + { + pdbCanvas = pc; + } + + public AlignViewport getViewport() { - pdbViewer = pc; + return av; } + /** * DOCUMENT ME! * @@ -275,17 +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(); @@ -298,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()); @@ -321,9 +327,9 @@ public class SeqCanvas extends JComponent g.drawImage(img, 0, 0, this); - if (pdbViewer != null) + if (pdbCanvas != null) { - pdbViewer.updateSeqColours(); + pdbCanvas.updateSeqColours(); } } @@ -632,7 +638,7 @@ public class SeqCanvas extends JComponent groupIndex = 0; } - if (group != null && !isOverview) + if (group != null) { do {