1 package jalview.ws2.actions.annotation;
4 import java.util.Objects;
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;
15 public class AnnotationAction extends BaseAction<AnnotationResult>
18 * A builder of {@link AnnotationAction} instances.
20 public static class Builder extends BaseAction.Builder<AnnotationAction>
22 protected AnnotationWebServiceClientI client;
24 protected boolean alignmentAnalysis = false;
26 protected boolean requireAlignedSequences = false;
28 protected boolean filterSymbols = true;
30 public Builder(AnnotationWebServiceClientI client)
33 Objects.requireNonNull(client);
38 * Set if action is an alignment analysis action.
40 public void alignmentAnalysis(boolean val)
42 alignmentAnalysis = val;
46 * Set if action require aligned sequences.
48 public void requireAlignedSequences(boolean val)
50 requireAlignedSequences = val;
54 * Set if action requires non-standard residues to be filtered out
56 public void filterSymbols(boolean val)
61 public AnnotationAction build()
63 return new AnnotationAction(this);
67 public static Builder newBuilder(AnnotationWebServiceClientI client)
69 return new Builder(client);
72 protected final AnnotationWebServiceClientI client;
74 protected final boolean alignmentAnalysis;
76 protected final boolean requireAlignedSequences;
78 protected final boolean filterSymbols;
80 protected AnnotationAction(Builder builder)
83 client = builder.client;
84 alignmentAnalysis = builder.alignmentAnalysis;
85 requireAlignedSequences = builder.requireAlignedSequences;
86 filterSymbols = builder.filterSymbols;
90 public AnnotationTask createTask(AlignViewportI viewport,
91 List<ArgumentI> args, Credentials credentials)
93 return new AnnotationTask(client, this, args, credentials, viewport);
97 * Return if this action is an alignment analysis service.
99 public boolean isAlignmentAnalysis()
101 return alignmentAnalysis;
105 * Return if this action require sequences to be aligned.
107 public boolean getRequireAlignedSequences()
109 return requireAlignedSequences;
113 * Return if this action require non-standard symbols to be filtered out.
115 public boolean getFilterSymbols()
117 return filterSymbols;
121 public boolean isActive(AlignmentViewport viewport)