From: amwaterhouse Date: Fri, 24 Mar 2006 15:24:53 +0000 (+0000) Subject: Has own featurerenderer X-Git-Tag: Root_VamJalview_2_07b+~25 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e3fa3dba06509ad60035bda6e4dbf006fac6ab54;p=jalview.git Has own featurerenderer --- diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 80b65ae..d702264 100755 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -73,6 +73,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe Vector highlightRes; boolean pdbAction = false; boolean seqColoursReady = false; + jalview.gui.FeatureRenderer fr; public PDBCanvas(jalview.gui.SeqCanvas seqcanvas, Sequence seq) { @@ -477,6 +478,16 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe void colourBySequence(PDBChain chain) { // System.out.println("colour by seq"); + boolean showFeatures = false; + if(seqcanvas.getViewport().getShowSequenceFeatures()) + { + showFeatures = true; + if (fr == null) + fr = new jalview.gui.FeatureRenderer(seqcanvas.getViewport()); + + fr.transferSettings( seqcanvas.getFeatureRenderer() ); + } + for (int i = 0; i < chain.bonds.size(); i++) { Bond tmp = (Bond) chain.bonds.elementAt(i); @@ -498,8 +509,8 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe if(tmp.startCol==null) tmp.startCol = Color.white; - tmp.startCol = seqcanvas.getFeatureRenderer(). - findFeatureColour(tmp.startCol, sequence, index); + if(showFeatures) + tmp.startCol = fr.findFeatureColour(tmp.startCol, sequence, index); } } @@ -515,19 +526,23 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe getResidueBoxColour( sequence, index); if(tmp.endCol==null) tmp.endCol = Color.white; - tmp.endCol = seqcanvas.getFeatureRenderer(). - findFeatureColour(tmp.endCol, sequence, index); + if(showFeatures) + tmp.endCol = fr.findFeatureColour(tmp.endCol, sequence, index); } } } } + Zsort zsort; public void drawScene(Graphics g) { if (zbuffer) { - Zsort.Zsort(visiblebonds); + if(zsort==null) + zsort = new Zsort(); + + zsort.Zsort(visiblebonds); } Bond tmpBond=null; @@ -550,7 +565,8 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe if (depthcue && !bymolecule) { - if (tmpBond.start[2] < (centre[2] - (maxwidth / 6))) { + if (tmpBond.start[2] < (centre[2] - (maxwidth / 6))) + { g.setColor(tmpBond.startCol.darker().darker()); drawLine(g, xstart, ystart, xmid, ymid); g.setColor(tmpBond.endCol.darker().darker());