JAL-2351 first refactoring and outline of read/write Jmol properties
[jalview.git] / src / jalview / ext / rbvi / chimera / JalviewChimeraBinding.java
index 75ddc9c..903b409 100644 (file)
@@ -1351,4 +1351,24 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
     }
     return -1;
   }
+
+  /**
+   * Queries Chimera for its list of residue attributes and returns their names
+   * 
+   * @return
+   */
+  public List<String> getResidueAttributes()
+  {
+    List<String> result = new ArrayList<String>();
+    List<String> atts = sendChimeraCommand("list resattr", true);
+    for (String att : atts)
+    {
+      /*
+       * expect lines like "resattr chi1" - we just one the second bit
+       */
+      String[] tokens = att.split(" ");
+      result.add(tokens[tokens.length - 1]);
+    }
+    return result;
+  }
 }