JAL-629 Opening files in new windows. not working yet
[jalview.git] / src / jalview / bin / argparser / SubVals.java
index 796c03d..e6a7cb2 100644 (file)
@@ -47,7 +47,7 @@ public class SubVals
         {
           if (subVals == null)
             subVals = new HashMap<>();
-          subVals.put(subvalString.substring(0, equals),
+          this.put(subvalString.substring(0, equals),
                   subvalString.substring(equals + 1));
         }
         else
@@ -58,14 +58,16 @@ public class SubVals
             setIndex = true;
           } catch (NumberFormatException e)
           {
-            Console.warn("Failed to obtain subvalue or index from '" + item
-                    + "'. Setting index=0 and using content='" + content
-                    + "'.");
+            // store this non-numeric key as a "true" value
+            subVals.put(subvalsString, "true");
           }
         }
       }
       if (!setIndex)
         this.index = NOTSET;
+      else
+        Console.debug("SubVals from '" + subvalsString + "' has index "
+                + this.index + " set");
     }
     else
     {
@@ -73,6 +75,13 @@ public class SubVals
     }
   }
 
+  protected void put(String key, String val)
+  {
+    if (subVals == null)
+      subVals = new HashMap<>();
+    subVals.put(key, val);
+  }
+
   public boolean notSet()
   {
     // notSet is true if content present but nonsensical