From a4d934a390625eaa414656a6dc356acd7236e7b0 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 24 Mar 2006 16:28:29 +0000 Subject: [PATCH] Has its own featureRenderer --- src/MCview/AppletPDBCanvas.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index 2a452b2..107d98d 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -77,6 +77,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion Bond highlightBond1, highlightBond2; boolean errorLoading = false; boolean seqColoursReady = false; + jalview.appletgui.FeatureRenderer fr; public AppletPDBCanvas(jalview.appletgui.SeqCanvas seqcanvas, Sequence seq) { @@ -479,6 +480,18 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion // Applet and Application specific sequence renderers to be used void colourBySequence(PDBChain chain) { + boolean showFeatures = false; + + if(seqcanvas.getViewport().getShowSequenceFeatures()) + { + if(fr==null) + { + fr = new jalview.appletgui.FeatureRenderer(seqcanvas.getViewport()); + } + fr.transferSettings( seqcanvas.getFeatureRenderer()); + showFeatures = true; + } + for (int i = 0; i < chain.bonds.size(); i++) { Bond tmp = (Bond) chain.bonds.elementAt(i); @@ -498,8 +511,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion tmp.startCol = seqcanvas.getSequenceRenderer(). getResidueBoxColour( sequence, index); - tmp.startCol = seqcanvas.getFeatureRenderer(). - findFeatureColour(tmp.startCol, sequence, index); + if(showFeatures) + tmp.startCol = fr.findFeatureColour(tmp.startCol, sequence, index); } } @@ -509,8 +522,9 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion { tmp.endCol = seqcanvas.getSequenceRenderer(). getResidueBoxColour( sequence, index); - tmp.endCol = seqcanvas.getFeatureRenderer(). - findFeatureColour(tmp.endCol, sequence, index); + + if(showFeatures) + tmp.endCol = fr.findFeatureColour(tmp.endCol, sequence, index); } } } -- 1.7.10.2