- return;
- }
- boolean byhost = Cache.getDefault("WSMENU_BYHOST", true), bytype = Cache
- .getDefault("WSMENU_BYTYPE", true);
- /**
- * eventually, JWS2 services will appear under the same align/etc submenus.
- * for moment we keep them separate.
- */
- JMenu atpoint, jws2al = new JMenu("JABA Alignment");
- MsaWSClient msacl = new MsaWSClient();
- Vector hostLabels = new Vector();
- for (final Jws2Instance service : services)
- {
- atpoint = jws2al;
- String host = service.getHost();
- String type = service.serviceType;
- if (byhost)
- {
- atpoint = findOrCreateMenu(atpoint, host);
- if (atpoint.getToolTipText() == null)
- {
- atpoint.setToolTipText("Services at " + host);
- }
- }
- if (bytype)
- {
- atpoint = findOrCreateMenu(atpoint, type);
- if (atpoint.getToolTipText() == null)
- {
- 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);
- * sitem.setToolTipText("Hosted at " + service.hosturl);
- * sitem.addActionListener(new ActionListener() {
- *
- * @Override public void actionPerformed(ActionEvent e) { AlignmentView
- * msa = alignFrame.gatherSequencesForAlignment(); MsaWSClient client =
- * new MsaWSClient(service, "JWS2 Alignment of " + alignFrame.getTitle(),
- * msa, false, true, alignFrame.getViewport().getAlignment().getDataset(),
- * alignFrame); } });
- */
- }
- if (services.size() > 0)