Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 16:11:35 GMT
  2. Package jalview.ws2.actions.alignment

File AlignmentAction.java

 

Coverage histogram

../../../../img/srcFileCovDistChart9.png
13% of files have more coverage

Code metrics

0
11
7
2
91
59
7
0.64
1.57
3.5
1

Classes

Class Line # Actions
AlignmentAction 25 6 4
0.880%
AlignmentAction.Builder 33 5 3
1.0100%
 

Contributing tests

This file is covered by 118 tests. .

Source view

1    package jalview.ws2.actions.alignment;
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.BaseTask;
11    import jalview.ws2.actions.PollingTaskExecutor;
12    import jalview.ws2.actions.api.TaskEventListener;
13    import jalview.ws2.actions.api.TaskI;
14    import jalview.ws2.api.Credentials;
15    import jalview.ws2.client.api.AlignmentWebServiceClientI;
16   
17    /**
18    * Implementation of the {@link BaseAction} that runs alignment services. This
19    * type of action requires {@link AlignmentWebServiceClientI} to retrieve
20    * alignment result from the server.
21    *
22    * @author mmwarowny
23    *
24    */
 
25    public class AlignmentAction extends BaseAction<AlignmentResult>
26    {
27    /**
28    * A builder for AlignemntActions. Adds {@code client} and {@code submitGaps}
29    * parameters to the base builder.
30    *
31    * @author mmwarowny
32    */
 
33    public static class Builder extends BaseAction.Builder<AlignmentAction>
34    {
35    protected AlignmentWebServiceClientI client;
36   
37    protected boolean submitGaps = false;
38   
 
39  843 toggle public Builder(AlignmentWebServiceClientI client)
40    {
41  843 super();
42  843 Objects.requireNonNull(client);
43  843 this.client = client;
44    }
45   
 
46  235 toggle public void submitGaps(boolean val)
47    {
48  235 submitGaps = val;
49    }
50   
 
51  1070 toggle public AlignmentAction build()
52    {
53  1070 return new AlignmentAction(this);
54    }
55    }
56   
 
57  843 toggle public static Builder newBuilder(AlignmentWebServiceClientI client)
58    {
59  843 return new Builder(client);
60    }
61   
62    protected final boolean submitGaps;
63   
64    protected final AlignmentWebServiceClientI client;
65   
 
66  1070 toggle public AlignmentAction(Builder builder)
67    {
68  1070 super(builder);
69  1070 submitGaps = builder.submitGaps;
70  1070 client = builder.client;
71    }
72   
 
73  26 toggle @Override
74    public AlignmentTask createTask(AlignViewportI viewport,
75    List<ArgumentI> args, Credentials credentials)
76    {
77  26 return new AlignmentTask(
78    client, this, args, credentials, viewport, submitGaps);
79    }
80   
81    /**
82    * Returns if the action is active for the given viewport. Alignment services
83    * are non-interactive, so the action is never active.
84    */
 
85  0 toggle @Override
86    public boolean isActive(AlignmentViewport viewport)
87    {
88  0 return false;
89    }
90   
91    }