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 |
|
|
|
|
| 60.3% |
Uncovered Elements: 185 (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 |
25 |
public AlignViewport(AlignmentI al, HiddenColumns hiddenColumns)... |
159 |
|
{ |
160 |
25 |
super(al); |
161 |
25 |
if (hiddenColumns != null) |
162 |
|
{ |
163 |
25 |
al.setHiddenColumns(hiddenColumns); |
164 |
|
} |
165 |
25 |
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 |
209 |
public AlignViewport(AlignmentI al, HiddenColumns hiddenColumns,... |
193 |
|
String seqsetid, String viewid) |
194 |
|
{ |
195 |
209 |
super(al); |
196 |
209 |
sequenceSetID = seqsetid; |
197 |
209 |
viewId = viewid; |
198 |
|
|
199 |
209 |
if (seqsetid != null) |
200 |
|
{ |
201 |
6 |
Console.debug( |
202 |
|
"Setting viewport's sequence set id : " + sequenceSetID); |
203 |
|
} |
204 |
209 |
if (viewId != null) |
205 |
|
{ |
206 |
1 |
Console.debug("Setting viewport's view id : " + viewId); |
207 |
|
} |
208 |
|
|
209 |
209 |
if (hiddenColumns != null) |
210 |
|
{ |
211 |
0 |
al.setHiddenColumns(hiddenColumns); |
212 |
|
} |
213 |
209 |
init(); |
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 1 |
Complexity Density: 0.06 |
|
219 |
272 |
private void applyViewProperties()... |
220 |
|
{ |
221 |
272 |
antiAlias = Cache.getDefault("ANTI_ALIAS", true); |
222 |
|
|
223 |
272 |
viewStyle.setShowJVSuffix(Cache.getDefault("SHOW_JVSUFFIX", true)); |
224 |
272 |
setShowAnnotation(Cache.getDefault("SHOW_ANNOTATIONS", true)); |
225 |
|
|
226 |
272 |
setRightAlignIds(Cache.getDefault("RIGHT_ALIGN_IDS", false)); |
227 |
272 |
setCentreColumnLabels(Cache.getDefault("CENTRE_COLUMN_LABELS", false)); |
228 |
272 |
autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true); |
229 |
|
|
230 |
272 |
setPadGaps(Cache.getDefault("PAD_GAPS", true)); |
231 |
272 |
setShowNPFeats(Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true)); |
232 |
272 |
setShowDBRefs(Cache.getDefault("SHOW_DBREFS_TOOLTIP", true)); |
233 |
272 |
viewStyle.setSeqNameItalics(Cache.getDefault("ID_ITALICS", true)); |
234 |
272 |
viewStyle.setWrapAlignment(Cache.getDefault("WRAP_ALIGNMENT", false)); |
235 |
272 |
viewStyle.setShowUnconserved( |
236 |
|
Cache.getDefault("SHOW_UNCONSERVED", false)); |
237 |
272 |
sortByTree = Cache.getDefault("SORT_BY_TREE", false); |
238 |
272 |
followSelection = Cache.getDefault("FOLLOW_SELECTIONS", true); |
239 |
272 |
sortAnnotationsBy = SequenceAnnotationOrder |
240 |
|
.valueOf(Cache.getDefault(Preferences.SORT_ANNOTATIONS, |
241 |
|
SequenceAnnotationOrder.NONE.name())); |
242 |
272 |
showAutocalculatedAbove = Cache |
243 |
|
.getDefault(Preferences.SHOW_AUTOCALC_ABOVE, false); |
244 |
272 |
viewStyle.setScaleProteinAsCdna( |
245 |
|
Cache.getDefault(Preferences.SCALE_PROTEIN_TO_CDNA, true)); |
246 |
272 |
viewStyle.setShowStructureProvider( |
247 |
|
Cache.getDefault(Preferences.SHOW_STRUC_PROVIDER, false)); |
248 |
|
} |
249 |
|
|
|
|
| 83% |
Uncovered Elements: 9 (53) |
Complexity: 10 |
Complexity Density: 0.27 |
|
250 |
272 |
void init()... |
251 |
|
{ |
252 |
272 |
applyViewProperties(); |
253 |
|
|
254 |
272 |
String fontName = Cache.getDefault("FONT_NAME", "SansSerif"); |
255 |
272 |
String fontStyle = Cache.getDefault("FONT_STYLE", Font.PLAIN + ""); |
256 |
272 |
String fontSize = Cache.getDefault("FONT_SIZE", "10"); |
257 |
|
|
258 |
272 |
int style = 0; |
259 |
|
|
260 |
272 |
if (fontStyle.equals("bold")) |
261 |
|
{ |
262 |
0 |
style = 1; |
263 |
|
} |
264 |
272 |
else if (fontStyle.equals("italic")) |
265 |
|
{ |
266 |
0 |
style = 2; |
267 |
|
} |
268 |
|
|
269 |
272 |
setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true); |
270 |
|
|
271 |
272 |
alignment |
272 |
|
.setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0)); |
273 |
|
|
274 |
|
|
275 |
|
|
276 |
272 |
if (hconsensus == null && !isDataset) |
277 |
|
{ |
278 |
272 |
if (!alignment.isNucleotide()) |
279 |
|
{ |
280 |
187 |
showConservation = Cache.getDefault("SHOW_CONSERVATION", true); |
281 |
187 |
showQuality = Cache.getDefault("SHOW_QUALITY", true); |
282 |
187 |
showGroupConservation = Cache.getDefault("SHOW_GROUP_CONSERVATION", |
283 |
|
false); |
284 |
|
} |
285 |
272 |
showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM", |
286 |
|
true); |
287 |
272 |
showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", true); |
288 |
272 |
normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO", |
289 |
|
false); |
290 |
272 |
showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false); |
291 |
272 |
showConsensus = Cache.getDefault("SHOW_IDENTITY", true); |
292 |
|
|
293 |
272 |
showSSConsensus = Cache.getDefault("SHOW_SS_CONSENSUS", false); |
294 |
|
|
295 |
272 |
showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true); |
296 |
|
} |
297 |
272 |
initAutoAnnotation(); |
298 |
272 |
String colourProperty = alignment.isNucleotide() |
299 |
|
? Preferences.DEFAULT_COLOUR_NUC |
300 |
|
: Preferences.DEFAULT_COLOUR_PROT; |
301 |
272 |
String schemeName = Cache.getProperty(colourProperty); |
302 |
272 |
if (schemeName == null) |
303 |
|
{ |
304 |
|
|
305 |
264 |
schemeName = Cache.getDefault(Preferences.DEFAULT_COLOUR, |
306 |
|
ResidueColourScheme.NONE); |
307 |
|
} |
308 |
272 |
ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(this, |
309 |
|
alignment, schemeName); |
310 |
272 |
residueShading = new ResidueShader(colourScheme); |
311 |
|
|
312 |
272 |
if (colourScheme instanceof UserColourScheme) |
313 |
|
{ |
314 |
0 |
residueShading = new ResidueShader( |
315 |
|
UserDefinedColours.loadDefaultColours()); |
316 |
0 |
residueShading.setThreshold(0, isIgnoreGapsConsensus()); |
317 |
|
} |
318 |
|
|
319 |
272 |
if (residueShading != null) |
320 |
|
{ |
321 |
272 |
residueShading.setConsensus(hconsensus); |
322 |
272 |
residueShading.setSSConsensusProfileMap(hSSConsensusProfileMap); |
323 |
|
} |
324 |
272 |
setColourAppliesToAllGroups(true); |
325 |
|
} |
326 |
|
|
327 |
|
boolean validCharWidth; |
328 |
|
|
329 |
|
|
330 |
|
@inheritDoc |
331 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
|
332 |
287 |
@Override... |
333 |
|
public void setFont(Font f, boolean setGrid) |
334 |
|
{ |
335 |
287 |
font = f; |
336 |
|
|
337 |
287 |
Container c = new Container(); |
338 |
|
|
339 |
287 |
if (setGrid) |
340 |
|
{ |
341 |
275 |
FontMetrics fm = c.getFontMetrics(font); |
342 |
275 |
int ww = fm.charWidth('M'); |
343 |
275 |
setCharHeight(fm.getHeight()); |
344 |
275 |
setCharWidth(ww); |
345 |
|
} |
346 |
287 |
viewStyle.setFontName(font.getName()); |
347 |
287 |
viewStyle.setFontStyle(font.getStyle()); |
348 |
287 |
viewStyle.setFontSize(font.getSize()); |
349 |
|
|
350 |
287 |
validCharWidth = true; |
351 |
|
} |
352 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
353 |
6 |
@Override... |
354 |
|
public void setViewStyle(ViewStyleI settingsForView) |
355 |
|
{ |
356 |
6 |
super.setViewStyle(settingsForView); |
357 |
6 |
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 |
7873 |
public Font getFont()... |
367 |
|
{ |
368 |
7873 |
return font; |
369 |
|
} |
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
@param |
375 |
|
|
376 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
377 |
395 |
@Override... |
378 |
|
public void setAlignment(AlignmentI align) |
379 |
|
{ |
380 |
395 |
replaceMappings(align); |
381 |
395 |
super.setAlignment(align); |
382 |
|
} |
383 |
|
|
384 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
@param |
389 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
390 |
400 |
public void replaceMappings(AlignmentI align)... |
391 |
|
{ |
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
400 |
deregisterMappings(); |
397 |
|
|
398 |
|
|
399 |
|
|
400 |
|
|
401 |
400 |
if (align != null) |
402 |
|
{ |
403 |
277 |
StructureSelectionManager ssm = StructureSelectionManager |
404 |
|
.getStructureSelectionManager(Desktop.instance); |
405 |
277 |
ssm.registerMappings(align.getCodonFrames()); |
406 |
|
} |
407 |
|
|
408 |
|
|
409 |
|
|
410 |
|
|
411 |
400 |
if (alignment != null && align != null) |
412 |
|
{ |
413 |
5 |
alignment.setCodonFrames(align.getCodonFrames()); |
414 |
|
} |
415 |
|
} |
416 |
|
|
|
|
| 92.9% |
Uncovered Elements: 1 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
417 |
400 |
protected void deregisterMappings()... |
418 |
|
{ |
419 |
400 |
AlignmentI al = getAlignment(); |
420 |
400 |
if (al != null) |
421 |
|
{ |
422 |
128 |
List<AlignedCodonFrame> mappings = al.getCodonFrames(); |
423 |
128 |
if (mappings != null) |
424 |
|
{ |
425 |
128 |
StructureSelectionManager ssm = StructureSelectionManager |
426 |
|
.getStructureSelectionManager(Desktop.instance); |
427 |
128 |
for (AlignedCodonFrame acf : mappings) |
428 |
|
{ |
429 |
10 |
if (noReferencesTo(acf)) |
430 |
|
{ |
431 |
4 |
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 |
30 |
@Override... |
444 |
|
public char getGapCharacter() |
445 |
|
{ |
446 |
30 |
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 |
19 |
@Override... |
524 |
|
public void sendSelection() |
525 |
|
{ |
526 |
19 |
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 |
365 |
public AlignmentPanel getAlignPanel()... |
543 |
|
{ |
544 |
365 |
AlignmentPanel[] aps = PaintRefresher |
545 |
|
.getAssociatedPanels(this.getSequenceSetId()); |
546 |
375 |
for (int p = 0; aps != null && p < aps.length; p++) |
547 |
|
{ |
548 |
164 |
if (aps[p].av == this) |
549 |
|
{ |
550 |
154 |
return aps[p]; |
551 |
|
} |
552 |
|
} |
553 |
211 |
return null; |
554 |
|
} |
555 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
556 |
0 |
public boolean getSortByTree()... |
557 |
|
{ |
558 |
0 |
return sortByTree; |
559 |
|
} |
560 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
561 |
0 |
public void setSortByTree(boolean sort)... |
562 |
|
{ |
563 |
0 |
sortByTree = sort; |
564 |
|
} |
565 |
|
|
566 |
|
|
567 |
|
|
568 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
569 |
1581 |
@Override... |
570 |
|
public StructureSelectionManager getStructureSelectionManager() |
571 |
|
{ |
572 |
1581 |
return StructureSelectionManager |
573 |
|
.getStructureSelectionManager(Desktop.instance); |
574 |
|
} |
575 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
576 |
947 |
@Override... |
577 |
|
public boolean isNormaliseSequenceLogo() |
578 |
|
{ |
579 |
947 |
return normaliseSequenceLogo; |
580 |
|
} |
581 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
582 |
6 |
public void setNormaliseSequenceLogo(boolean state)... |
583 |
|
{ |
584 |
6 |
normaliseSequenceLogo = state; |
585 |
|
} |
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
@return |
590 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
591 |
2141 |
@Override... |
592 |
|
public boolean isValidCharWidth() |
593 |
|
{ |
594 |
2141 |
return validCharWidth; |
595 |
|
} |
596 |
|
|
597 |
|
private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<>(); |
598 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
599 |
2 |
public AutoCalcSetting getCalcIdSettingsFor(String calcId)... |
600 |
|
{ |
601 |
2 |
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 |
13 |
public void addAlignment(AlignmentI toAdd, String title)... |
672 |
|
{ |
673 |
|
|
674 |
|
|
675 |
|
|
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
|
680 |
|
|
681 |
|
|
682 |
|
|
683 |
|
|
684 |
|
|
685 |
|
|
686 |
|
|
687 |
13 |
toAdd.setDataset(null); |
688 |
|
|
689 |
|
|
690 |
|
|
691 |
|
|
692 |
|
|
693 |
13 |
getAlignment().realiseMappings(toAdd.getSequences()); |
694 |
|
|
695 |
|
|
696 |
|
|
697 |
|
|
698 |
|
|
699 |
13 |
if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, true)) |
700 |
|
{ |
701 |
13 |
if (AlignmentUtils.isMappable(toAdd, getAlignment())) |
702 |
|
{ |
703 |
0 |
openLinkedAlignment(toAdd, title); |
704 |
0 |
return; |
705 |
|
} |
706 |
|
} |
707 |
13 |
addDataToAlignment(toAdd); |
708 |
|
} |
709 |
|
|
710 |
|
|
711 |
|
|
712 |
|
|
713 |
|
@param |
714 |
|
|
|
|
| 91.7% |
Uncovered Elements: 1 (12) |
Complexity: 2 |
Complexity Density: 0.2 |
|
715 |
13 |
void addDataToAlignment(AlignmentI toAdd)... |
716 |
|
{ |
717 |
|
|
718 |
|
|
719 |
|
|
720 |
13 |
AlignmentI al = getAlignment(); |
721 |
13 |
String gap = String.valueOf(al.getGapCharacter()); |
722 |
29 |
for (int i = 0; i < toAdd.getHeight(); i++) |
723 |
|
{ |
724 |
16 |
SequenceI seq = toAdd.getSequenceAt(i); |
725 |
|
|
726 |
|
|
727 |
|
|
728 |
|
|
729 |
|
|
730 |
|
|
731 |
|
|
732 |
16 |
if (true ) |
733 |
|
{ |
734 |
16 |
al.addSequence(seq); |
735 |
|
} |
736 |
|
} |
737 |
13 |
for (ContactMatrixI cm : toAdd.getContactMaps()) |
738 |
|
{ |
739 |
0 |
al.addContactList(cm); |
740 |
|
} |
741 |
13 |
ranges.setEndSeq(getAlignment().getHeight() - 1); |
742 |
13 |
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 |
302 |
@Override... |
990 |
|
public void setIdWidth(int i) |
991 |
|
{ |
992 |
302 |
super.setIdWidth(i); |
993 |
302 |
AlignmentPanel ap = getAlignPanel(); |
994 |
302 |
if (ap != null) |
995 |
|
{ |
996 |
|
|
997 |
91 |
Dimension idw = ap.getIdPanel().getIdCanvas().getPreferredSize(); |
998 |
91 |
idw.width = i; |
999 |
91 |
ap.getIdPanel().getIdCanvas().setPreferredSize(idw); |
1000 |
|
} |
1001 |
|
} |
1002 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1003 |
8 |
public Rectangle getExplodedGeometry()... |
1004 |
|
{ |
1005 |
8 |
return explodedGeometry; |
1006 |
|
} |
1007 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1008 |
0 |
public void setExplodedGeometry(Rectangle explodedPosition)... |
1009 |
|
{ |
1010 |
0 |
this.explodedGeometry = explodedPosition; |
1011 |
|
} |
1012 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1013 |
9 |
public boolean isGatherViewsHere()... |
1014 |
|
{ |
1015 |
9 |
return gatherViewsHere; |
1016 |
|
} |
1017 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1018 |
16 |
public void setGatherViewsHere(boolean gatherViewsHere)... |
1019 |
|
{ |
1020 |
16 |
this.gatherViewsHere = gatherViewsHere; |
1021 |
|
} |
1022 |
|
|
1023 |
|
|
1024 |
|
|
1025 |
|
|
1026 |
|
|
|
|
| 44.4% |
Uncovered Elements: 5 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
1027 |
166 |
public void scrollComplementaryAlignment()... |
1028 |
|
{ |
1029 |
|
|
1030 |
|
|
1031 |
|
|
1032 |
|
|
1033 |
|
|
1034 |
166 |
SearchResultsI sr = new SearchResults(); |
1035 |
166 |
int verticalOffset = findComplementScrollTarget(sr); |
1036 |
166 |
if (!sr.isEmpty()) |
1037 |
|
{ |
1038 |
|
|
1039 |
0 |
final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement()) |
1040 |
|
.getAlignPanel(); |
1041 |
0 |
complementPanel.setToScrollComplementPanel(false); |
1042 |
0 |
complementPanel.scrollToCentre(sr, verticalOffset); |
1043 |
0 |
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 |
10 |
protected boolean noReferencesTo(AlignedCodonFrame acf)... |
1054 |
|
{ |
1055 |
10 |
AlignFrame[] frames = Desktop.getDesktopAlignFrames(); |
1056 |
10 |
if (frames == null) |
1057 |
|
{ |
1058 |
1 |
return true; |
1059 |
|
} |
1060 |
9 |
for (AlignFrame af : frames) |
1061 |
|
{ |
1062 |
16 |
if (!af.isClosed()) |
1063 |
|
{ |
1064 |
16 |
for (AlignmentViewPanel ap : af.getAlignPanels()) |
1065 |
|
{ |
1066 |
16 |
AlignmentI al = ap.getAlignment(); |
1067 |
16 |
if (al != null && al.getCodonFrames().contains(acf)) |
1068 |
|
{ |
1069 |
6 |
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 |
26 |
@Override... |
1086 |
|
public void applyFeaturesStyle(FeatureSettingsModelI featureSettings) |
1087 |
|
{ |
1088 |
26 |
transferFeaturesStyles(featureSettings, false); |
1089 |
|
} |
1090 |
|
|
1091 |
|
|
1092 |
|
|
1093 |
|
|
1094 |
|
|
1095 |
|
|
1096 |
|
|
1097 |
|
@param |
1098 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1099 |
0 |
@Override... |
1100 |
|
public void mergeFeaturesStyle(FeatureSettingsModelI featureSettings) |
1101 |
|
{ |
1102 |
0 |
transferFeaturesStyles(featureSettings, true); |
1103 |
|
} |
1104 |
|
|
1105 |
|
|
1106 |
|
|
1107 |
|
|
1108 |
|
|
1109 |
|
|
1110 |
|
|
1111 |
|
@param |
1112 |
|
@param |
1113 |
|
|
|
|
| 79.5% |
Uncovered Elements: 9 (44) |
Complexity: 15 |
Complexity Density: 0.54 |
|
1114 |
26 |
private void transferFeaturesStyles(FeatureSettingsModelI featureSettings,... |
1115 |
|
boolean mergeOnly) |
1116 |
|
{ |
1117 |
26 |
if (featureSettings == null) |
1118 |
|
{ |
1119 |
12 |
return; |
1120 |
|
} |
1121 |
|
|
1122 |
14 |
FeatureRenderer fr = getAlignPanel().getSeqPanel().seqCanvas |
1123 |
|
.getFeatureRenderer(); |
1124 |
14 |
List<String> origRenderOrder = new ArrayList<>(); |
1125 |
14 |
List<String> origGroups = new ArrayList<>(); |
1126 |
|
|
1127 |
|
|
1128 |
14 |
origRenderOrder.addAll(fr.getRenderOrder()); |
1129 |
14 |
origGroups.addAll(fr.getFeatureGroups()); |
1130 |
|
|
1131 |
14 |
fr.findAllFeatures(true); |
1132 |
14 |
List<String> renderOrder = fr.getRenderOrder(); |
1133 |
14 |
FeaturesDisplayedI displayed = fr.getFeaturesDisplayed(); |
1134 |
14 |
if (!mergeOnly) |
1135 |
|
{ |
1136 |
|
|
1137 |
|
|
1138 |
|
} |
1139 |
|
|
1140 |
|
|
1141 |
|
|
1142 |
|
|
1143 |
|
|
1144 |
|
|
1145 |
|
|
1146 |
|
|
1147 |
14 |
for (String type : renderOrder) |
1148 |
|
{ |
1149 |
14 |
FeatureColourI preferredColour = featureSettings |
1150 |
|
.getFeatureColour(type); |
1151 |
14 |
FeatureColourI origColour = fr.getFeatureStyle(type); |
1152 |
14 |
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 |
14 |
if (preferredColour != null) |
1163 |
|
{ |
1164 |
0 |
fr.setColour(type, preferredColour); |
1165 |
|
} |
1166 |
14 |
if (featureSettings.isFeatureDisplayed(type)) |
1167 |
|
{ |
1168 |
0 |
displayed.setVisible(type); |
1169 |
|
} |
1170 |
14 |
else if (featureSettings.isFeatureHidden(type)) |
1171 |
|
{ |
1172 |
14 |
displayed.setHidden(type); |
1173 |
|
} |
1174 |
|
} |
1175 |
|
} |
1176 |
|
|
1177 |
|
|
1178 |
|
|
1179 |
|
|
1180 |
14 |
for (String group : fr.getFeatureGroups()) |
1181 |
|
{ |
1182 |
16 |
if (!mergeOnly || !origGroups.contains(group)) |
1183 |
|
{ |
1184 |
|
|
1185 |
|
|
1186 |
16 |
fr.setGroupVisibility(group, |
1187 |
|
featureSettings.isGroupDisplayed(group)); |
1188 |
|
} |
1189 |
|
} |
1190 |
|
|
1191 |
|
|
1192 |
|
|
1193 |
|
|
1194 |
14 |
if (featureSettings.optimiseOrder()) |
1195 |
|
{ |
1196 |
|
|
1197 |
|
} |
1198 |
|
else |
1199 |
|
{ |
1200 |
14 |
fr.orderFeatures(featureSettings); |
1201 |
|
} |
1202 |
14 |
fr.setTransparency(featureSettings.getTransparency()); |
1203 |
|
|
1204 |
14 |
fr.notifyFeaturesChanged(); |
1205 |
|
} |
1206 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1207 |
1582 |
public String getViewName()... |
1208 |
|
{ |
1209 |
1582 |
return viewName; |
1210 |
|
} |
1211 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1212 |
10 |
public void setViewName(String viewName)... |
1213 |
|
{ |
1214 |
10 |
this.viewName = viewName; |
1215 |
|
} |
1216 |
|
|
1217 |
|
} |