JAL-1807 Bob's first commit -- Applet loaded; needs image
[jalview.git] / src / jalview / io / ModellerDescription.java
index fd28956..49fc1f1 100755 (executable)
@@ -1,24 +1,32 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  * Jalview is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
  *  
  * Jalview is distributed in the hope that it will be useful, but 
  * WITHOUT ANY WARRANTY; without even the implied warranty 
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  * PURPOSE.  See the GNU General Public License for more details.
  * 
- * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.io;
 
-import jalview.datamodel.*;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.SequenceI;
+import jalview.jsdev.RegExp;
+import jalview.jsdev.api.RegExpInterface;
+
+//import com.stevesoft.pat.Regex;
 
 public class ModellerDescription
 {
@@ -93,19 +101,18 @@ public class ModellerDescription
   private resCode validResidueCode(String field)
   {
     Integer val = null;
-    com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex(
-            "\\s*((([-0-9]+).?)|FIRST|LAST|@)");
+    RegExpInterface r = RegExp.newRegex("\\s*((([-0-9]+).?)|FIRST|LAST|@)");
 
     if (!r.search(field))
     {
       return null; // invalid
     }
-    String value = r.stringMatched(3);
+    String value = r.stringMatchedI(3);
     if (value == null)
     {
-      value = r.stringMatched(1);
+      value = r.stringMatchedI(1);
     }
-    // jalview.bin.Cache.log.debug("from '" + field + "' matched '" + value +
+    // Cache.log.debug("from '" + field + "' matched '" + value +
     // "'");
     try
     {
@@ -160,7 +167,7 @@ public class ModellerDescription
                 }
                 else
                 {
-                  // jalview.bin.Cache.log.debug(
+                  // Cache.log.debug(
                   // "Ignoring non-Modeller description: invalid integer-like
                   // field '" + field + "'");
                   type = -1; /* invalid field! - throw the FieldSet away */
@@ -271,8 +278,7 @@ public class ModellerDescription
       if (seq.getDatasetSequence() != null
               && seq.getDatasetSequence().getDBRef() != null)
       {
-        jalview.datamodel.DBRefEntry[] dbr = seq.getDatasetSequence()
-                .getDBRef();
+        DBRefEntry[] dbr = seq.getDatasetSequence().getDBRef();
         int i, j;
         for (i = 0, j = dbr.length; i < j; i++)
         {
@@ -282,8 +288,7 @@ public class ModellerDescription
             // ModellerField
             // JBPNote Need to get info from the user about whether the sequence
             // is the one being modelled, or if it is a template.
-            if (dbr[i].getSource()
-                    .equals(jalview.datamodel.DBRefSource.PDB))
+            if (dbr[i].getSource().equals(DBRefSource.PDB))
             {
               fields.put(Fields[LOCALID], dbr[i].getAccessionId());
               t = 2;