X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FJws2Discoverer.java;h=e56a5e51ac9278ff67c6ac7953d65d32bda87714;hb=8a6fa9ea9900d0f106529c3f6283e7f9d76dd2cb;hp=8e298178006e16b8baa47f800ab1dd76af783aed;hpb=153dd62dc91da13ae732600e6ea55ddbe15eab39;p=jalview.git diff --git a/src/jalview/ws/jws2/Jws2Discoverer.java b/src/jalview/ws/jws2/Jws2Discoverer.java index 8e29817..e56a5e5 100644 --- a/src/jalview/ws/jws2/Jws2Discoverer.java +++ b/src/jalview/ws/jws2/Jws2Discoverer.java @@ -179,9 +179,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI } System.out.println("Discovered service: " + jwsservers + " " + srv.toString()); - Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(), service2); + Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(), + service2); - services.add(service); + services.add(service); // retrieve the presets and parameter set and cache now service.getParamStore().getPresets(); service.hasParameters(); @@ -299,22 +300,25 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI public String getUri() { // this is only valid for Jaba 1.0 - this formula might have to change! - return hosturl+(hosturl.lastIndexOf("/")==(hosturl.length()-1) ? "/" : "") +serviceType; + return hosturl + + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? "/" + : "") + serviceType; } - private boolean hasParams=false,lookedForParams=false; + + private boolean hasParams = false, lookedForParams = false; public boolean hasParameters() { if (!lookedForParams) { - lookedForParams=true; - try - { - hasParams = (getRunnerConfig().getArguments().size() > 0); - } catch (Exception e) - { + lookedForParams = true; + try + { + hasParams = (getRunnerConfig().getArguments().size() > 0); + } catch (Exception e) + { - } + } } return hasParams; } @@ -383,7 +387,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI }); wsmenu.add(jws2al); - + } private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame) @@ -402,7 +406,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI MsaWSClient msacl = new MsaWSClient(); Vector hostLabels = new Vector(); jws2al.removeAll(); - String lasthost=null; + String lasthost = null; for (final Jws2Instance service : services) { atpoint = jws2al; @@ -424,22 +428,27 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI atpoint.setToolTipText(service.getActionText()); } } - if (!byhost && !hostLabels.contains(host + service.serviceType+service.getActionText())) - //!hostLabels.contains(host + (bytype ? service.serviceType+service.getActionText() : ""))) + if (!byhost + && !hostLabels.contains(host + service.serviceType + + service.getActionText())) + // !hostLabels.contains(host + (bytype ? + // service.serviceType+service.getActionText() : ""))) { // add a marker indicating where this service is hosted // relies on services from the same host being listed in a contiguous // group JMenuItem hitm; atpoint.addSeparator(); - if (lasthost==null || !lasthost.equals(host)) + if (lasthost == null || !lasthost.equals(host)) { atpoint.add(hitm = new JMenuItem(host)); hitm.setForeground(Color.blue); lasthost = host; } - hostLabels.addElement(host + service.serviceType+service.getActionText() ); - // hostLabels.addElement(host + (bytype ? service.serviceType+service.getActionText() : "")); + hostLabels.addElement(host + service.serviceType + + service.getActionText()); + // hostLabels.addElement(host + (bytype ? + // service.serviceType+service.getActionText() : "")); } msacl.attachWSMenuEntry(atpoint, service, alignFrame); /*