jaba is the new name.
authorjprocter <Jim Procter>
Sun, 11 Jul 2010 13:47:43 +0000 (13:47 +0000)
committerjprocter <Jim Procter>
Sun, 11 Jul 2010 13:47:43 +0000 (13:47 +0000)
src/jalview/ws/jws2/Jws2Discoverer.java

index 2b809b5..95100e0 100644 (file)
@@ -1,5 +1,6 @@
 package jalview.ws.jws2;
 
+import java.awt.Color;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.beans.PropertyChangeEvent;
@@ -280,8 +281,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
      * eventually, JWS2 services will appear under the same align/etc submenus.
      * for moment we keep them separate.
      */
-    JMenu atpoint, jws2al = new JMenu("JWS2 Alignment");
+    JMenu atpoint, jws2al = new JMenu("JABA Alignment");
     MsaWSClient msacl = new MsaWSClient();
+    Vector hostLabels=new Vector();
     for (final Jws2Instance service : services)
     {
       atpoint = jws2al;
@@ -301,6 +303,16 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
           atpoint.setToolTipText(service.getActionText());
         }
       }
+      if (!byhost && !hostLabels.contains(host+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();
+        atpoint.add(hitm=new JMenuItem(host));
+        hitm.setForeground(Color.blue);
+        hostLabels.addElement(host);
+      }
       msacl.attachWSMenuEntry(atpoint, service, alignFrame);
       /*
        * JMenuItem sitem = new JMenuItem(service.serviceType);
@@ -397,7 +409,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   public static Vector<String> getServiceUrls()
   {
     String surls = Cache.getDefault(JWS2HOSTURLS,
-            "http://www.compbio.dundee.ac.uk/jaws2");
+            "http://www.compbio.dundee.ac.uk/jaba");
     Vector<String> urls = new Vector<String>();
     try
     {