From 450e45b30f7bd3913fca34511e534fec955b8195 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Mon, 23 Sep 2019 16:01:34 +0100 Subject: [PATCH] SlivkaWSDiscoverer formatting fix --- src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java | 48 ++++++++++++----------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java b/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java index 54cfbc4..e9d0d53 100644 --- a/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java +++ b/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java @@ -16,13 +16,14 @@ import javax.swing.JMenuItem; 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); @@ -34,9 +35,10 @@ public class SlivkaWSDiscoverer public static SlivkaWSDiscoverer getInstance() { - if (instance == null) { - instance = new SlivkaWSDiscoverer(); - } + if (instance == null) + { + instance = new SlivkaWSDiscoverer(); + } return instance; } @@ -50,10 +52,14 @@ public class SlivkaWSDiscoverer 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; } } @@ -63,25 +69,23 @@ public class SlivkaWSDiscoverer 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) { @@ -90,7 +94,7 @@ public class SlivkaWSDiscoverer } }); categoryMenu.add(customEntry); - + categoryMenu.addSeparator(); } } catch (IOException e) -- 1.7.10.2