Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 16:11:35 GMT
  2. Package jalview.ws.api

File ServiceWithParameters.java

 

Coverage histogram

../../../img/srcFileCovDistChart4.png
49% of files have more coverage

Code metrics

14
21
13
2
112
88
22
1.05
1.62
6.5
1.69

Classes

Class Line # Actions
ServiceWithParameters 12 21 22
0.3958333439.6%
ServiceWithParameters.ServiceClient 89 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package jalview.ws.api;
2   
3    import jalview.bin.Cache;
4    import jalview.bin.Console;
5    import jalview.gui.AlignFrame;
6    import jalview.ws.jws2.MsaWSClient;
7    import jalview.ws.jws2.SequenceAnnotationWSClient;
8    import jalview.ws.params.ParamManager;
9   
10    import javax.swing.JMenu;
11   
 
12    public abstract class ServiceWithParameters extends UIinfo
13    {
14   
15    protected jalview.ws.uimodel.AlignAnalysisUIText aaui;
16   
 
17  570 toggle public ServiceWithParameters(String serviceType, String action,
18    String name, String description, String hosturl)
19    {
20  570 super(serviceType, action, name, description, hosturl);
21    }
22   
23    public abstract void initParamStore(ParamManager userParameterStore);
24   
 
25  12289 toggle public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
26    {
27  12289 return aaui;
28    }
29   
 
30  570 toggle public void setAlignAnalysisUI(
31    jalview.ws.uimodel.AlignAnalysisUIText aaui)
32    {
33  570 this.aaui = aaui;
34    }
35   
 
36  12289 toggle public boolean isInteractiveUpdate()
37    {
38  12289 return aaui != null && aaui.isAA();
39    }
40    // config flags for SeqAnnotationServiceCalcWorker
41   
 
42  0 toggle public boolean isProteinService()
43    {
44  0 return aaui == null ? true : aaui.isPr();
45    }
46   
 
47  0 toggle public boolean isNucleotideService()
48    {
49  0 return aaui == null ? false : aaui.isNa();
50    }
51   
 
52  0 toggle public boolean isNeedsAlignedSequences()
53    {
54  0 return aaui == null ? false : aaui.isNeedsAlignedSeqs();
55    }
56   
 
57  0 toggle public boolean isAlignmentAnalysis()
58    {
59  0 return aaui == null ? false : aaui.isAA();
60    }
61   
 
62  0 toggle public boolean isFilterSymbols()
63    {
64  0 return aaui != null ? aaui.isFilterSymbols() : true;
65    }
66   
 
67  0 toggle public int getMinimumInputSequences()
68    {
69  0 return aaui != null ? aaui.getMinimumSequences() : 1;
70    }
71   
 
72  0 toggle public String getNameURI()
73    {
74  0 return "java:" + getName();
75    }
76   
 
77  1144 toggle public String getUri()
78    {
79    // TODO verify that service parameter sets in projects are consistent with
80    // Jalview 2.10.4
81    // this is only valid for Jaba 1.0 - this formula might have to change!
82  1144 return getHostURL()
83  1144 + (getHostURL().lastIndexOf("/") == (getHostURL().length() - 1)
84    ? ""
85    : "/")
86    + getName();
87    }
88   
 
89    protected enum ServiceClient
90    {
91    MSAWSCLIENT, SEQUENCEANNOTATIONWSCLIENT;
92    };
93   
94    protected ServiceClient style = null;
95   
 
96  12289 toggle public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
97    {
98  12289 switch (style)
99    {
100  9141 case MSAWSCLIENT:
101  9141 new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
102  9141 break;
103  3148 case SEQUENCEANNOTATIONWSCLIENT:
104  3148 new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this,
105    alignFrame);
106  3148 break;
107  0 default:
108  0 Console.warn("Implementation error ? Service " + getName()
109    + " has Unknown service style " + style);
110    }
111    }
112    }