//
// patch for Jalview - set model name in Chimera
- //
+ // TODO: find a variant that works for sub-models
sendChimeraCommand("setattr M name " + modelName + " #"
+ modelNumbers[0], false);
// end patch for Jalview
public void stopListening()
{
- sendChimeraCommand("listen stop models; listen stop selection", false);
+ sendChimeraCommand("listen stop models ; listen stop selection ", false);
}
/**
*/
public void startListening(String uri)
{
- sendChimeraCommand("listen start models url " + uri, false);
- sendChimeraCommand("listen start select prefix SelectionChanged url "
- + uri, false);
- }
-
- /**
- * Tell Chimera we have stopped listening on the given URI
- *
- * @param uri
- */
- public void stopListening(String uri)
- {
- sendChimeraCommand("listen stop models url " + uri, false);
- sendChimeraCommand("listen stop selection url " + uri, false);
+ sendChimeraCommand("listen start models url " + uri
+ + ";listen start select prefix SelectionChanged url " + uri, false);
}
/**
return launched;
}
+ /**
+ * Launch Chimera, unless an instance linked to this object is already
+ * running. Returns true if chimera is successfully launched, or already
+ * running, else false.
+ *
+ * @param chimeraPaths
+ * @return
+ */
public boolean launchChimera(List<String> chimeraPaths)
{
// Do nothing if Chimera is already launched
*/
public List<String> sendChimeraCommand(String command, boolean reply)
{
+// System.out.println("chimeradebug>> " + command);
if (!isChimeraLaunched() || command == null
|| "".equals(command.trim()))
{
*/
protected List<String> sendRestCommand(String command)
{
- // System.out.println("Rest: " + command);
- // TODO start a separate thread to do this so we don't block?
String restUrl = "http://127.0.0.1:" + this.chimeraRestPort + "/run";
List<NameValuePair> commands = new ArrayList<NameValuePair>(1);
commands.add(new BasicNameValuePair("command", command));
BufferedReader response = null;
try {
response = HttpClientUtils
- .doHttpUrlPost(restUrl, commands, 100, 2000);
+ .doHttpUrlPost(restUrl, commands, 100, 5000);
String line = "";
while ((line = response.readLine()) != null) {
reply.add(line);