1 package jalview.ws.api;
3 import jalview.bin.Cache;
4 import jalview.gui.AlignFrame;
5 import jalview.ws.jws2.MsaWSClient;
6 import jalview.ws.jws2.SequenceAnnotationWSClient;
7 import jalview.ws.params.ParamManager;
9 import javax.swing.JMenu;
11 public abstract class ServiceWithParameters extends UIinfo
14 protected jalview.ws.uimodel.AlignAnalysisUIText aaui;
16 public ServiceWithParameters(String serviceType, String action,
17 String name, String description, String hosturl)
19 super(serviceType, action, name, description, hosturl);
22 public abstract void initParamStore(ParamManager userParameterStore);
24 public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
29 public void setAlignAnalysisUI(
30 jalview.ws.uimodel.AlignAnalysisUIText aaui)
35 public boolean isInteractiveUpdate()
37 return aaui != null && aaui.isAA();
39 // config flags for SeqAnnotationServiceCalcWorker
41 public boolean isProteinService()
43 return aaui == null ? true : aaui.isPr();
46 public boolean isNucleotideService()
48 return aaui == null ? false : aaui.isNa();
51 public boolean isNeedsAlignedSequences()
53 return aaui == null ? false : aaui.isNeedsAlignedSeqs();
56 public boolean isAlignmentAnalysis()
58 return aaui == null ? false : aaui.isAA();
61 public boolean isFilterSymbols()
63 return aaui != null ? aaui.isFilterSymbols() : true;
66 public int getMinimumInputSequences()
68 return aaui != null ? aaui.getMinimumSequences() : 1;
71 public String getNameURI()
73 return "java:" + getName();
76 public String getUri()
78 // TODO verify that service parameter sets in projects are consistent with
80 // this is only valid for Jaba 1.0 - this formula might have to change!
82 + (getHostURL().lastIndexOf("/") == (getHostURL().length() - 1)
88 protected enum ServiceClient
90 MSAWSCLIENT, SEQUENCEANNOTATIONWSCLIENT;
93 protected ServiceClient style = null;
95 public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
100 new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
102 case SEQUENCEANNOTATIONWSCLIENT:
103 new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this,
107 Cache.log.warn("Implementation error ? Service " + getName()
108 + " has Unknown service style " + style);