4 package jalview.ws.jws1;
6 import jalview.gui.AlignFrame;
7 import jalview.gui.WebserviceInfo;
8 import jalview.ws.WSClient;
9 import jalview.ws.WSMenuEntryProviderI;
11 import javax.swing.JMenu;
13 import ext.vamsas.ServiceHandle;
16 * JWS1 Specific UI attributes and methods
20 public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI
24 * original service handle that this client was derived from
26 ServiceHandle serviceHandle = null;
37 * initialise WSClient service information attributes from the service handle
40 * @return the service instance information GUI for this client and job.
42 protected WebserviceInfo setWebService(ServiceHandle sh)
44 return setWebService(sh, false);
48 * initialise WSClient service information attributes from the service handle
52 * true implies no GUI objects will be created.
53 * @return the service instance information GUI for this client and job.
55 protected WebserviceInfo setWebService(ServiceHandle sh, boolean headless)
57 WebServiceName = sh.getName();
58 if (ServiceActions.containsKey(sh.getAbstractName()))
60 WebServiceJobTitle = sh.getName(); // TODO: control sh.Name specification
62 // add this for short names. +(String)
63 // ServiceActions.get(sh.getAbstractName());
67 WebServiceJobTitle = sh.getAbstractName() + " using " + sh.getName();
70 WebServiceReference = sh.getDescription();
71 WsURL = sh.getEndpointURL();
72 WebserviceInfo wsInfo = null;
75 wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceReference);
81 * convenience method to pass the serviceHandle reference that instantiated
82 * this service on to the menu entry constructor
85 * the menu to which any menu entries/sub menus are to be attached
87 * the alignFrame instance that provides input data for the service
89 public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame)
91 if (serviceHandle == null)
94 "IMPLEMENTATION ERROR: cannot attach WS Menu Entry without service handle reference!");
96 attachWSMenuEntry(wsmenu, serviceHandle, alignFrame);
100 * method implemented by each concrete WS1Client implementation that creates menu
101 * entries that enact their service using data from alignFrame.
104 * where new menu entries (and submenus) are to be attached
105 * @param serviceHandle
106 * the serviceHandle document for the service that entries are
110 public abstract void attachWSMenuEntry(JMenu wsmenu, final ServiceHandle serviceHandle,
111 final AlignFrame alignFrame);