From b76229ec7f87020dfb2c26b11d910899f8b2c97d Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 8 Dec 2005 12:04:29 +0000 Subject: [PATCH] SeqColoursReady boolean added --- src/MCview/AppletPDBCanvas.java | 5 ++++- src/MCview/PDBCanvas.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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)); -- 1.7.10.2