Merge branch 'bug/JAL-1717_make-pbd-id-case_insensitive' into Release_2_9_Branch
[jalview.git] / src / jalview / gui / StructureChooser.java
index cd4faf6..358412d 100644 (file)
@@ -179,6 +179,7 @@ public class StructureChooser extends GStructureChooser
     DefaultTableModel tableModel = new DefaultTableModel();
     tableModel.addColumn("Sequence");
     tableModel.addColumn("PDB Id");
+    tableModel.addColumn("Chain");
     tableModel.addColumn("Type");
     tableModel.addColumn("File");
     cachedEntryMap = new Hashtable<String, PDBEntry>();
@@ -189,8 +190,12 @@ public class StructureChooser extends GStructureChooser
       {
         for (PDBEntry pdbEntry : seq.getDatasetSequence().getPDBId())
         {
+          String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
+                  .getChainCode();
           String[] pdbEntryRowData = new String[]
-          { seq.getDisplayId(false), pdbEntry.getId(), pdbEntry.getType(),
+          { seq.getDisplayId(false), pdbEntry.getId(),
+ chain,
+              pdbEntry.getType(),
               pdbEntry.getFile() };
           tableModel.addRow(pdbEntryRowData);
           cachedEntryMap.put(seq.getDisplayId(false) + pdbEntry.getId(),
@@ -217,7 +222,7 @@ public class StructureChooser extends GStructureChooser
     {
       PDBEntry newEntry = new PDBEntry();
       newEntry.setId(response.getPdbId());
-      newEntry.setType("PDB");
+      newEntry.setType(PDBEntry.Type.PDB);
       seq.getDatasetSequence().addPDBId(newEntry);
     }
   }
@@ -597,7 +602,7 @@ public class StructureChooser extends GStructureChooser
                 .toString();
         PDBEntry pdbEntry = new PDBEntry();
         pdbEntry.setId(pdbIdStr);
-        pdbEntry.setType("PDB");
+        pdbEntry.setType(PDBEntry.Type.PDB);
         pdbEntriesToView[count++] = pdbEntry;
       }
 
@@ -626,7 +631,7 @@ public class StructureChooser extends GStructureChooser
       }
       PDBEntry pdbEntry = new PDBEntry();
       pdbEntry.setId(txt_search.getText());
-      pdbEntry.setType("PDB");
+      pdbEntry.setType(PDBEntry.Type.PDB);
       selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
       PDBEntry[] pdbEntriesToView = new PDBEntry[]
       { pdbEntry };