+++ /dev/null
-/*\r
-* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
-*\r
-* This program is free software; you can redistribute it and/or\r
-* modify it under the terms of the GNU General Public License\r
-* as published by the Free Software Foundation; either version 2\r
-* of the License, or (at your option) any later version.\r
-*\r
-* This program is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-*\r
-* You should have received a copy of the GNU General Public License\r
-* along with this program; if not, write to the Free Software\r
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
-*/\r
-package MCview;\r
-\r
-import jalview.analysis.AlignSeq;\r
-\r
-import jalview.datamodel.*;\r
-\r
-// JBPNote TODO: This class is quite noisy - needs proper log.info/log.debug\r
-import java.awt.*;\r
-import java.awt.event.*;\r
-\r
-import java.io.*;\r
-\r
-import java.util.*;\r
-\r
-import javax.swing.*;\r
-\r
-\r
-public class rotCanvas extends JPanel implements KeyListener, MouseListener,\r
- MouseMotionListener {\r
- MCMatrix idmat = new MCMatrix(3, 3);\r
- MCMatrix objmat = new MCMatrix(3, 3);\r
- boolean redrawneeded = true;\r
- int omx = 0;\r
- int mx = 0;\r
- int omy = 0;\r
- int my = 0;\r
- public PDBfile pdb;\r
- int bsize;\r
- Image img;\r
- Graphics ig;\r
- Dimension prefsize;\r
- float[] centre = new float[3];\r
- float[] width = new float[3];\r
- float maxwidth;\r
- float scale;\r
- String inStr;\r
- String inType;\r
- boolean depthcue = true;\r
- boolean wire = false;\r
- boolean bymolecule = false;\r
- boolean zbuffer = true;\r
- boolean dragging;\r
- int xstart;\r
- int xend;\r
- int ystart;\r
- int yend;\r
- int xmid;\r
- int ymid;\r
- Font font = new Font("Helvetica", Font.PLAIN, 10);\r
-\r
- public rotCanvas(PDBfile pdb, Sequence sequence,\r
- jalview.gui.AlignViewport av) throws IOException {\r
- int max = -10;\r
- int maxchain = -1;\r
- int pdbstart = 0;\r
- int pdbend = 0;\r
- int seqstart = 0;\r
- int seqend = 0;\r
-\r
- for (int i = 0; i < pdb.chains.size(); i++) {\r
- // Now lets compare the sequences to get\r
- // the start and end points.\r
- java.util.StringTokenizer str = new java.util.StringTokenizer(sequence.getSequence(),\r
- ".");\r
- String newString = "";\r
-\r
- while (str.hasMoreTokens()) {\r
- newString += str.nextToken();\r
- }\r
-\r
- // Align the sequence to the pdb\r
- AlignSeq as = new AlignSeq(sequence,\r
- ((PDBChain) pdb.chains.elementAt(i)).sequence, "pep");\r
- as.calcScoreMatrix();\r
- as.traceAlignment();\r
- as.printAlignment();\r
-\r
- if (as.maxscore > max) {\r
- max = as.maxscore;\r
- maxchain = i;\r
-\r
- pdbstart = as.seq2start;\r
- pdbend = as.seq2end;\r
- seqstart = as.seq1start - 1;\r
- seqend = as.seq1end - 1;\r
- }\r
-\r
- System.out.println("PDB start/end " + pdbstart + " " + pdbend);\r
- System.out.println("SEQ start/end " + seqstart + " " + seqend);\r
- }\r
-\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).pdbstart = pdbstart;\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).pdbend = pdbend;\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).seqstart = seqstart;\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).seqend = seqend;\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).isVisible = true;\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).sequence = sequence;\r
- ((PDBChain) pdb.chains.elementAt(maxchain)).colourBySequence(av,\r
- sequence);\r
-\r
- this.pdb = pdb;\r
- this.prefsize = new Dimension(getWidth(), getHeight());\r
-\r
- //Initialize the matrices to identity\r
- for (int i = 0; i < 3; i++) {\r
- for (int j = 0; j < 3; j++) {\r
- if (i != j) {\r
- idmat.addElement(i, j, 0);\r
- objmat.addElement(i, j, 0);\r
- } else {\r
- idmat.addElement(i, j, 1);\r
- objmat.addElement(i, j, 1);\r
- }\r
- }\r
- }\r
-\r
- addMouseMotionListener(this);\r
- addMouseListener(this);\r
- addKeyListener(this);\r
-\r
- addPDBfile();\r
- ToolTipManager.sharedInstance().registerComponent(this);\r
- ToolTipManager.sharedInstance().setInitialDelay(0);\r
- ToolTipManager.sharedInstance().setDismissDelay(10000);\r
-\r
- }\r
-\r
- public void addPDBfile() {\r
- findCentre();\r
- findWidth();\r
-\r
- scale = findScale();\r
-\r
- System.out.println("Scale factor = " + scale);\r
- }\r
-\r
- public void deleteBonds() {\r
- scale = 0;\r
- maxwidth = 0;\r
-\r
- width[0] = 0;\r
- width[1] = 0;\r
- width[2] = 0;\r
-\r
- centre[0] = 0;\r
- centre[1] = 0;\r
- centre[2] = 0;\r
-\r
- for (int i = 0; i < pdb.chains.size(); i++) {\r
- ((PDBChain) pdb.chains.elementAt(i)).bonds = null;\r
- }\r
- }\r
-\r
- public void findWidth() {\r
- float[] max = new float[3];\r
- float[] min = new float[3];\r
-\r
- max[0] = (float) -1e30;\r
- max[1] = (float) -1e30;\r
- max[2] = (float) -1e30;\r
-\r
- min[0] = (float) 1e30;\r
- min[1] = (float) 1e30;\r
- min[2] = (float) 1e30;\r
-\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- if (((PDBChain) pdb.chains.elementAt(ii)).isVisible) {\r
- Vector bonds = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- Bond tmp = (Bond) bonds.elementAt(i);\r
-\r
- if (tmp.start[0] >= max[0]) {\r
- max[0] = tmp.start[0];\r
- }\r
-\r
- if (tmp.start[1] >= max[1]) {\r
- max[1] = tmp.start[1];\r
- }\r
-\r
- if (tmp.start[2] >= max[2]) {\r
- max[2] = tmp.start[2];\r
- }\r
-\r
- if (tmp.start[0] <= min[0]) {\r
- min[0] = tmp.start[0];\r
- }\r
-\r
- if (tmp.start[1] <= min[1]) {\r
- min[1] = tmp.start[1];\r
- }\r
-\r
- if (tmp.start[2] <= min[2]) {\r
- min[2] = tmp.start[2];\r
- }\r
-\r
- if (tmp.end[0] >= max[0]) {\r
- max[0] = tmp.end[0];\r
- }\r
-\r
- if (tmp.end[1] >= max[1]) {\r
- max[1] = tmp.end[1];\r
- }\r
-\r
- if (tmp.end[2] >= max[2]) {\r
- max[2] = tmp.end[2];\r
- }\r
-\r
- if (tmp.end[0] <= min[0]) {\r
- min[0] = tmp.end[0];\r
- }\r
-\r
- if (tmp.end[1] <= min[1]) {\r
- min[1] = tmp.end[1];\r
- }\r
-\r
- if (tmp.end[2] <= min[2]) {\r
- min[2] = tmp.end[2];\r
- }\r
- }\r
- }\r
- }\r
-\r
- System.out.println("xmax " + max[0] + " min " + min[0]);\r
- System.out.println("ymax " + max[1] + " min " + min[1]);\r
- System.out.println("zmax " + max[2] + " min " + min[2]);\r
-\r
- width[0] = (float) Math.abs(max[0] - min[0]);\r
- width[1] = (float) Math.abs(max[1] - min[1]);\r
- width[2] = (float) Math.abs(max[2] - min[2]);\r
-\r
- maxwidth = width[0];\r
-\r
- if (width[1] > width[0]) {\r
- maxwidth = width[1];\r
- }\r
-\r
- if (width[2] > width[1]) {\r
- maxwidth = width[2];\r
- }\r
-\r
- System.out.println("Maxwidth = " + maxwidth);\r
- }\r
-\r
- public float findScale() {\r
- int dim;\r
- int width;\r
- int height;\r
-\r
- if (getWidth() != 0) {\r
- width = getWidth();\r
- height = getHeight();\r
- } else {\r
- width = prefsize.width;\r
- height = prefsize.height;\r
- }\r
-\r
- if (width < height) {\r
- dim = width;\r
- } else {\r
- dim = height;\r
- }\r
-\r
- return (float) (dim / (1.5d * maxwidth));\r
- }\r
-\r
- public void findCentre() {\r
- float xtot = 0;\r
- float ytot = 0;\r
- float ztot = 0;\r
-\r
- int bsize = 0;\r
-\r
- //Find centre coordinate\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- if (((PDBChain) pdb.chains.elementAt(ii)).isVisible) {\r
- Vector bonds = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- bsize += bonds.size();\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- xtot = xtot + ((Bond) bonds.elementAt(i)).start[0] +\r
- ((Bond) bonds.elementAt(i)).end[0];\r
-\r
- ytot = ytot + ((Bond) bonds.elementAt(i)).start[1] +\r
- ((Bond) bonds.elementAt(i)).end[1];\r
-\r
- ztot = ztot + ((Bond) bonds.elementAt(i)).start[2] +\r
- ((Bond) bonds.elementAt(i)).end[2];\r
- }\r
- }\r
- }\r
-\r
- centre[0] = xtot / (2 * (float) bsize);\r
- centre[1] = ytot / (2 * (float) bsize);\r
- centre[2] = ztot / (2 * (float) bsize);\r
- }\r
-\r
- public void paint(Graphics g) {\r
- //Only create the image at the beginning -\r
- //this saves much memory usage\r
- if ((img == null) || (prefsize.width != getWidth()) ||\r
- (prefsize.height != getHeight())) {\r
- prefsize.width = getWidth();\r
- prefsize.height = getHeight();\r
-\r
- scale = findScale();\r
- img = createImage(prefsize.width, prefsize.height);\r
- ig = img.getGraphics();\r
-\r
- redrawneeded = true;\r
- }\r
-\r
- if (redrawneeded == true) {\r
- drawBackground(ig, Color.black);\r
- drawScene(ig);\r
- redrawneeded = false;\r
- } else {\r
- ig = img.getGraphics();\r
- }\r
-\r
- g.drawImage(img, 0, 0, this);\r
- }\r
-\r
- public void drawBackground(Graphics g, Color col) {\r
- g.setColor(col);\r
- g.fillRect(0, 0, prefsize.width, prefsize.height);\r
- }\r
-\r
- public void drawScene(Graphics g) {\r
- // Sort the bonds by z coord\r
- Vector bonds = new Vector();\r
-\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- if (((PDBChain) pdb.chains.elementAt(ii)).isVisible) {\r
- Vector tmp = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- for (int i = 0; i < tmp.size(); i++) {\r
- bonds.addElement(tmp.elementAt(i));\r
- }\r
- }\r
- }\r
-\r
- if (zbuffer) {\r
- Zsort.Zsort(bonds);\r
- }\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- Bond tmpBond = (Bond) bonds.elementAt(i);\r
-\r
- xstart = (int) (((tmpBond.start[0] - centre[0]) * scale) +\r
- (getWidth() / 2));\r
- ystart = (int) (((tmpBond.start[1] - centre[1]) * scale) +\r
- (getHeight() / 2));\r
-\r
- xend = (int) (((tmpBond.end[0] - centre[0]) * scale) +\r
- (getWidth() / 2));\r
- yend = (int) (((tmpBond.end[1] - centre[1]) * scale) +\r
- (getHeight() / 2));\r
-\r
- xmid = (xend + xstart) / 2;\r
- ymid = (yend + ystart) / 2;\r
-\r
- if (depthcue && !bymolecule) {\r
- if (tmpBond.start[2] < (centre[2] - (maxwidth / 6))) {\r
- g.setColor(tmpBond.startCol.darker().darker());\r
- drawLine(g, xstart, ystart, xmid, ymid);\r
-\r
- g.setColor(tmpBond.endCol.darker().darker());\r
- drawLine(g, xmid, ymid, xend, yend);\r
- } else if (tmpBond.start[2] < (centre[2] + (maxwidth / 6))) {\r
- g.setColor(tmpBond.startCol.darker());\r
- drawLine(g, xstart, ystart, xmid, ymid);\r
-\r
- g.setColor(tmpBond.endCol.darker());\r
- drawLine(g, xmid, ymid, xend, yend);\r
- } else {\r
- g.setColor(tmpBond.startCol);\r
- drawLine(g, xstart, ystart, xmid, ymid);\r
-\r
- g.setColor(tmpBond.endCol);\r
- drawLine(g, xmid, ymid, xend, yend);\r
- }\r
- } else if (depthcue && bymolecule) {\r
- if (tmpBond.start[2] < (centre[2] - (maxwidth / 6))) {\r
- g.setColor(Color.green.darker().darker());\r
- drawLine(g, xstart, ystart, xend, yend);\r
- } else if (tmpBond.start[2] < (centre[2] + (maxwidth / 6))) {\r
- g.setColor(Color.green.darker());\r
- drawLine(g, xstart, ystart, xend, yend);\r
- } else {\r
- g.setColor(Color.green);\r
- drawLine(g, xstart, ystart, xend, yend);\r
- }\r
- } else if (!depthcue && !bymolecule) {\r
- g.setColor(tmpBond.startCol);\r
- drawLine(g, xstart, ystart, xmid, ymid);\r
- g.setColor(tmpBond.endCol);\r
- drawLine(g, xmid, ymid, xend, yend);\r
- } else {\r
- drawLine(g, xstart, ystart, xend, yend);\r
- }\r
- }\r
- }\r
-\r
- public void drawLine(Graphics g, int x1, int y1, int x2, int y2) {\r
- if (!wire) {\r
- if (((float) Math.abs(y2 - y1) / (float) Math.abs(x2 - x1)) < 0.5) {\r
- g.drawLine(x1, y1, x2, y2);\r
- g.drawLine(x1 + 1, y1 + 1, x2 + 1, y2 + 1);\r
- g.drawLine(x1, y1 - 1, x2, y2 - 1);\r
- } else {\r
- g.setColor(g.getColor().brighter());\r
- g.drawLine(x1, y1, x2, y2);\r
- g.drawLine(x1 + 1, y1, x2 + 1, y2);\r
- g.drawLine(x1 - 1, y1, x2 - 1, y2);\r
- }\r
- } else {\r
- g.drawLine(x1, y1, x2, y2);\r
- }\r
- }\r
-\r
- public Dimension minimumsize() {\r
- return prefsize;\r
- }\r
-\r
- public Dimension preferredsize() {\r
- return prefsize;\r
- }\r
-\r
- public void keyTyped(KeyEvent evt) {\r
- }\r
-\r
- public void keyReleased(KeyEvent evt) {\r
- }\r
-\r
- public void keyPressed(KeyEvent evt) {\r
- int key = evt.getKeyChar();\r
-\r
- if (evt.getKeyCode() == KeyEvent.VK_UP) {\r
- scale = (float) (scale * 1.1);\r
- redrawneeded = true;\r
- repaint();\r
- } else if (evt.getKeyCode() == KeyEvent.VK_DOWN) {\r
- scale = (float) (scale * 0.9);\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'w') {\r
- wire = !wire;\r
- System.out.println("wireframe " + wire);\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'd') {\r
- depthcue = !depthcue;\r
- System.out.println("Depth cueing is " + depthcue);\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'm') {\r
- bymolecule = !bymolecule;\r
- System.out.println("Bymolecule is " + bymolecule);\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'z') {\r
- zbuffer = !zbuffer;\r
- System.out.println("Z buffering is " + zbuffer);\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'c') {\r
- bymolecule = false;\r
- pdb.setChainColours();\r
- System.out.println("Colouring by chain");\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'h') {\r
- bymolecule = false;\r
- pdb.setHydrophobicityColours();\r
- System.out.println("Colouring by hydrophobicity");\r
- redrawneeded = true;\r
- repaint();\r
- } else if (key == 'q') {\r
- bymolecule = false;\r
- pdb.setChargeColours();\r
- System.out.println("Colouring charges and cysteines");\r
- redrawneeded = true;\r
- repaint();\r
- }\r
-\r
- return;\r
- }\r
-\r
- public void mousePressed(MouseEvent e) {\r
- mx = e.getX();\r
- my = e.getY();\r
- omx = mx;\r
- omy = my;\r
- dragging = false;\r
- }\r
-\r
- public void mouseMoved(MouseEvent e) {\r
- myAtom fatom = null;\r
-\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- PDBChain chain = (PDBChain) pdb.chains.elementAt(ii);\r
-\r
- if (chain.isVisible) {\r
- Vector bonds = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- Bond tmpBond = (Bond) bonds.elementAt(i);\r
- int truex = (int) (((tmpBond.start[0] - centre[0]) * scale) +\r
- (getWidth() / 2));\r
-\r
- if (Math.abs(truex - e.getX()) <= 2) {\r
- int truey = (int) (((tmpBond.start[1] - centre[1]) * scale) +\r
- (getHeight() / 2));\r
-\r
- if (Math.abs(truey - e.getY()) <= 2) {\r
- fatom = tmpBond.at1;\r
- }\r
- }\r
- }\r
- }\r
- }\r
-\r
- if (fatom != null) {\r
- this.setToolTipText(fatom.resName);\r
- } else {\r
- this.setToolTipText(null);\r
- }\r
- }\r
-\r
- public void mouseClicked(MouseEvent e) {\r
- }\r
-\r
- public void mouseEntered(MouseEvent e) {\r
- }\r
-\r
- public void mouseExited(MouseEvent e) {\r
- }\r
-\r
- public void mouseDragged(MouseEvent evt) {\r
- int x = evt.getX();\r
- int y = evt.getY();\r
- mx = x;\r
- my = y;\r
-\r
- MCMatrix objmat = new MCMatrix(3, 3);\r
- objmat.setIdentity();\r
-\r
- if ((evt.getModifiers() & Event.META_MASK) != 0) {\r
- objmat.rotatez((float) ((mx - omx)));\r
- } else {\r
- objmat.rotatex((float) ((my - omy)));\r
- objmat.rotatey((float) ((omx - mx)));\r
- }\r
-\r
- //Alter the bonds\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- Vector bonds = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- Bond tmpBond = (Bond) bonds.elementAt(i);\r
-\r
- //Translate the bond so the centre is 0,0,0\r
- tmpBond.translate(-centre[0], -centre[1], -centre[2]);\r
-\r
- //Now apply the rotation matrix\r
- tmpBond.start = objmat.vectorMultiply(tmpBond.start);\r
- tmpBond.end = objmat.vectorMultiply(tmpBond.end);\r
-\r
- //Now translate back again\r
- tmpBond.translate(centre[0], centre[1], centre[2]);\r
- }\r
- }\r
-\r
- objmat = null;\r
-\r
- omx = mx;\r
- omy = my;\r
-\r
- redrawneeded = true;\r
-\r
- paint(this.getGraphics());\r
-\r
- dragging = true;\r
-\r
- return;\r
- }\r
-\r
- public void mouseReleased(MouseEvent evt) {\r
- //int x = evt.getX();\r
- //int y = evt.getY();\r
-\r
- //if (!dragging) {\r
- // myAtom tmp = findAtom(x, y);\r
- //}\r
-\r
- drawLabels();\r
-\r
- return;\r
- }\r
-\r
- public void drawLabels() {\r
- redrawneeded = true;\r
- paint(this.getGraphics());\r
-\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- PDBChain chain = (PDBChain) pdb.chains.elementAt(ii);\r
-\r
- if (chain.isVisible) {\r
- Vector bonds = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- Bond tmpBond = (Bond) bonds.elementAt(i);\r
-\r
- if (tmpBond.at1.isSelected) {\r
- labelAtom(img.getGraphics(), tmpBond, 1);\r
- }\r
-\r
- if (tmpBond.at2.isSelected) {\r
- labelAtom(img.getGraphics(), tmpBond, 2);\r
- }\r
- }\r
- }\r
- }\r
-\r
- this.getGraphics().drawImage(img, 0, 0, this);\r
-\r
- dragging = false;\r
- }\r
-\r
- public void labelAtom(Graphics g, Bond b, int n) {\r
- g.setFont(font);\r
-\r
- if (n == 1) {\r
- int xstart = (int) (((b.start[0] - centre[0]) * scale) +\r
- (getWidth() / 2));\r
- int ystart = (int) (((b.start[1] - centre[1]) * scale) +\r
- (getHeight() / 2));\r
-\r
- g.setColor(Color.red);\r
- g.drawString(b.at1.resName + "-" + b.at1.resNumber, xstart, ystart);\r
- }\r
-\r
- if (n == 2) {\r
- int xstart = (int) (((b.end[0] - centre[0]) * scale) +\r
- (getWidth() / 2));\r
- int ystart = (int) (((b.end[1] - centre[1]) * scale) +\r
- (getHeight() / 2));\r
-\r
- g.setColor(Color.red);\r
- g.drawString(b.at2.resName + "-" + b.at2.resNumber, xstart, ystart);\r
- }\r
- }\r
-\r
- public myAtom findAtom(int x, int y) {\r
- myAtom fatom = null;\r
-\r
- int foundchain = -1;\r
-\r
- for (int ii = 0; ii < pdb.chains.size(); ii++) {\r
- PDBChain chain = (PDBChain) pdb.chains.elementAt(ii);\r
-\r
- if (chain.isVisible) {\r
- Vector bonds = ((PDBChain) pdb.chains.elementAt(ii)).bonds;\r
-\r
- for (int i = 0; i < bonds.size(); i++) {\r
- Bond tmpBond = (Bond) bonds.elementAt(i);\r
-\r
- int truex = (int) (((tmpBond.start[0] - centre[0]) * scale) +\r
- (getWidth() / 2));\r
-\r
- if (Math.abs(truex - x) <= 2) {\r
- int truey = (int) (((tmpBond.start[1] - centre[1]) * scale) +\r
- (getHeight() / 2));\r
-\r
- if (Math.abs(truey - y) <= 2) {\r
- System.out.println("Found match");\r
- System.out.println(x + " " + y);\r
- System.out.println(truex + " " + truey);\r
- System.out.println(tmpBond.start[0] + " " +\r
- tmpBond.start[1]);\r
- System.out.println("Atom 1 = " +\r
- tmpBond.at1.resName + " " +\r
- tmpBond.at1.resNumber + " " +\r
- tmpBond.at1.chain);\r
- fatom = tmpBond.at1;\r
- fatom.isSelected = !fatom.isSelected;\r
- foundchain = ii;\r
- }\r
- }\r
- }\r
- }\r
-\r
- if (fatom != null) //)&& chain.ds != null)\r
- {\r
- chain = (PDBChain) pdb.chains.elementAt(foundchain);\r
-\r
- // SMJS TODO\r
- // int tmp = chain.ds.seqstart + fatom.resNumber - chain.offset;\r
- // int pos = chain.ds.findIndex(tmp);\r
- // System.out.println("Found seq " + chain.ds.name + " " + tmp + " " + pos);\r
- }\r
- }\r
-\r
- return fatom;\r
- }\r
-\r
- public void update(Graphics g) {\r
- paint(g);\r
- }\r
-}\r