import uk.ac.dundee.compbio.slivkaclient.SlivkaClient;
import uk.ac.dundee.compbio.slivkaclient.SlivkaService;
-public class SlivkaWSDiscoverer
- implements Runnable, WSMenuEntryProviderI
+public class SlivkaWSDiscoverer implements Runnable, WSMenuEntryProviderI
{
private static SlivkaWSDiscoverer instance = null;
+
private SlivkaClient client;
- private SlivkaWSDiscoverer() {
+ private SlivkaWSDiscoverer()
+ {
try
{
client = new SlivkaClient("gjb-www-1.cluster.lifesci.dundee.ac.uk", 3203);
public static SlivkaWSDiscoverer getInstance()
{
- if (instance == null) {
- instance = new SlivkaWSDiscoverer();
- }
+ if (instance == null)
+ {
+ instance = new SlivkaWSDiscoverer();
+ }
return instance;
}
try
{
- for (SlivkaService service: client.getServices()) {
- msaClassifier: {
- for (String classifier: service.classifiers) {
- if (classifier.contains("Multiple sequence alignment")) {
+ for (SlivkaService service : client.getServices())
+ {
+ msaClassifier:
+ {
+ for (String classifier : service.classifiers)
+ {
+ if (classifier.contains("Multiple sequence alignment"))
+ {
break msaClassifier;
}
}
JMenuItem defaultEntry = new JMenuItem(String.format("%s with defaults", service.label));
defaultEntry.addActionListener((ActionEvent evt) -> {
AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- if (msa != null) {
- new MsaWSClient(
- instance, alignFrame.getTitle(), msa, false, true,
- alignFrame.getViewport().getAlignment().getDataset(),
- alignFrame
- );
+ if (msa != null)
+ {
+ new MsaWSClient(instance, alignFrame.getTitle(), msa, false, true,
+ alignFrame.getViewport().getAlignment().getDataset(), alignFrame);
}
});
categoryMenu.add(defaultEntry);
-
+
JMenuItem customEntry = new JMenuItem(String.format("%s with custom parameters", service.label));
customEntry.addActionListener((ActionEvent evt) -> {
AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- if (msa != null) {
+ if (msa != null)
+ {
try
{
- SlivkaParamSet paramSet = new SlivkaParamSet(service);
- new MsaWSClient(
- instance, paramSet, null, true, alignFrame.getTitle(), msa, false, true,
+ SlivkaParamSet paramSet = new SlivkaParamSet(service);
+ new MsaWSClient(instance, paramSet, null, true, alignFrame.getTitle(), msa, false, true,
alignFrame.getViewport().getAlignment().getDataset(), alignFrame);
} catch (IOException exc)
{
}
});
categoryMenu.add(customEntry);
-
+
categoryMenu.addSeparator();
}
} catch (IOException e)