JAL-1919 initial support for mmCIF using JMol API. Created an Abstract class - Struct...
[jalview.git] / src / MCview / PDBCanvas.java
index ac1ba06..dfe7c8f 100644 (file)
@@ -154,7 +154,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
 
       if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
       {
-        pdbentry.setFile("INLINE" + pdb.id);
+        pdbentry.setFile("INLINE" + pdb.getId());
       }
 
     } catch (Exception ex)
@@ -168,7 +168,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
       errorMessage = "Error loading file: " + pdbentry.getId();
       return;
     }
-    pdbentry.setId(pdb.id);
+    pdbentry.setId(pdb.getId());
 
     ssm.addStructureViewerListener(this);
 
@@ -184,19 +184,19 @@ public class PDBCanvas extends JPanel implements MouseListener,
     // JUST DEAL WITH ONE SEQUENCE FOR NOW
     SequenceI sequence = seq[0];
 
-    for (int i = 0; i < pdb.chains.size(); i++)
+    for (int i = 0; i < pdb.getChains().size(); i++)
     {
 
       mappingDetails.append("\n\nPDB Sequence is :\nSequence = "
-              + pdb.chains.elementAt(i).sequence.getSequenceAsString());
+              + pdb.getChains().elementAt(i).sequence.getSequenceAsString());
       mappingDetails.append("\nNo of residues = "
-              + pdb.chains.elementAt(i).residues.size() + "\n\n");
+              + pdb.getChains().elementAt(i).residues.size() + "\n\n");
 
       // Now lets compare the sequences to get
       // the start and end points.
       // Align the sequence to the pdb
       AlignSeq as = new AlignSeq(sequence,
-              pdb.chains.elementAt(i).sequence, "pep");
+              pdb.getChains().elementAt(i).sequence, "pep");
       as.calcScoreMatrix();
       as.traceAlignment();
       PrintStream ps = new PrintStream(System.out)
@@ -229,7 +229,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
       mappingDetails.append("\nSEQ start/end " + seqstart + " " + seqend);
     }
 
-    mainchain = pdb.chains.elementAt(maxchain);
+    mainchain = pdb.getChains().elementAt(maxchain);
 
     mainchain.pdbstart = pdbstart;
     mainchain.pdbend = pdbend;
@@ -271,7 +271,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
     // Sort the bonds by z coord
     visiblebonds = new Vector<Bond>();
 
-    for (PDBChain chain : pdb.chains)
+    for (PDBChain chain : pdb.getChains())
     {
       if (chain.isVisible)
       {
@@ -301,7 +301,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
     min[1] = (float) 1e30;
     min[2] = (float) 1e30;
 
-    for (PDBChain chain : pdb.chains)
+    for (PDBChain chain : pdb.getChains())
     {
       if (chain.isVisible)
       {
@@ -432,7 +432,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
     int bsize = 0;
 
     // Find centre coordinate
-    for (PDBChain chain : pdb.chains)
+    for (PDBChain chain : pdb.getChains())
     {
       if (chain.isVisible)
       {
@@ -541,9 +541,9 @@ public class PDBCanvas extends JPanel implements MouseListener,
     PDBChain chain;
     if (bysequence && pdb != null)
     {
-      for (int ii = 0; ii < pdb.chains.size(); ii++)
+      for (int ii = 0; ii < pdb.getChains().size(); ii++)
       {
-        chain = pdb.chains.elementAt(ii);
+        chain = pdb.getChains().elementAt(ii);
 
         for (int i = 0; i < chain.bonds.size(); i++)
         {
@@ -757,7 +757,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
       repaint();
       if (foundchain != -1)
       {
-        PDBChain chain = pdb.chains.elementAt(foundchain);
+        PDBChain chain = pdb.getChains().elementAt(foundchain);
         if (chain == mainchain)
         {
           if (fatom.alignmentMapping != -1)
@@ -805,7 +805,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
     PDBChain chain = null;
     if (foundchain != -1)
     {
-      chain = pdb.chains.elementAt(foundchain);
+      chain = pdb.getChains().elementAt(foundchain);
       if (chain == mainchain)
       {
         mouseOverStructure(fatom.resNumber, chain.id);
@@ -857,7 +857,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
     }
 
     // Alter the bonds
-    for (PDBChain chain : pdb.chains)
+    for (PDBChain chain : pdb.getChains())
     {
       for (Bond tmpBond : chain.bonds)
       {
@@ -894,7 +894,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
   void drawLabels(Graphics g)
   {
 
-    for (PDBChain chain : pdb.chains)
+    for (PDBChain chain : pdb.getChains())
     {
       if (chain.isVisible)
       {
@@ -943,9 +943,9 @@ public class PDBCanvas extends JPanel implements MouseListener,
 
     foundchain = -1;
 
-    for (int ii = 0; ii < pdb.chains.size(); ii++)
+    for (int ii = 0; ii < pdb.getChains().size(); ii++)
     {
-      PDBChain chain = pdb.chains.elementAt(ii);
+      PDBChain chain = pdb.getChains().elementAt(ii);
       int truex;
       Bond tmpBond = null;
 
@@ -990,7 +990,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
 
       if (fatom != null) // )&& chain.ds != null)
       { // dead code? value of chain is either overwritten or discarded
-        chain = pdb.chains.elementAt(foundchain);
+        chain = pdb.getChains().elementAt(foundchain);
       }
     }
 
@@ -1053,9 +1053,9 @@ public class PDBCanvas extends JPanel implements MouseListener,
 
   public void setAllchainsVisible(boolean b)
   {
-    for (int ii = 0; ii < pdb.chains.size(); ii++)
+    for (int ii = 0; ii < pdb.getChains().size(); ii++)
     {
-      PDBChain chain = pdb.chains.elementAt(ii);
+      PDBChain chain = pdb.getChains().elementAt(ii);
       chain.isVisible = b;
     }
     mainchain.isVisible = true;