JAL-3070 rough-and-ready refactor of JABA SequenceAnnotation style services - needs...
[jalview.git] / src / jalview / ws / jws2 / Jws2Client.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.ws.jws2;
22
23 import jalview.gui.AlignFrame;
24 import jalview.ws.api.ServiceWithParameters;
25 import jalview.ws.params.ArgumentI;
26 import jalview.ws.params.WsParamSetI;
27
28 import java.util.List;
29
30 import javax.swing.JMenu;
31
32 /**
33  * provides metadata for a jabaws2 service instance - resolves names, etc.
34  * 
35  * @author JimP
36  * 
37  */
38 public abstract class Jws2Client extends jalview.ws.WSClient
39 {
40   /**
41    * instantiate a new service client. preset and arguments are assumed to be
42    * valid for the service
43    * 
44    * @param _alignFrame
45    * @param preset
46    * @param arguments
47    */
48   public Jws2Client(AlignFrame _alignFrame, WsParamSetI preset,
49           List<ArgumentI> arguments)
50   {
51     super(_alignFrame, preset, arguments);
52   }
53
54   public Jws2Client()
55   {
56     // anonymous constructor - used for headless method calls only
57   }
58
59   /*
60    * Jws2Instance serviceHandle; (non-Javadoc)
61    * 
62    * @see jalview.ws.WSMenuEntryProviderI#attachWSMenuEntry(javax.swing.JMenu,
63    * jalview.gui.AlignFrame)
64    * 
65    * @Override public void attachWSMenuEntry(JMenu wsmenu, AlignFrame
66    * alignFrame) { if (serviceHandle==null) { throw new
67    * Error("Implementation error: No service handle for this Jws2 service."); }
68    * attachWSMenuEntry(wsmenu, serviceHandle, alignFrame); }
69    */
70   /**
71    * add the menu item for a particular jws2 service instance
72    * 
73    * @param wsmenu
74    * @param service
75    * @param alignFrame
76    */
77   abstract void attachWSMenuEntry(JMenu wsmenu,
78           final ServiceWithParameters service,
79           final AlignFrame alignFrame);
80 }