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