import jalview.datamodel.SequenceGroup;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
+import jalview.gui.AlignmentPanel;
import jalview.gui.Desktop;
import jalview.gui.WebserviceInfo;
+import jalview.io.packed.DataProvider.JvDataType;
import jalview.ws.WSClient;
import jalview.ws.WSClientI;
import jalview.ws.WSMenuEntryProviderI;
{
wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceName + "\n"
+ WebServiceReference);
+ wsInfo.setRenderAsHtml(true);
}
}
*/
protected boolean isAlignmentModified()
{
- if (undoredo == null)
+ if (undoredo == null || av==null || av.getAlignment()==null)
{
+ // always return modified if we don't have access to live GUI elements anymore.
return true;
}
if (av.isUndoRedoHashModified(undoredo))
{
-
+ // alignment has been modified in some way.
+ return true;
}
+ // TODO: look deeper into modification of selection state, etc that may affect RestJobThread.realiseResults(boolean merge);
return false;
}
}
else
{
+ // TODO: try to tell the user why the job couldn't be started.
JOptionPane.showMessageDialog(Desktop.desktop,
"Unable to start web service analysis",
"Internal Jalview Error", JOptionPane.WARNING_MESSAGE);
public static RestClient makeShmmrRestClient()
{
- String action = "Analyse", description = "Sequence Harmony and Multi-Relief", name = "SHMR";
+ String action = "Analyse", description = "Sequence Harmony and Multi-Relief (UNSTABLE!)", name = "Sequence Harmony";
Hashtable<String, InputType> iparams = new Hashtable<String, InputType>();
jalview.ws.rest.params.JobConstant toolp;
//toolp = new jalview.ws.rest.JobConstant("tool","jalview");
iparams.put(toolp.token, toolp);
jalview.ws.rest.params.Alignment aliinput = new jalview.ws.rest.params.Alignment();
- aliinput.token = "ali_file";
- aliinput.writeAsFile=true;
- iparams.put("ali_file", aliinput);
+ aliinput.token = "ali";//_file";
+ aliinput.writeAsFile=false;//true;
+ //aliinput.token = "ali_file";
+ //aliinput.writeAsFile=true;
+ iparams.put(aliinput.token, aliinput);
jalview.ws.rest.params.SeqGroupIndexVector sgroups = new jalview.ws.rest.params.SeqGroupIndexVector();
+ sgroups.minsize=2;
iparams.put("groups", sgroups);
sgroups.token = "groups";
sgroups.sep = " ";
name,
"http://www.ibi.vu.nl/programs/shmrwww/index.php?tool=jalview",// ?tool=jalview&mbjob[method]=shmr&mbjob[description]=step1",
"?tool=jalview", iparams, true, false, '-');
+ // a priori knowledge of the data returned from the service
+ shmrService.addResultDatatype(JvDataType.ANNOTATION);
return new RestClient(shmrService);
}
+ public AlignmentPanel recoverAlignPanelForView()
+ {
+ AlignmentPanel[] aps = Desktop.getAlignmentPanels(av.getSequenceSetId());
+ for (AlignmentPanel alp:aps)
+ {
+ if (alp.av == av)
+ {
+ return alp;
+ }
+ }
+ return null;
+ }
+
+ public boolean isShowResultsInNewView()
+ {
+ // TODO make this a property of the service
+ return true;
+ }
+
}