1 package jalview.ws.api;
3 import jalview.bin.Cache;
4 import jalview.gui.AlignFrame;
5 import jalview.ws.jws2.JPredClient;
6 import jalview.ws.jws2.MsaWSClient;
7 import jalview.ws.jws2.SequenceAnnotationWSClient;
8 import jalview.ws.params.ParamManager;
10 import javax.swing.JMenu;
12 public abstract class ServiceWithParameters extends UIinfo
13 implements JalviewServiceEndpointProviderI
16 protected jalview.ws.uimodel.AlignAnalysisUIText aaui;
18 public ServiceWithParameters(String serviceType, String action,
19 String name, String description, String hosturl)
21 super(serviceType, action, name, description, hosturl);
24 public abstract void initParamStore(ParamManager userParameterStore);
26 public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
31 public void setAlignAnalysisUI(
32 jalview.ws.uimodel.AlignAnalysisUIText aaui)
37 public boolean isInteractiveUpdate()
39 return aaui != null && aaui.isAA();
41 // config flags for SeqAnnotationServiceCalcWorker
43 public boolean isProteinService()
45 return aaui == null ? true : aaui.isPr();
48 public boolean isNucleotideService()
50 return aaui == null ? false : aaui.isNa();
53 public boolean isNeedsAlignedSequences()
55 return aaui == null ? false : aaui.isNeedsAlignedSeqs();
58 public boolean isAlignmentAnalysis()
60 return aaui == null ? false : aaui.isAA();
63 public boolean isFilterSymbols()
65 return aaui != null ? aaui.isFilterSymbols() : true;
68 public int getMinimumInputSequences()
70 return aaui != null ? aaui.getMinimumSequences() : 1;
73 public String getNameURI()
75 return "java:" + getName();
78 public String getUri()
80 // TODO verify that service parameter sets in projects are consistent with
82 // this is only valid for Jaba 1.0 - this formula might have to change!
84 + (getHostURL().lastIndexOf("/") == (getHostURL().length() - 1)
90 protected enum ServiceClient
92 MSAWSCLIENT, SEQUENCEANNOTATIONWSCLIENT, JPREDWSCLIENT;
95 protected ServiceClient style = null;
97 public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
102 new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
105 JPredClient.getMenuEntryProvider(this).attachWSMenuEntry(atpoint, alignFrame);
107 case SEQUENCEANNOTATIONWSCLIENT:
108 new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this,
112 Cache.log.warn("Implementation error ? Service " + getName()
113 + " has Unknown service style " + style);