From: amwaterhouse Date: Wed, 30 Nov 2005 15:36:19 +0000 (+0000) Subject: REpaint after sequence col selected X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d406dae9bb29125d7a7017e4eb6e2e45ba47135b;p=jalview.git REpaint after sequence col selected --- diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index bdef555..f0b7514 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -202,6 +202,9 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion } } } + updateSeqColours(); + redrawneeded = true; + repaint(); } @@ -967,9 +970,6 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion mainchain.isVisible = true; findCentre(); setupBonds(); - redrawneeded = true; - repaint(); - } } diff --git a/src/MCview/AppletPDBViewer.java b/src/MCview/AppletPDBViewer.java index 3f4e42c..8598c8d 100755 --- a/src/MCview/AppletPDBViewer.java +++ b/src/MCview/AppletPDBViewer.java @@ -207,6 +207,7 @@ public class AppletPDBViewer extends Frame clearButtonGroup(); pdbcanvas.bysequence = true; pdbcanvas.updateSeqColours(); + pdbcanvas.repaint(); } void clearButtonGroup() diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index f853106..70f959f 100755 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -189,8 +189,6 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe scale = findScale(); - - updateSeqColours(); ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().setInitialDelay(0); ToolTipManager.sharedInstance().setDismissDelay(10000); @@ -215,6 +213,10 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe } } } + + updateSeqColours(); + redrawneeded = true; + repaint(); } @@ -430,7 +432,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe { for (int ii = 0; ii < pdb.chains.size(); ii++) { - colourBySequence( mainchain ); + colourBySequence( (PDBChain) pdb.chains.elementAt(ii)); } } @@ -478,6 +480,9 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe tmp.startCol = Color.lightGray; tmp.endCol = Color.lightGray; + if(chain!=mainchain) + continue; + if ( (tmp.at1.resNumber >= ( (chain.offset + chain.pdbstart) - 1)) && (tmp.at1.resNumber <= ( (chain.offset + chain.pdbend) - 1))) { @@ -513,8 +518,6 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe public void drawScene(Graphics g) { - - if (zbuffer) { Zsort.Zsort(visiblebonds); @@ -543,7 +546,6 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe 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()); drawLine(g, xmid, ymid, xend, yend); } else if (tmpBond.start[2] < (centre[2] + (maxwidth / 6))) { @@ -976,7 +978,5 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe mainchain.isVisible = true; findCentre(); setupBonds(); - redrawneeded = true; - repaint(); } } diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index 47aa5ac..b3e4e28 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -105,8 +105,8 @@ public class PDBfile extends jalview.io.FileParse { Atom tmpatom = new Atom(line); //Jalview is only interested in CA bonds???? - // if(!tmpatom.name.equals("CA")) - // continue; + if(!tmpatom.name.equals("CA")) + continue; tmpchain = findChain(tmpatom.chain); if ( tmpchain != null)