1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.commands; |
22 |
|
|
23 |
|
import jalview.datamodel.SequenceI; |
24 |
|
|
|
|
| 0% |
Uncovered Elements: 45 (45) |
Complexity: 11 |
Complexity Density: 0.42 |
|
25 |
|
public class SlideSequencesCommand extends EditCommand |
26 |
|
{ |
27 |
|
boolean gapsInsertedBegin = false; |
28 |
|
|
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 5 |
Complexity Density: 0.31 |
|
29 |
0 |
public SlideSequencesCommand(String description, SequenceI[] seqsLeft,... |
30 |
|
SequenceI[] seqsRight, int slideSize, char gapChar) |
31 |
|
{ |
32 |
0 |
this.description = description; |
33 |
|
|
34 |
0 |
int lSize = seqsLeft.length; |
35 |
0 |
gapsInsertedBegin = false; |
36 |
0 |
int i, j; |
37 |
0 |
for (i = 0; i < lSize; i++) |
38 |
|
{ |
39 |
0 |
for (j = 0; j < slideSize; j++) |
40 |
|
{ |
41 |
0 |
if (!jalview.util.Comparison.isGap(seqsLeft[i].getCharAt(j))) |
42 |
|
{ |
43 |
0 |
gapsInsertedBegin = true; |
44 |
0 |
break; |
45 |
|
} |
46 |
|
} |
47 |
|
} |
48 |
|
|
49 |
0 |
Edit e = null; |
50 |
|
|
51 |
0 |
if (!gapsInsertedBegin) |
52 |
|
{ |
53 |
0 |
e = new Edit(Action.DELETE_GAP, seqsLeft, 0, slideSize, gapChar); |
54 |
0 |
setEdit(e); |
55 |
|
} |
56 |
|
else |
57 |
|
{ |
58 |
0 |
e = new Edit(Action.INSERT_GAP, seqsRight, 0, slideSize, gapChar); |
59 |
0 |
setEdit(e); |
60 |
|
} |
61 |
|
|
62 |
0 |
performEdit(e, null); |
63 |
|
} |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
0 |
public boolean getGapsInsertedBegin()... |
66 |
|
{ |
67 |
0 |
return gapsInsertedBegin; |
68 |
|
} |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 5 |
Complexity Density: 0.56 |
|
70 |
0 |
public boolean appendSlideCommand(SlideSequencesCommand command)... |
71 |
|
{ |
72 |
0 |
boolean same = false; |
73 |
|
|
74 |
0 |
if (command.getEdit(0).seqs.length == getEdit(0).seqs.length) |
75 |
|
{ |
76 |
0 |
same = true; |
77 |
0 |
for (int i = 0; i < command.getEdit(0).seqs.length; i++) |
78 |
|
{ |
79 |
0 |
if (getEdit(0).seqs[i] != command.getEdit(0).seqs[i]) |
80 |
|
{ |
81 |
0 |
same = false; |
82 |
|
} |
83 |
|
} |
84 |
|
} |
85 |
|
|
86 |
0 |
if (same) |
87 |
|
{ |
88 |
0 |
command.addEdit(getEdit(0)); |
89 |
|
} |
90 |
|
|
91 |
0 |
return same; |
92 |
|
} |
93 |
|
} |