JAL-1911 bugfix - do not save i18n text in preference file
[jalview.git] / src / jalview / ws / dbsources / Pdb.java
index 358c838..f41d86a 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.ws.dbsources;
 
+import jalview.api.FeatureSettingsModelI;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
@@ -27,6 +28,7 @@ import jalview.datamodel.DBRefSource;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
 import jalview.io.FormatAdapter;
+import jalview.io.PDBFeatureSettings;
 import jalview.util.MessageManager;
 import jalview.ws.ebi.EBIFetchClient;
 
@@ -47,7 +49,11 @@ public class Pdb extends EbiFileRetrievedProxy
     super();
   }
 
-  private static String currentDefaultFomart = DBRefSource.MMCIF;
+  public static final String FEATURE_INSERTION = "INSERTION";
+
+  public static final String FEATURE_RES_NUM = "RESNUM";
+
+  private static String currentDefaultFomart = DBRefSource.PDB;
 
   /*
    * (non-Javadoc)
@@ -126,11 +132,11 @@ public class Pdb extends EbiFileRetrievedProxy
       stopQuery();
       return null;
     }
-    String ext = getCurrentDefaultFomart().equalsIgnoreCase("mmcif") ? ".cif"
+    String ext = getCurrentDefaultFormat().equalsIgnoreCase("mmcif") ? ".cif"
             : ".xml";
     EBIFetchClient ebi = new EBIFetchClient();
     file = ebi.fetchDataAsFile("pdb:" + id,
-            getCurrentDefaultFomart().toLowerCase(), "raw", ext)
+            getCurrentDefaultFormat().toLowerCase(), "raw", ext)
             .getAbsolutePath();
     stopQuery();
     if (file == null)
@@ -142,7 +148,7 @@ public class Pdb extends EbiFileRetrievedProxy
 
       pdbAlignment = new FormatAdapter().readFile(file,
               jalview.io.AppletFormatAdapter.FILE,
-              getCurrentDefaultFomart());
+              getCurrentDefaultFormat());
       if (pdbAlignment != null)
       {
         List<SequenceI> toremove = new ArrayList<SequenceI>();
@@ -257,13 +263,28 @@ public class Pdb extends EbiFileRetrievedProxy
     return 0;
   }
 
-  public static String getCurrentDefaultFomart()
+  public static String getCurrentDefaultFormat()
   {
     return currentDefaultFomart;
   }
 
-  public static void setCurrentDefaultFomart(String currentDefaultFomart)
+  public static void setCurrentDefaultFormat(String currentDefaultFomart)
   {
     Pdb.currentDefaultFomart = currentDefaultFomart;
   }
+
+  /**
+   * Returns a descriptor for suitable feature display settings with
+   * <ul>
+   * <li>ResNums or insertions features visible</li>
+   * <li>insertions features coloured red</li>
+   * <li>ResNum features coloured by label</li>
+   * <li>Insertions displayed above (on top of) ResNums</li>
+   * </ul>
+   */
+  @Override
+  public FeatureSettingsModelI getFeatureColourScheme()
+  {
+    return new PDBFeatureSettings();
+  }
 }