Clover icon

Coverage Report

  1. Project Clover database Wed Dec 3 2025 17:03:17 GMT
  2. Package jalview.ws2.actions.annotation

File AnnotationAction.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
30% of files have more coverage

Code metrics

0
18
12
2
125
82
12
0.67
1.5
6
1

Classes

Class Line # Actions
AnnotationAction 15 11 7
0.4444444544.4%
AnnotationAction.Builder 20 7 5
1.0100%
 

Contributing tests

This file is covered by 74 tests. .

Source view

1    package jalview.ws2.actions.annotation;
2   
3    import java.util.List;
4    import java.util.Objects;
5   
6    import jalview.api.AlignViewportI;
7    import jalview.viewmodel.AlignmentViewport;
8    import jalview.ws.params.ArgumentI;
9    import jalview.ws2.actions.BaseAction;
10    import jalview.ws2.actions.api.TaskEventListener;
11    import jalview.ws2.actions.api.TaskI;
12    import jalview.ws2.api.Credentials;
13    import jalview.ws2.client.api.AnnotationWebServiceClientI;
14   
 
15    public class AnnotationAction extends BaseAction<AnnotationResult>
16    {
17    /**
18    * A builder of {@link AnnotationAction} instances.
19    */
 
20    public static class Builder extends BaseAction.Builder<AnnotationAction>
21    {
22    protected AnnotationWebServiceClientI client;
23   
24    protected boolean alignmentAnalysis = false;
25   
26    protected boolean requireAlignedSequences = false;
27   
28    protected boolean filterSymbols = true;
29   
 
30  684 toggle public Builder(AnnotationWebServiceClientI client)
31    {
32  684 super();
33  684 Objects.requireNonNull(client);
34  684 this.client = client;
35    }
36   
37    /**
38    * Set if action is an alignment analysis action.
39    */
 
40  239 toggle public void alignmentAnalysis(boolean val)
41    {
42  239 alignmentAnalysis = val;
43    }
44   
45    /**
46    * Set if action require aligned sequences.
47    */
 
48  239 toggle public void requireAlignedSequences(boolean val)
49    {
50  239 requireAlignedSequences = val;
51    }
52   
53    /**
54    * Set if action requires non-standard residues to be filtered out
55    */
 
56  239 toggle public void filterSymbols(boolean val)
57    {
58  239 filterSymbols = val;
59    }
60   
 
61  684 toggle public AnnotationAction build()
62    {
63  684 return new AnnotationAction(this);
64    }
65    }
66   
 
67  684 toggle public static Builder newBuilder(AnnotationWebServiceClientI client)
68    {
69  684 return new Builder(client);
70    }
71   
72    protected final AnnotationWebServiceClientI client;
73   
74    protected final boolean alignmentAnalysis;
75   
76    protected final boolean requireAlignedSequences;
77   
78    protected final boolean filterSymbols;
79   
 
80  684 toggle protected AnnotationAction(Builder builder)
81    {
82  684 super(builder);
83  684 client = builder.client;
84  684 alignmentAnalysis = builder.alignmentAnalysis;
85  684 requireAlignedSequences = builder.requireAlignedSequences;
86  684 filterSymbols = builder.filterSymbols;
87    }
88   
 
89  0 toggle @Override
90    public AnnotationTask createTask(AlignViewportI viewport,
91    List<ArgumentI> args, Credentials credentials)
92    {
93  0 return new AnnotationTask(client, this, args, credentials, viewport);
94    }
95   
96    /**
97    * Return if this action is an alignment analysis service.
98    */
 
99  0 toggle public boolean isAlignmentAnalysis()
100    {
101  0 return alignmentAnalysis;
102    }
103   
104    /**
105    * Return if this action require sequences to be aligned.
106    */
 
107  0 toggle public boolean getRequireAlignedSequences()
108    {
109  0 return requireAlignedSequences;
110    }
111   
112    /**
113    * Return if this action require non-standard symbols to be filtered out.
114    */
 
115  0 toggle public boolean getFilterSymbols()
116    {
117  0 return filterSymbols;
118    }
119   
 
120  0 toggle @Override
121    public boolean isActive(AlignmentViewport viewport)
122    {
123  0 return false;
124    }
125    }