6 import jalview.gui.AlignFrame;
7 import jalview.gui.WebserviceInfo;
9 import javax.swing.JMenu;
11 import ext.vamsas.ServiceHandle;
14 * JWS1 Specific UI attributes and methods
18 public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI
22 * original service handle that this client was derived from
24 ServiceHandle serviceHandle = null;
35 * initialise WSClient service information attributes from the service handle
38 * @return the service instance information GUI for this client and job.
40 protected WebserviceInfo setWebService(ServiceHandle sh)
42 return setWebService(sh, false);
46 * initialise WSClient service information attributes from the service handle
50 * true implies no GUI objects will be created.
51 * @return the service instance information GUI for this client and job.
53 protected WebserviceInfo setWebService(ServiceHandle sh, boolean headless)
55 WebServiceName = sh.getName();
56 if (ServiceActions.containsKey(sh.getAbstractName()))
58 WebServiceJobTitle = sh.getName(); // TODO: control sh.Name specification
60 // add this for short names. +(String)
61 // ServiceActions.get(sh.getAbstractName());
65 WebServiceJobTitle = sh.getAbstractName() + " using " + sh.getName();
68 WebServiceReference = sh.getDescription();
69 WsURL = sh.getEndpointURL();
70 WebserviceInfo wsInfo = null;
73 wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceReference);
79 * convenience method to pass the serviceHandle reference that instantiated
80 * this service on to the menu entry constructor
83 * the menu to which any menu entries/sub menus are to be attached
85 * the alignFrame instance that provides input data for the service
87 public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame)
89 if (serviceHandle == null)
92 "IMPLEMENTATION ERROR: cannot attach WS Menu Entry without service handle reference!");
94 attachWSMenuEntry(wsmenu, serviceHandle, alignFrame);
98 * method implemented by each concrete WS1Client implementation that creates menu
99 * entries that enact their service using data from alignFrame.
102 * where new menu entries (and submenus) are to be attached
103 * @param serviceHandle
104 * the serviceHandle document for the service that entries are
108 public abstract void attachWSMenuEntry(JMenu wsmenu, final ServiceHandle serviceHandle,
109 final AlignFrame alignFrame);