From: amwaterhouse Date: Thu, 8 Dec 2005 12:04:29 +0000 (+0000) Subject: SeqColoursReady boolean added X-Git-Tag: Release_2_07~32 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b76229ec7f87020dfb2c26b11d910899f8b2c97d;p=jalview.git SeqColoursReady boolean added --- diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index d6247f4..346ae1e 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -76,6 +76,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion boolean pdbAction = false; Bond highlightBond1, highlightBond2; boolean errorLoading = false; + boolean seqColoursReady = false; public AppletPDBCanvas(jalview.appletgui.SeqCanvas seqcanvas, Sequence seq) { @@ -186,6 +187,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion Vector visiblebonds; void setupBonds() { + seqColoursReady = false; // Sort the bonds by z coord visiblebonds = new Vector(); @@ -202,6 +204,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion } } updateSeqColours(); + seqColoursReady = true; redrawneeded = true; repaint(); } @@ -360,7 +363,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion g.drawString("Error loading PDB data!!", 50, getSize().height/2); return; } - else if(visiblebonds==null) + else if( !seqColoursReady ) { g.setColor(Color.black); g.setFont(new Font("Verdana", Font.BOLD, 14)); diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 17db1a0..d5af60f 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));