1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui; |
22 |
|
|
23 |
|
import java.awt.Container; |
24 |
|
import java.awt.Dimension; |
25 |
|
import java.awt.FlowLayout; |
26 |
|
import java.awt.Font; |
27 |
|
import java.awt.FontMetrics; |
28 |
|
import java.awt.Rectangle; |
29 |
|
import java.io.File; |
30 |
|
import java.util.ArrayList; |
31 |
|
import java.util.Hashtable; |
32 |
|
import java.util.List; |
33 |
|
|
34 |
|
import javax.swing.JInternalFrame; |
35 |
|
|
36 |
|
import jalview.analysis.AlignmentUtils; |
37 |
|
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; |
38 |
|
import jalview.api.AlignViewportI; |
39 |
|
import jalview.api.AlignmentViewPanel; |
40 |
|
import jalview.api.FeatureColourI; |
41 |
|
import jalview.api.FeatureSettingsModelI; |
42 |
|
import jalview.api.FeaturesDisplayedI; |
43 |
|
import jalview.api.ViewStyleI; |
44 |
|
import jalview.bin.Cache; |
45 |
|
import jalview.bin.Console; |
46 |
|
import jalview.commands.CommandI; |
47 |
|
import jalview.datamodel.AlignedCodonFrame; |
48 |
|
import jalview.datamodel.Alignment; |
49 |
|
import jalview.datamodel.AlignmentI; |
50 |
|
import jalview.datamodel.ColumnSelection; |
51 |
|
import jalview.datamodel.ContactMatrixI; |
52 |
|
import jalview.datamodel.HiddenColumns; |
53 |
|
import jalview.datamodel.SearchResults; |
54 |
|
import jalview.datamodel.SearchResultsI; |
55 |
|
import jalview.datamodel.SequenceGroup; |
56 |
|
import jalview.datamodel.SequenceI; |
57 |
|
import jalview.io.AppletFormatAdapter; |
58 |
|
import jalview.io.DataSourceType; |
59 |
|
import jalview.io.FileFormatException; |
60 |
|
import jalview.io.FileFormatI; |
61 |
|
import jalview.io.FileFormats; |
62 |
|
import jalview.io.FileLoader; |
63 |
|
import jalview.io.IdentifyFile; |
64 |
|
import jalview.renderer.ResidueShader; |
65 |
|
import jalview.schemes.ColourSchemeI; |
66 |
|
import jalview.schemes.ColourSchemeProperty; |
67 |
|
import jalview.schemes.ResidueColourScheme; |
68 |
|
import jalview.schemes.UserColourScheme; |
69 |
|
import jalview.structure.SelectionSource; |
70 |
|
import jalview.structure.StructureSelectionManager; |
71 |
|
import jalview.structure.VamsasSource; |
72 |
|
import jalview.util.ColorUtils; |
73 |
|
import jalview.util.MessageManager; |
74 |
|
import jalview.viewmodel.AlignmentViewport; |
75 |
|
import jalview.ws.params.AutoCalcSetting; |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
@author |
81 |
|
@version |
82 |
|
|
|
|
| 64.4% |
Uncovered Elements: 166 (466) |
Complexity: 129 |
Complexity Density: 0.44 |
|
83 |
|
public class AlignViewport extends AlignmentViewport |
84 |
|
implements SelectionSource |
85 |
|
{ |
86 |
|
Font font; |
87 |
|
|
88 |
|
boolean cursorMode = false; |
89 |
|
|
90 |
|
boolean antiAlias = false; |
91 |
|
|
92 |
|
private Rectangle explodedGeometry = null; |
93 |
|
|
94 |
|
private String viewName = null; |
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
private boolean gatherViewsHere = false; |
104 |
|
|
105 |
|
private AnnotationColumnChooser annotationColumnSelectionState; |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
@param |
111 |
|
|
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
113 |
38 |
public AlignViewport(AlignmentI al)... |
114 |
|
{ |
115 |
38 |
super(al); |
116 |
38 |
init(); |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
@param |
123 |
|
@param |
124 |
|
|
125 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
126 |
0 |
public AlignViewport(AlignmentI al, String seqsetid)... |
127 |
|
{ |
128 |
0 |
this(al, seqsetid, null); |
129 |
|
} |
130 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
131 |
0 |
public AlignViewport(AlignmentI al, String seqsetid, String viewid)... |
132 |
|
{ |
133 |
0 |
super(al); |
134 |
0 |
sequenceSetID = seqsetid; |
135 |
0 |
viewId = viewid; |
136 |
|
|
137 |
0 |
if (seqsetid != null) |
138 |
|
{ |
139 |
0 |
Console.debug( |
140 |
|
"Setting viewport's sequence set id : " + sequenceSetID); |
141 |
|
} |
142 |
0 |
if (viewId != null) |
143 |
|
{ |
144 |
0 |
Console.debug("Setting viewport's view id : " + viewId); |
145 |
|
} |
146 |
0 |
init(); |
147 |
|
|
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
@param |
154 |
|
|
155 |
|
@param |
156 |
|
|
157 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
158 |
28 |
public AlignViewport(AlignmentI al, HiddenColumns hiddenColumns)... |
159 |
|
{ |
160 |
28 |
super(al); |
161 |
28 |
if (hiddenColumns != null) |
162 |
|
{ |
163 |
28 |
al.setHiddenColumns(hiddenColumns); |
164 |
|
} |
165 |
28 |
init(); |
166 |
|
} |
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
|
171 |
|
@param |
172 |
|
@param |
173 |
|
@param |
174 |
|
|
175 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
176 |
0 |
public AlignViewport(AlignmentI al, HiddenColumns hiddenColumns,... |
177 |
|
String seqsetid) |
178 |
|
{ |
179 |
0 |
this(al, hiddenColumns, seqsetid, null); |
180 |
|
} |
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
@param |
186 |
|
@param |
187 |
|
@param |
188 |
|
|
189 |
|
@param |
190 |
|
|
191 |
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (16) |
Complexity: 4 |
Complexity Density: 0.4 |
|
192 |
439 |
public AlignViewport(AlignmentI al, HiddenColumns hiddenColumns,... |
193 |
|
String seqsetid, String viewid) |
194 |
|
{ |
195 |
439 |
super(al); |
196 |
439 |
sequenceSetID = seqsetid; |
197 |
439 |
viewId = viewid; |
198 |
|
|
199 |
439 |
if (seqsetid != null) |
200 |
|
{ |
201 |
82 |
Console.debug( |
202 |
|
"Setting viewport's sequence set id : " + sequenceSetID); |
203 |
|
} |
204 |
439 |
if (viewId != null) |
205 |
|
{ |
206 |
72 |
Console.debug("Setting viewport's view id : " + viewId); |
207 |
|
} |
208 |
|
|
209 |
439 |
if (hiddenColumns != null) |
210 |
|
{ |
211 |
0 |
al.setHiddenColumns(hiddenColumns); |
212 |
|
} |
213 |
439 |
init(); |
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 1 |
Complexity Density: 0.06 |
|
219 |
505 |
private void applyViewProperties()... |
220 |
|
{ |
221 |
505 |
antiAlias = Cache.getDefault("ANTI_ALIAS", true); |
222 |
|
|
223 |
505 |
viewStyle.setShowJVSuffix(Cache.getDefault("SHOW_JVSUFFIX", true)); |
224 |
505 |
setShowAnnotation(Cache.getDefault("SHOW_ANNOTATIONS", true)); |
225 |
|
|
226 |
505 |
setRightAlignIds(Cache.getDefault("RIGHT_ALIGN_IDS", false)); |
227 |
505 |
setCentreColumnLabels(Cache.getDefault("CENTRE_COLUMN_LABELS", false)); |
228 |
505 |
autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true); |
229 |
|
|
230 |
505 |
setPadGaps(Cache.getDefault("PAD_GAPS", true)); |
231 |
505 |
setShowNPFeats(Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true)); |
232 |
505 |
setShowDBRefs(Cache.getDefault("SHOW_DBREFS_TOOLTIP", true)); |
233 |
505 |
viewStyle.setSeqNameItalics(Cache.getDefault("ID_ITALICS", true)); |
234 |
505 |
viewStyle.setWrapAlignment(Cache.getDefault("WRAP_ALIGNMENT", false)); |
235 |
505 |
viewStyle.setShowUnconserved( |
236 |
|
Cache.getDefault("SHOW_UNCONSERVED", false)); |
237 |
505 |
sortByTree = Cache.getDefault("SORT_BY_TREE", false); |
238 |
505 |
followSelection = Cache.getDefault("FOLLOW_SELECTIONS", true); |
239 |
505 |
sortAnnotationsBy = SequenceAnnotationOrder |
240 |
|
.valueOf(Cache.getDefault(Preferences.SORT_ANNOTATIONS, |
241 |
|
SequenceAnnotationOrder.NONE.name())); |
242 |
505 |
showAutocalculatedAbove = Cache |
243 |
|
.getDefault(Preferences.SHOW_AUTOCALC_ABOVE, false); |
244 |
505 |
viewStyle.setScaleProteinAsCdna( |
245 |
|
Cache.getDefault(Preferences.SCALE_PROTEIN_TO_CDNA, true)); |
246 |
505 |
viewStyle.setShowStructureProvider( |
247 |
|
Cache.getDefault(Preferences.SHOW_STRUC_PROVIDER, false)); |
248 |
|
} |
249 |
|
|
|
|
| 83% |
Uncovered Elements: 9 (53) |
Complexity: 10 |
Complexity Density: 0.27 |
|
250 |
505 |
void init()... |
251 |
|
{ |
252 |
505 |
applyViewProperties(); |
253 |
|
|
254 |
505 |
String fontName = Cache.getDefault("FONT_NAME", "SansSerif"); |
255 |
505 |
String fontStyle = Cache.getDefault("FONT_STYLE", Font.PLAIN + ""); |
256 |
505 |
String fontSize = Cache.getDefault("FONT_SIZE", "10"); |
257 |
|
|
258 |
505 |
int style = 0; |
259 |
|
|
260 |
505 |
if (fontStyle.equals("bold")) |
261 |
|
{ |
262 |
0 |
style = 1; |
263 |
|
} |
264 |
505 |
else if (fontStyle.equals("italic")) |
265 |
|
{ |
266 |
0 |
style = 2; |
267 |
|
} |
268 |
|
|
269 |
505 |
setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true); |
270 |
|
|
271 |
505 |
alignment |
272 |
|
.setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0)); |
273 |
|
|
274 |
|
|
275 |
|
|
276 |
505 |
if (hconsensus == null && !isDataset) |
277 |
|
{ |
278 |
505 |
if (!alignment.isNucleotide()) |
279 |
|
{ |
280 |
394 |
showConservation = Cache.getDefault("SHOW_CONSERVATION", true); |
281 |
394 |
showQuality = Cache.getDefault("SHOW_QUALITY", true); |
282 |
394 |
showGroupConservation = Cache.getDefault("SHOW_GROUP_CONSERVATION", |
283 |
|
false); |
284 |
|
} |
285 |
505 |
showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM", |
286 |
|
true); |
287 |
505 |
showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", true); |
288 |
505 |
normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO", |
289 |
|
false); |
290 |
505 |
showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false); |
291 |
505 |
showConsensus = Cache.getDefault("SHOW_IDENTITY", true); |
292 |
|
|
293 |
505 |
showSSConsensus = Cache.getDefault("SHOW_SS_CONSENSUS", false); |
294 |
|
|
295 |
505 |
showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true); |
296 |
|
} |
297 |
505 |
initAutoAnnotation(); |
298 |
505 |
String colourProperty = alignment.isNucleotide() |
299 |
|
? Preferences.DEFAULT_COLOUR_NUC |
300 |
|
: Preferences.DEFAULT_COLOUR_PROT; |
301 |
505 |
String schemeName = Cache.getProperty(colourProperty); |
302 |
505 |
if (schemeName == null) |
303 |
|
{ |
304 |
|
|
305 |
494 |
schemeName = Cache.getDefault(Preferences.DEFAULT_COLOUR, |
306 |
|
ResidueColourScheme.NONE); |
307 |
|
} |
308 |
505 |
ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(this, |
309 |
|
alignment, schemeName); |
310 |
505 |
residueShading = new ResidueShader(colourScheme); |
311 |
|
|
312 |
505 |
if (colourScheme instanceof UserColourScheme) |
313 |
|
{ |
314 |
0 |
residueShading = new ResidueShader( |
315 |
|
UserDefinedColours.loadDefaultColours()); |
316 |
0 |
residueShading.setThreshold(0, isIgnoreGapsConsensus()); |
317 |
|
} |
318 |
|
|
319 |
505 |
if (residueShading != null) |
320 |
|
{ |
321 |
505 |
residueShading.setConsensus(hconsensus); |
322 |
505 |
residueShading.setSSConsensusProfileMap(hSSConsensusProfileMap); |
323 |
|
} |
324 |
505 |
setColourAppliesToAllGroups(true); |
325 |
|
} |
326 |
|
|
327 |
|
boolean validCharWidth; |
328 |
|
|
329 |
|
|
330 |
|
@inheritDoc |
331 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
|
332 |
671 |
@Override... |
333 |
|
public void setFont(Font f, boolean setGrid) |
334 |
|
{ |
335 |
671 |
font = f; |
336 |
|
|
337 |
671 |
Container c = new Container(); |
338 |
|
|
339 |
671 |
if (setGrid) |
340 |
|
{ |
341 |
549 |
FontMetrics fm = c.getFontMetrics(font); |
342 |
549 |
int ww = fm.charWidth('M'); |
343 |
549 |
setCharHeight(fm.getHeight()); |
344 |
549 |
setCharWidth(ww); |
345 |
|
} |
346 |
671 |
viewStyle.setFontName(font.getName()); |
347 |
671 |
viewStyle.setFontStyle(font.getStyle()); |
348 |
671 |
viewStyle.setFontSize(font.getSize()); |
349 |
|
|
350 |
671 |
validCharWidth = true; |
351 |
|
} |
352 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
353 |
82 |
@Override... |
354 |
|
public void setViewStyle(ViewStyleI settingsForView) |
355 |
|
{ |
356 |
82 |
super.setViewStyle(settingsForView); |
357 |
82 |
setFont(new Font(viewStyle.getFontName(), viewStyle.getFontStyle(), |
358 |
|
viewStyle.getFontSize()), false); |
359 |
|
} |
360 |
|
|
361 |
|
|
362 |
|
|
363 |
|
|
364 |
|
@return |
365 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
366 |
29193 |
public Font getFont()... |
367 |
|
{ |
368 |
29193 |
return font; |
369 |
|
} |
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
@param |
375 |
|
|
376 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
377 |
757 |
@Override... |
378 |
|
public void setAlignment(AlignmentI align) |
379 |
|
{ |
380 |
757 |
replaceMappings(align); |
381 |
757 |
super.setAlignment(align); |
382 |
|
} |
383 |
|
|
384 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
@param |
389 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
390 |
767 |
public void replaceMappings(AlignmentI align)... |
391 |
|
{ |
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
767 |
deregisterMappings(); |
397 |
|
|
398 |
|
|
399 |
|
|
400 |
|
|
401 |
767 |
if (align != null) |
402 |
|
{ |
403 |
515 |
StructureSelectionManager ssm = StructureSelectionManager |
404 |
|
.getStructureSelectionManager(Desktop.instance); |
405 |
515 |
ssm.registerMappings(align.getCodonFrames()); |
406 |
|
} |
407 |
|
|
408 |
|
|
409 |
|
|
410 |
|
|
411 |
767 |
if (alignment != null && align != null) |
412 |
|
{ |
413 |
10 |
alignment.setCodonFrames(align.getCodonFrames()); |
414 |
|
} |
415 |
|
} |
416 |
|
|
|
|
| 92.9% |
Uncovered Elements: 1 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
417 |
767 |
protected void deregisterMappings()... |
418 |
|
{ |
419 |
767 |
AlignmentI al = getAlignment(); |
420 |
767 |
if (al != null) |
421 |
|
{ |
422 |
262 |
List<AlignedCodonFrame> mappings = al.getCodonFrames(); |
423 |
262 |
if (mappings != null) |
424 |
|
{ |
425 |
262 |
StructureSelectionManager ssm = StructureSelectionManager |
426 |
|
.getStructureSelectionManager(Desktop.instance); |
427 |
262 |
for (AlignedCodonFrame acf : mappings) |
428 |
|
{ |
429 |
125 |
if (noReferencesTo(acf)) |
430 |
|
{ |
431 |
27 |
ssm.deregisterMapping(acf); |
432 |
|
} |
433 |
|
} |
434 |
|
} |
435 |
|
} |
436 |
|
} |
437 |
|
|
438 |
|
|
439 |
|
|
440 |
|
|
441 |
|
@return |
442 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
443 |
32 |
@Override... |
444 |
|
public char getGapCharacter() |
445 |
|
{ |
446 |
32 |
return getAlignment().getGapCharacter(); |
447 |
|
} |
448 |
|
|
449 |
|
|
450 |
|
|
451 |
|
|
452 |
|
@param |
453 |
|
|
454 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
455 |
0 |
public void setGapCharacter(char gap)... |
456 |
|
{ |
457 |
0 |
if (getAlignment() != null) |
458 |
|
{ |
459 |
0 |
getAlignment().setGapCharacter(gap); |
460 |
|
} |
461 |
|
} |
462 |
|
|
463 |
|
|
464 |
|
|
465 |
|
|
466 |
|
@return |
467 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
468 |
1 |
public long[] getUndoRedoHash()... |
469 |
|
{ |
470 |
|
|
471 |
1 |
if (historyList == null || redoList == null) |
472 |
|
{ |
473 |
0 |
return new long[] { -1, -1 }; |
474 |
|
} |
475 |
1 |
return new long[] { historyList.hashCode(), this.redoList.hashCode() }; |
476 |
|
} |
477 |
|
|
478 |
|
|
479 |
|
|
480 |
|
|
481 |
|
|
482 |
|
@param |
483 |
|
|
484 |
|
@return |
485 |
|
|
486 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 5 |
Complexity Density: 0.56 |
|
487 |
0 |
public boolean isUndoRedoHashModified(long[] undoredo)... |
488 |
|
{ |
489 |
0 |
if (undoredo == null) |
490 |
|
{ |
491 |
0 |
return true; |
492 |
|
} |
493 |
0 |
long[] cstate = getUndoRedoHash(); |
494 |
0 |
if (cstate.length != undoredo.length) |
495 |
|
{ |
496 |
0 |
return true; |
497 |
|
} |
498 |
|
|
499 |
0 |
for (int i = 0; i < cstate.length; i++) |
500 |
|
{ |
501 |
0 |
if (cstate[i] != undoredo[i]) |
502 |
|
{ |
503 |
0 |
return true; |
504 |
|
} |
505 |
|
} |
506 |
0 |
return false; |
507 |
|
} |
508 |
|
|
509 |
|
public boolean followSelection = true; |
510 |
|
|
511 |
|
|
512 |
|
@return |
513 |
|
|
514 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
515 |
0 |
public boolean getFollowSelection()... |
516 |
|
{ |
517 |
0 |
return followSelection; |
518 |
|
} |
519 |
|
|
520 |
|
|
521 |
|
|
522 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
523 |
23 |
@Override... |
524 |
|
public void sendSelection() |
525 |
|
{ |
526 |
23 |
jalview.structure.StructureSelectionManager |
527 |
|
.getStructureSelectionManager(Desktop.instance) |
528 |
|
.sendSelection(new SequenceGroup(getSelectionGroup()), |
529 |
|
new ColumnSelection(getColumnSelection()), |
530 |
|
new HiddenColumns(getAlignment().getHiddenColumns()), |
531 |
|
this); |
532 |
|
} |
533 |
|
|
534 |
|
|
535 |
|
|
536 |
|
|
537 |
|
|
538 |
|
@param |
539 |
|
@return |
540 |
|
|
541 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 4 |
Complexity Density: 0.8 |
|
542 |
1605 |
public AlignmentPanel getAlignPanel()... |
543 |
|
{ |
544 |
1605 |
AlignmentPanel[] aps = PaintRefresher |
545 |
|
.getAssociatedPanels(this.getSequenceSetId()); |
546 |
2043 |
for (int p = 0; aps != null && p < aps.length; p++) |
547 |
|
{ |
548 |
1599 |
if (aps[p].av == this) |
549 |
|
{ |
550 |
1161 |
return aps[p]; |
551 |
|
} |
552 |
|
} |
553 |
444 |
return null; |
554 |
|
} |
555 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
556 |
16 |
public boolean getSortByTree()... |
557 |
|
{ |
558 |
16 |
return sortByTree; |
559 |
|
} |
560 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
561 |
3 |
public void setSortByTree(boolean sort)... |
562 |
|
{ |
563 |
3 |
sortByTree = sort; |
564 |
|
} |
565 |
|
|
566 |
|
|
567 |
|
|
568 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
569 |
4403 |
@Override... |
570 |
|
public StructureSelectionManager getStructureSelectionManager() |
571 |
|
{ |
572 |
4403 |
return StructureSelectionManager |
573 |
|
.getStructureSelectionManager(Desktop.instance); |
574 |
|
} |
575 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
576 |
3158 |
@Override... |
577 |
|
public boolean isNormaliseSequenceLogo() |
578 |
|
{ |
579 |
3158 |
return normaliseSequenceLogo; |
580 |
|
} |
581 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
582 |
81 |
public void setNormaliseSequenceLogo(boolean state)... |
583 |
|
{ |
584 |
81 |
normaliseSequenceLogo = state; |
585 |
|
} |
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
@return |
590 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
591 |
28834 |
@Override... |
592 |
|
public boolean isValidCharWidth() |
593 |
|
{ |
594 |
28834 |
return validCharWidth; |
595 |
|
} |
596 |
|
|
597 |
|
private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<>(); |
598 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
599 |
9 |
public AutoCalcSetting getCalcIdSettingsFor(String calcId)... |
600 |
|
{ |
601 |
9 |
return calcIdParams.get(calcId); |
602 |
|
} |
603 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
604 |
0 |
public void setCalcIdSettingsFor(String calcId, AutoCalcSetting settings,... |
605 |
|
boolean needsUpdate) |
606 |
|
{ |
607 |
0 |
calcIdParams.put(calcId, settings); |
608 |
|
|
609 |
|
|
610 |
|
|
611 |
0 |
if (needsUpdate) |
612 |
|
{ |
613 |
0 |
Console.debug("trigger update for " + calcId); |
614 |
|
} |
615 |
|
} |
616 |
|
|
617 |
|
|
618 |
|
|
619 |
|
|
620 |
|
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
|
|
625 |
|
|
626 |
|
|
627 |
|
|
628 |
|
|
629 |
|
|
630 |
|
|
631 |
|
@param |
632 |
|
@param |
633 |
|
@param |
634 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 4 |
Complexity Density: 0.57 |
|
635 |
0 |
@Override... |
636 |
|
public void mirrorCommand(CommandI command, boolean undo, |
637 |
|
StructureSelectionManager ssm, VamsasSource source) |
638 |
|
{ |
639 |
|
|
640 |
|
|
641 |
|
|
642 |
|
|
643 |
0 |
if (source instanceof AlignViewportI |
644 |
|
&& ((AlignViewportI) source).getCodingComplement() == this) |
645 |
|
{ |
646 |
|
|
647 |
|
} |
648 |
|
else |
649 |
|
{ |
650 |
0 |
return; |
651 |
|
} |
652 |
|
|
653 |
0 |
CommandI mappedCommand = ssm.mapCommand(command, undo, getAlignment(), |
654 |
|
getGapCharacter()); |
655 |
0 |
if (mappedCommand != null) |
656 |
|
{ |
657 |
0 |
AlignmentI[] views = getAlignPanel().alignFrame.getViewAlignments(); |
658 |
0 |
mappedCommand.doCommand(views); |
659 |
0 |
getAlignPanel().alignmentChanged(); |
660 |
|
} |
661 |
|
} |
662 |
|
|
663 |
|
|
664 |
|
|
665 |
|
|
666 |
|
|
667 |
|
|
668 |
|
@param |
669 |
|
@param |
670 |
|
|
|
|
| 63.6% |
Uncovered Elements: 4 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
671 |
21 |
public void addAlignment(AlignmentI toAdd, String title)... |
672 |
|
{ |
673 |
|
|
674 |
|
|
675 |
|
|
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
|
680 |
|
|
681 |
|
|
682 |
|
|
683 |
|
|
684 |
|
|
685 |
|
|
686 |
|
|
687 |
21 |
toAdd.setDataset(null); |
688 |
|
|
689 |
|
|
690 |
|
|
691 |
|
|
692 |
|
|
693 |
21 |
getAlignment().realiseMappings(toAdd.getSequences()); |
694 |
|
|
695 |
|
|
696 |
|
|
697 |
|
|
698 |
|
|
699 |
21 |
if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, true)) |
700 |
|
{ |
701 |
21 |
if (AlignmentUtils.isMappable(toAdd, getAlignment())) |
702 |
|
{ |
703 |
0 |
openLinkedAlignment(toAdd, title); |
704 |
0 |
return; |
705 |
|
} |
706 |
|
} |
707 |
21 |
addDataToAlignment(toAdd); |
708 |
|
} |
709 |
|
|
710 |
|
|
711 |
|
|
712 |
|
|
713 |
|
@param |
714 |
|
|
|
|
| 91.7% |
Uncovered Elements: 1 (12) |
Complexity: 2 |
Complexity Density: 0.2 |
|
715 |
21 |
void addDataToAlignment(AlignmentI toAdd)... |
716 |
|
{ |
717 |
|
|
718 |
|
|
719 |
|
|
720 |
21 |
AlignmentI al = getAlignment(); |
721 |
21 |
String gap = String.valueOf(al.getGapCharacter()); |
722 |
79 |
for (int i = 0; i < toAdd.getHeight(); i++) |
723 |
|
{ |
724 |
58 |
SequenceI seq = toAdd.getSequenceAt(i); |
725 |
|
|
726 |
|
|
727 |
|
|
728 |
|
|
729 |
|
|
730 |
|
|
731 |
|
|
732 |
58 |
if (true ) |
733 |
|
{ |
734 |
58 |
al.addSequence(seq); |
735 |
|
} |
736 |
|
} |
737 |
21 |
for (ContactMatrixI cm : toAdd.getContactMaps()) |
738 |
|
{ |
739 |
0 |
al.addContactList(cm); |
740 |
|
} |
741 |
21 |
ranges.setEndSeq(getAlignment().getHeight() - 1); |
742 |
21 |
firePropertyChange("alignment", null, getAlignment().getSequences()); |
743 |
|
} |
744 |
|
|
745 |
|
|
746 |
|
|
747 |
|
|
748 |
|
|
749 |
|
@param |
750 |
|
@param |
751 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
752 |
0 |
public void addFile(File file, FileFormatI format)... |
753 |
|
{ |
754 |
0 |
addFile(file, format, true); |
755 |
|
} |
756 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 5 |
Complexity Density: 0.5 |
|
757 |
0 |
public void addFile(File file, FileFormatI format, boolean async)... |
758 |
|
{ |
759 |
0 |
DataSourceType protocol = AppletFormatAdapter.checkProtocol(file); |
760 |
|
|
761 |
0 |
if (format == null) |
762 |
|
{ |
763 |
0 |
try |
764 |
|
{ |
765 |
0 |
format = new IdentifyFile().identify(file, protocol); |
766 |
|
} catch (FileFormatException e1) |
767 |
|
{ |
768 |
0 |
jalview.bin.Console.error("Unknown file format for '" + file + "'"); |
769 |
|
} |
770 |
|
} |
771 |
0 |
else if (FileFormats.getInstance().isIdentifiable(format)) |
772 |
|
{ |
773 |
0 |
try |
774 |
|
{ |
775 |
0 |
format = new IdentifyFile().identify(file, protocol); |
776 |
|
} catch (FileFormatException e) |
777 |
|
{ |
778 |
0 |
jalview.bin.Console.error("Unknown file format for '" + file + "'", |
779 |
|
e); |
780 |
|
} |
781 |
|
} |
782 |
|
|
783 |
0 |
new FileLoader().LoadFile(this, file, DataSourceType.FILE, format, |
784 |
|
async); |
785 |
|
} |
786 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
787 |
0 |
public void addFile(File file)... |
788 |
|
{ |
789 |
0 |
addFile(file, null); |
790 |
|
} |
791 |
|
|
792 |
|
|
793 |
|
|
794 |
|
|
795 |
|
|
796 |
|
|
797 |
|
|
798 |
|
@param |
799 |
|
@param |
800 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 1 |
Complexity Density: 0.08 |
|
801 |
0 |
protected void openLinkedAlignment(AlignmentI al, String title)... |
802 |
|
{ |
803 |
0 |
String[] options = new String[] { MessageManager.getString("action.no"), |
804 |
|
MessageManager.getString("label.split_window") |
805 |
|
+ "(update new alignment)", |
806 |
|
MessageManager.getString("label.new_window"), |
807 |
|
MessageManager.getString( |
808 |
|
"label.split_window") + "(update this alignment)", |
809 |
|
MessageManager.getString( |
810 |
|
"label.split_window") + "(leave both unchanged)" }; |
811 |
0 |
final String question = JvSwingUtils.wrapTooltip(true, |
812 |
|
MessageManager.getString("label.open_split_window?")); |
813 |
0 |
final AlignViewport us = this; |
814 |
|
|
815 |
|
|
816 |
|
|
817 |
|
|
818 |
|
|
819 |
|
|
820 |
0 |
JvOptionPane dialog = JvOptionPane.newOptionDialog(Desktop.desktop) |
821 |
|
.setResponseHandler(0, () -> { |
822 |
0 |
addDataToAlignment(al); |
823 |
|
}).setResponseHandler(1, () -> { |
824 |
0 |
us.openLinkedAlignmentAs(al, title, true, 1); |
825 |
|
}).setResponseHandler(2, () -> { |
826 |
0 |
us.openLinkedAlignmentAs(al, title, false, 1); |
827 |
|
}).setResponseHandler(3, () -> { |
828 |
0 |
us.openLinkedAlignmentAs(al, title, true, 2); |
829 |
|
}).setResponseHandler(4, () -> { |
830 |
0 |
us.openLinkedAlignmentAs(al, title, true, 0); |
831 |
|
}); |
832 |
0 |
dialog.setLayout(new FlowLayout(FlowLayout.CENTER)); |
833 |
0 |
dialog.setPreferredSize(new Dimension(350,300)); |
834 |
0 |
dialog.showDialog(question, |
835 |
|
MessageManager.getString("label.open_split_window"), |
836 |
|
JvOptionPane.DEFAULT_OPTION, JvOptionPane.PLAIN_MESSAGE, null, |
837 |
|
options, options[0]); |
838 |
|
} |
839 |
|
|
840 |
|
|
841 |
|
|
842 |
|
@param |
843 |
|
@param |
844 |
|
@param |
845 |
|
@param |
846 |
|
@param |
847 |
|
@return |
848 |
|
|
|
|
| 0% |
Uncovered Elements: 47 (47) |
Complexity: 13 |
Complexity Density: 0.48 |
|
849 |
0 |
protected AlignFrame openLinkedAlignmentAs(AlignmentI al, String title,... |
850 |
|
boolean newWindowOrSplitPane, int alignAs) |
851 |
|
{ |
852 |
|
|
853 |
|
|
854 |
|
|
855 |
|
|
856 |
0 |
AlignmentI thisAlignment = newWindowOrSplitPane |
857 |
|
? new Alignment(getAlignment()) |
858 |
|
: getAlignment(); |
859 |
|
|
860 |
|
|
861 |
0 |
if (!al.isNucleotide() && !thisAlignment.isNucleotide()) |
862 |
|
{ |
863 |
|
|
864 |
0 |
if (al.getDataset()==null) |
865 |
|
{ |
866 |
0 |
al.setDataset(thisAlignment.getDataset()); |
867 |
|
} |
868 |
0 |
AlignmentUtils.map3diPeptideToProteinAligment(thisAlignment,al); |
869 |
0 |
if (thisAlignment.getCodonFrames().isEmpty()) {thisAlignment.getCodonFrames().addAll(al.getCodonFrames()); } |
870 |
0 |
else {al.getCodonFrames().addAll(thisAlignment.getCodonFrames()); }; |
871 |
|
|
872 |
|
|
873 |
|
} |
874 |
|
else |
875 |
|
{ |
876 |
|
|
877 |
|
|
878 |
0 |
al.setDataset(null); |
879 |
|
|
880 |
0 |
AlignmentI protein = al.isNucleotide() ? thisAlignment : al; |
881 |
0 |
final AlignmentI cdna = al.isNucleotide() ? al : thisAlignment; |
882 |
|
|
883 |
|
|
884 |
|
|
885 |
|
|
886 |
|
|
887 |
|
|
888 |
|
|
889 |
0 |
AlignmentUtils.mapProteinAlignmentToCdna(protein, cdna); |
890 |
|
} |
891 |
|
|
892 |
|
|
893 |
|
|
894 |
|
|
895 |
|
|
896 |
0 |
AlignFrame newAlignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH, |
897 |
|
AlignFrame.DEFAULT_HEIGHT); |
898 |
0 |
newAlignFrame.setTitle(title); |
899 |
0 |
newAlignFrame.setStatus(MessageManager |
900 |
|
.formatMessage("label.successfully_loaded_file", new Object[] |
901 |
|
{ title })); |
902 |
|
|
903 |
|
|
904 |
|
|
905 |
|
|
906 |
|
|
907 |
|
|
908 |
|
|
909 |
|
|
910 |
0 |
if (!newWindowOrSplitPane) |
911 |
|
{ |
912 |
0 |
Desktop.addInternalFrame(newAlignFrame, title, |
913 |
|
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); |
914 |
|
} |
915 |
|
|
916 |
0 |
try |
917 |
|
{ |
918 |
0 |
newAlignFrame.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false)); |
919 |
|
} catch (java.beans.PropertyVetoException ex) |
920 |
|
{ |
921 |
|
} |
922 |
|
|
923 |
0 |
if (newWindowOrSplitPane) |
924 |
|
{ |
925 |
0 |
if (alignAs==1) { |
926 |
0 |
al.alignAs(thisAlignment); |
927 |
|
} |
928 |
0 |
if (alignAs==2) { |
929 |
0 |
thisAlignment.alignAs(al); |
930 |
|
} |
931 |
0 |
AlignmentI mapped = openSplitFrame(newAlignFrame, thisAlignment); |
932 |
|
} |
933 |
0 |
return newAlignFrame; |
934 |
|
} |
935 |
|
|
936 |
|
|
937 |
|
|
938 |
|
|
939 |
|
|
940 |
|
@param |
941 |
|
|
942 |
|
@param |
943 |
|
|
944 |
|
@return |
945 |
|
|
|
|
| 88.2% |
Uncovered Elements: 2 (17) |
Complexity: 3 |
Complexity Density: 0.23 |
|
946 |
1 |
protected AlignmentI openSplitFrame(AlignFrame newAlignFrame,... |
947 |
|
AlignmentI complement) |
948 |
|
{ |
949 |
|
|
950 |
|
|
951 |
|
|
952 |
|
|
953 |
|
|
954 |
1 |
AlignFrame copyMe = new AlignFrame(complement, AlignFrame.DEFAULT_WIDTH, |
955 |
|
AlignFrame.DEFAULT_HEIGHT); |
956 |
1 |
copyMe.setTitle(getAlignPanel().alignFrame.getTitle()); |
957 |
|
|
958 |
1 |
AlignmentI al = newAlignFrame.viewport.getAlignment(); |
959 |
1 |
final AlignFrame proteinFrame = al.isNucleotide() ? copyMe |
960 |
|
: newAlignFrame; |
961 |
1 |
final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame : copyMe; |
962 |
1 |
cdnaFrame.setVisible(true); |
963 |
1 |
proteinFrame.setVisible(true); |
964 |
1 |
String linkedTitle = MessageManager |
965 |
|
.getString("label.linked_view_title"); |
966 |
|
|
967 |
|
|
968 |
|
|
969 |
|
|
970 |
1 |
JInternalFrame splitFrame = new SplitFrame(cdnaFrame, proteinFrame); |
971 |
1 |
Desktop.addInternalFrame(splitFrame, linkedTitle, -1, -1); |
972 |
1 |
cdnaFrame.viewport.updateConsensus(cdnaFrame.alignPanel); |
973 |
1 |
proteinFrame.viewport.updateConsensus(proteinFrame.alignPanel); |
974 |
|
|
975 |
1 |
return proteinFrame.viewport.getAlignment(); |
976 |
|
} |
977 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
978 |
7 |
public AnnotationColumnChooser getAnnotationColumnSelectionState()... |
979 |
|
{ |
980 |
7 |
return annotationColumnSelectionState; |
981 |
|
} |
982 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
983 |
1 |
public void setAnnotationColumnSelectionState(... |
984 |
|
AnnotationColumnChooser currentAnnotationColumnSelectionState) |
985 |
|
{ |
986 |
1 |
this.annotationColumnSelectionState = currentAnnotationColumnSelectionState; |
987 |
|
} |
988 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
989 |
927 |
@Override... |
990 |
|
public void setIdWidth(int i) |
991 |
|
{ |
992 |
927 |
super.setIdWidth(i); |
993 |
927 |
AlignmentPanel ap = getAlignPanel(); |
994 |
927 |
if (ap != null) |
995 |
|
{ |
996 |
|
|
997 |
483 |
Dimension idw = ap.getIdPanel().getIdCanvas().getPreferredSize(); |
998 |
483 |
idw.width = i; |
999 |
483 |
ap.getIdPanel().getIdCanvas().setPreferredSize(idw); |
1000 |
|
} |
1001 |
|
} |
1002 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1003 |
49 |
public Rectangle getExplodedGeometry()... |
1004 |
|
{ |
1005 |
49 |
return explodedGeometry; |
1006 |
|
} |
1007 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1008 |
46 |
public void setExplodedGeometry(Rectangle explodedPosition)... |
1009 |
|
{ |
1010 |
46 |
this.explodedGeometry = explodedPosition; |
1011 |
|
} |
1012 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1013 |
115 |
public boolean isGatherViewsHere()... |
1014 |
|
{ |
1015 |
115 |
return gatherViewsHere; |
1016 |
|
} |
1017 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1018 |
152 |
public void setGatherViewsHere(boolean gatherViewsHere)... |
1019 |
|
{ |
1020 |
152 |
this.gatherViewsHere = gatherViewsHere; |
1021 |
|
} |
1022 |
|
|
1023 |
|
|
1024 |
|
|
1025 |
|
|
1026 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
1027 |
605 |
public void scrollComplementaryAlignment()... |
1028 |
|
{ |
1029 |
|
|
1030 |
|
|
1031 |
|
|
1032 |
|
|
1033 |
|
|
1034 |
605 |
SearchResultsI sr = new SearchResults(); |
1035 |
605 |
int verticalOffset = findComplementScrollTarget(sr); |
1036 |
605 |
if (!sr.isEmpty()) |
1037 |
|
{ |
1038 |
|
|
1039 |
2 |
final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement()) |
1040 |
|
.getAlignPanel(); |
1041 |
2 |
complementPanel.setToScrollComplementPanel(false); |
1042 |
2 |
complementPanel.scrollToCentre(sr, verticalOffset); |
1043 |
2 |
complementPanel.setToScrollComplementPanel(true); |
1044 |
|
} |
1045 |
|
} |
1046 |
|
|
1047 |
|
|
1048 |
|
|
1049 |
|
|
1050 |
|
@param |
1051 |
|
@return |
1052 |
|
|
|
|
| 93.8% |
Uncovered Elements: 1 (16) |
Complexity: 5 |
Complexity Density: 0.5 |
|
1053 |
125 |
protected boolean noReferencesTo(AlignedCodonFrame acf)... |
1054 |
|
{ |
1055 |
125 |
AlignFrame[] frames = Desktop.getDesktopAlignFrames(); |
1056 |
125 |
if (frames == null) |
1057 |
|
{ |
1058 |
24 |
return true; |
1059 |
|
} |
1060 |
101 |
for (AlignFrame af : frames) |
1061 |
|
{ |
1062 |
108 |
if (!af.isClosed()) |
1063 |
|
{ |
1064 |
108 |
for (AlignmentViewPanel ap : af.getAlignPanels()) |
1065 |
|
{ |
1066 |
108 |
AlignmentI al = ap.getAlignment(); |
1067 |
108 |
if (al != null && al.getCodonFrames().contains(acf)) |
1068 |
|
{ |
1069 |
98 |
return false; |
1070 |
|
} |
1071 |
|
} |
1072 |
|
} |
1073 |
|
} |
1074 |
3 |
return true; |
1075 |
|
} |
1076 |
|
|
1077 |
|
|
1078 |
|
|
1079 |
|
|
1080 |
|
|
1081 |
|
|
1082 |
|
|
1083 |
|
@param |
1084 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1085 |
82 |
@Override... |
1086 |
|
public void applyFeaturesStyle(FeatureSettingsModelI featureSettings) |
1087 |
|
{ |
1088 |
82 |
transferFeaturesStyles(featureSettings, false); |
1089 |
|
} |
1090 |
|
|
1091 |
|
|
1092 |
|
|
1093 |
|
|
1094 |
|
|
1095 |
|
|
1096 |
|
|
1097 |
|
@param |
1098 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1099 |
2 |
@Override... |
1100 |
|
public void mergeFeaturesStyle(FeatureSettingsModelI featureSettings) |
1101 |
|
{ |
1102 |
2 |
transferFeaturesStyles(featureSettings, true); |
1103 |
|
} |
1104 |
|
|
1105 |
|
|
1106 |
|
|
1107 |
|
|
1108 |
|
|
1109 |
|
|
1110 |
|
|
1111 |
|
@param |
1112 |
|
@param |
1113 |
|
|
|
|
| 93.2% |
Uncovered Elements: 3 (44) |
Complexity: 15 |
Complexity Density: 0.54 |
|
1114 |
84 |
private void transferFeaturesStyles(FeatureSettingsModelI featureSettings,... |
1115 |
|
boolean mergeOnly) |
1116 |
|
{ |
1117 |
84 |
if (featureSettings == null) |
1118 |
|
{ |
1119 |
18 |
return; |
1120 |
|
} |
1121 |
|
|
1122 |
66 |
FeatureRenderer fr = getAlignPanel().getSeqPanel().seqCanvas |
1123 |
|
.getFeatureRenderer(); |
1124 |
66 |
List<String> origRenderOrder = new ArrayList<>(); |
1125 |
66 |
List<String> origGroups = new ArrayList<>(); |
1126 |
|
|
1127 |
|
|
1128 |
66 |
origRenderOrder.addAll(fr.getRenderOrder()); |
1129 |
66 |
origGroups.addAll(fr.getFeatureGroups()); |
1130 |
|
|
1131 |
66 |
fr.findAllFeatures(true); |
1132 |
66 |
List<String> renderOrder = fr.getRenderOrder(); |
1133 |
66 |
FeaturesDisplayedI displayed = fr.getFeaturesDisplayed(); |
1134 |
66 |
if (!mergeOnly) |
1135 |
|
{ |
1136 |
|
|
1137 |
|
|
1138 |
|
} |
1139 |
|
|
1140 |
|
|
1141 |
|
|
1142 |
|
|
1143 |
|
|
1144 |
|
|
1145 |
|
|
1146 |
|
|
1147 |
66 |
for (String type : renderOrder) |
1148 |
|
{ |
1149 |
228 |
FeatureColourI preferredColour = featureSettings |
1150 |
|
.getFeatureColour(type); |
1151 |
228 |
FeatureColourI origColour = fr.getFeatureStyle(type); |
1152 |
228 |
if (!mergeOnly || (!origRenderOrder.contains(type) |
1153 |
|
|| origColour == null |
1154 |
|
|| (!origColour.isGraduatedColour() |
1155 |
|
&& origColour.getColour() != null |
1156 |
|
&& origColour.getColour().equals( |
1157 |
|
ColorUtils.createColourFromName(type))))) |
1158 |
|
{ |
1159 |
|
|
1160 |
|
|
1161 |
|
|
1162 |
224 |
if (preferredColour != null) |
1163 |
|
{ |
1164 |
12 |
fr.setColour(type, preferredColour); |
1165 |
|
} |
1166 |
224 |
if (featureSettings.isFeatureDisplayed(type)) |
1167 |
|
{ |
1168 |
0 |
displayed.setVisible(type); |
1169 |
|
} |
1170 |
224 |
else if (featureSettings.isFeatureHidden(type)) |
1171 |
|
{ |
1172 |
62 |
displayed.setHidden(type); |
1173 |
|
} |
1174 |
|
} |
1175 |
|
} |
1176 |
|
|
1177 |
|
|
1178 |
|
|
1179 |
|
|
1180 |
66 |
for (String group : fr.getFeatureGroups()) |
1181 |
|
{ |
1182 |
119 |
if (!mergeOnly || !origGroups.contains(group)) |
1183 |
|
{ |
1184 |
|
|
1185 |
|
|
1186 |
111 |
fr.setGroupVisibility(group, |
1187 |
|
featureSettings.isGroupDisplayed(group)); |
1188 |
|
} |
1189 |
|
} |
1190 |
|
|
1191 |
|
|
1192 |
|
|
1193 |
|
|
1194 |
66 |
if (featureSettings.optimiseOrder()) |
1195 |
|
{ |
1196 |
|
|
1197 |
|
} |
1198 |
|
else |
1199 |
|
{ |
1200 |
66 |
fr.orderFeatures(featureSettings); |
1201 |
|
} |
1202 |
66 |
fr.setTransparency(featureSettings.getTransparency()); |
1203 |
|
|
1204 |
66 |
fr.notifyFeaturesChanged(); |
1205 |
|
} |
1206 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1207 |
3876 |
public String getViewName()... |
1208 |
|
{ |
1209 |
3876 |
return viewName; |
1210 |
|
} |
1211 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1212 |
74 |
public void setViewName(String viewName)... |
1213 |
|
{ |
1214 |
74 |
this.viewName = viewName; |
1215 |
|
} |
1216 |
|
|
1217 |
|
} |