X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBCanvas.java;h=6014455efd09eedd0a1e4345318ffb7506a415e7;hb=dfb45c8f874124d3ff3caac2902ed0c4a0e87cf5;hp=17db1a0b26059f5fce1386a0c44c5609f84ba94b;hpb=8893c2ac9824d4c566ae69c73d34889c5316b058;p=jalview.git diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 17db1a0..6014455 100755 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -72,6 +72,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe PDBChain mainchain; Vector highlightRes; boolean pdbAction = false; + boolean seqColoursReady = false; public PDBCanvas(jalview.gui.SeqCanvas seqcanvas, Sequence seq) { @@ -198,6 +199,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe Vector visiblebonds; void setupBonds() { + seqColoursReady = false; // Sort the bonds by z coord visiblebonds = new Vector(); @@ -215,6 +217,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe } updateSeqColours(); + seqColoursReady = true; redrawneeded = true; repaint(); } @@ -369,7 +372,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe { super.paintComponent(g); - if(visiblebonds==null) + if(!seqColoursReady) { g.setColor(Color.black); g.setFont(new Font("Verdana", Font.BOLD, 14)); @@ -929,6 +932,8 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe Bond highlightBond1, highlightBond2; public void highlightRes(int ii) { + if( !seqColoursReady ) + return; if (highlightRes != null && highlightRes.contains((ii-1) + ""))