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.BorderLayout; |
24 |
|
import java.awt.Component; |
25 |
|
import java.awt.Dimension; |
26 |
|
import java.awt.event.ActionEvent; |
27 |
|
import java.awt.event.ActionListener; |
28 |
|
import java.awt.event.KeyAdapter; |
29 |
|
import java.awt.event.KeyEvent; |
30 |
|
import java.awt.event.KeyListener; |
31 |
|
import java.beans.PropertyVetoException; |
32 |
|
import java.util.Arrays; |
33 |
|
import java.util.List; |
34 |
|
import java.util.Map.Entry; |
35 |
|
|
36 |
|
import javax.swing.AbstractAction; |
37 |
|
import javax.swing.InputMap; |
38 |
|
import javax.swing.JButton; |
39 |
|
import javax.swing.JComponent; |
40 |
|
import javax.swing.JDesktopPane; |
41 |
|
import javax.swing.JInternalFrame; |
42 |
|
import javax.swing.JLayeredPane; |
43 |
|
import javax.swing.JMenuItem; |
44 |
|
import javax.swing.JPanel; |
45 |
|
import javax.swing.JTabbedPane; |
46 |
|
import javax.swing.KeyStroke; |
47 |
|
import javax.swing.event.ChangeEvent; |
48 |
|
import javax.swing.event.ChangeListener; |
49 |
|
import javax.swing.event.InternalFrameAdapter; |
50 |
|
import javax.swing.event.InternalFrameEvent; |
51 |
|
|
52 |
|
import jalview.api.AlignViewControllerGuiI; |
53 |
|
import jalview.api.FeatureSettingsControllerI; |
54 |
|
import jalview.api.SplitContainerI; |
55 |
|
import jalview.controller.FeatureSettingsControllerGuiI; |
56 |
|
import jalview.datamodel.AlignmentI; |
57 |
|
import jalview.jbgui.GAlignFrame; |
58 |
|
import jalview.jbgui.GSplitFrame; |
59 |
|
import jalview.structure.StructureSelectionManager; |
60 |
|
import jalview.util.MessageManager; |
61 |
|
import jalview.util.Platform; |
62 |
|
import jalview.viewmodel.AlignmentViewport; |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
@author |
74 |
|
|
75 |
|
|
|
|
| 36% |
Uncovered Elements: 286 (447) |
Complexity: 121 |
Complexity Density: 0.41 |
|
76 |
|
public class SplitFrame extends GSplitFrame implements SplitContainerI |
77 |
|
{ |
78 |
|
private static final int WINDOWS_INSETS_WIDTH = 28; |
79 |
|
|
80 |
|
private static final int MAC_INSETS_WIDTH = 28; |
81 |
|
|
82 |
|
private static final int WINDOWS_INSETS_HEIGHT = 50; |
83 |
|
|
84 |
|
private static final int MAC_INSETS_HEIGHT = 50; |
85 |
|
|
86 |
|
private static final int DESKTOP_DECORATORS_HEIGHT = 65; |
87 |
|
|
88 |
|
private static final long serialVersionUID = 1L; |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
private static final int FS_MIN_WIDTH = 400; |
94 |
|
|
95 |
|
private static final int FS_MIN_HEIGHT = 400; |
96 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
97 |
3 |
public SplitFrame(GAlignFrame top, GAlignFrame bottom)... |
98 |
|
{ |
99 |
3 |
super(top, bottom); |
100 |
3 |
init(); |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
|
|
| 90% |
Uncovered Elements: 2 (20) |
Complexity: 3 |
Complexity Density: 0.19 |
|
106 |
3 |
protected void init()... |
107 |
|
{ |
108 |
3 |
getTopFrame().setSplitFrame(this); |
109 |
3 |
getBottomFrame().setSplitFrame(this); |
110 |
3 |
getTopFrame().setVisible(true); |
111 |
3 |
getBottomFrame().setVisible(true); |
112 |
|
|
113 |
3 |
((AlignFrame) getTopFrame()).getViewport().setCodingComplement( |
114 |
|
((AlignFrame) getBottomFrame()).getViewport()); |
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
3 |
int widthFudge = Platform.isAMacAndNotJS() ? MAC_INSETS_WIDTH |
121 |
|
: WINDOWS_INSETS_WIDTH; |
122 |
3 |
int heightFudge = Platform.isAMacAndNotJS() ? MAC_INSETS_HEIGHT |
123 |
|
: WINDOWS_INSETS_HEIGHT; |
124 |
3 |
int width = ((AlignFrame) getTopFrame()).getWidth() + widthFudge; |
125 |
3 |
int height = ((AlignFrame) getTopFrame()).getHeight() |
126 |
|
+ ((AlignFrame) getBottomFrame()).getHeight() + DIVIDER_SIZE |
127 |
|
+ heightFudge; |
128 |
3 |
height = fitHeightToDesktop(height); |
129 |
3 |
setSize(width, height); |
130 |
|
|
131 |
3 |
adjustLayout(); |
132 |
|
|
133 |
3 |
addCloseFrameListener(); |
134 |
|
|
135 |
3 |
addKeyListener(); |
136 |
|
|
137 |
3 |
addKeyBindings(); |
138 |
|
|
139 |
3 |
addCommandListeners(); |
140 |
|
} |
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
@param |
147 |
|
|
148 |
|
@return |
149 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
150 |
3 |
public int fitHeightToDesktop(int height)... |
151 |
|
{ |
152 |
|
|
153 |
|
|
154 |
3 |
int newHeight = Math.min(height, |
155 |
|
Desktop.instance.getHeight() - DESKTOP_DECORATORS_HEIGHT); |
156 |
3 |
if (newHeight != height) |
157 |
|
{ |
158 |
3 |
int oldDividerLocation = getDividerLocation(); |
159 |
3 |
setDividerLocation(oldDividerLocation * newHeight / height); |
160 |
|
} |
161 |
3 |
return newHeight; |
162 |
|
} |
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
168 |
3 |
protected void addCommandListeners()... |
169 |
|
{ |
170 |
|
|
171 |
|
|
172 |
3 |
final StructureSelectionManager ssm = StructureSelectionManager |
173 |
|
.getStructureSelectionManager(Desktop.instance); |
174 |
3 |
ssm.addCommandListener(((AlignFrame) getTopFrame()).getViewport()); |
175 |
3 |
ssm.addCommandListener(((AlignFrame) getBottomFrame()).getViewport()); |
176 |
|
} |
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
|
|
| 73.1% |
Uncovered Elements: 7 (26) |
Complexity: 8 |
Complexity Density: 0.57 |
|
181 |
3 |
public void adjustLayout()... |
182 |
|
{ |
183 |
3 |
final AlignViewport topViewport = ((AlignFrame) getTopFrame()).viewport; |
184 |
3 |
final AlignViewport bottomViewport = ((AlignFrame) getBottomFrame()).viewport; |
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
3 |
int w1 = topViewport.getIdWidth(); |
190 |
3 |
int w2 = bottomViewport.getIdWidth(); |
191 |
3 |
int w3 = Math.max(w1, w2); |
192 |
3 |
topViewport.setIdWidth(w3); |
193 |
3 |
bottomViewport.setIdWidth(w3); |
194 |
|
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
3 |
final AlignmentI topAlignment = topViewport.getAlignment(); |
199 |
3 |
final AlignmentI bottomAlignment = bottomViewport.getAlignment(); |
200 |
3 |
AlignmentViewport cdna = topAlignment.isNucleotide() ? topViewport |
201 |
0 |
: (bottomAlignment.isNucleotide() ? bottomViewport : null); |
202 |
3 |
AlignmentViewport protein = !topAlignment.isNucleotide() ? topViewport |
203 |
3 |
: (!bottomAlignment.isNucleotide() ? bottomViewport : null); |
204 |
3 |
if (protein != null && cdna != null) |
205 |
|
{ |
206 |
3 |
int scale = protein.isScaleProteinAsCdna() ? 3 : 1; |
207 |
3 |
protein.setCharWidth(scale * cdna.getViewStyle().getCharWidth()); |
208 |
|
} |
209 |
|
} |
210 |
|
|
211 |
|
|
212 |
|
|
213 |
|
|
214 |
|
|
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
|
|
|
| 91.7% |
Uncovered Elements: 3 (36) |
Complexity: 4 |
Complexity Density: 0.13 |
|
221 |
2 |
protected void adjustInitialLayout()... |
222 |
|
{ |
223 |
2 |
AlignFrame topFrame = (AlignFrame) getTopFrame(); |
224 |
2 |
AlignFrame bottomFrame = (AlignFrame) getBottomFrame(); |
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
|
230 |
2 |
topFrame.alignPanel.adjustAnnotationHeight(); |
231 |
2 |
bottomFrame.alignPanel.adjustAnnotationHeight(); |
232 |
|
|
233 |
2 |
final AlignViewport topViewport = topFrame.viewport; |
234 |
2 |
final AlignViewport bottomViewport = bottomFrame.viewport; |
235 |
2 |
final AlignmentI topAlignment = topViewport.getAlignment(); |
236 |
2 |
final AlignmentI bottomAlignment = bottomViewport.getAlignment(); |
237 |
2 |
boolean topAnnotations = topViewport.isShowAnnotation(); |
238 |
2 |
boolean bottomAnnotations = bottomViewport.isShowAnnotation(); |
239 |
|
|
240 |
2 |
int topCount = topAlignment.getHeight(); |
241 |
2 |
int bottomCount = bottomAlignment.getHeight(); |
242 |
2 |
int topCharHeight = topViewport.getViewStyle().getCharHeight(); |
243 |
2 |
int bottomCharHeight = bottomViewport.getViewStyle().getCharHeight(); |
244 |
|
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
|
249 |
2 |
int topPanelHeight = topFrame.getHeight(); |
250 |
2 |
int bottomPanelHeight = bottomFrame.getHeight(); |
251 |
2 |
int topSequencesHeight = topFrame.alignPanel.getSeqPanel().seqCanvas |
252 |
|
.getHeight(); |
253 |
2 |
int topPanelMinHeight = topPanelHeight |
254 |
|
- Math.max(0, topSequencesHeight - 3 * topCharHeight); |
255 |
2 |
double totalHeight = (double) topPanelHeight + bottomPanelHeight; |
256 |
2 |
double minRatio = topPanelMinHeight / totalHeight; |
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
|
262 |
2 |
int bottomSequencesHeight = bottomFrame.alignPanel.getSeqPanel().seqCanvas |
263 |
|
.getHeight(); |
264 |
2 |
int bottomPanelMinHeight = bottomPanelHeight |
265 |
|
- Math.max(0, bottomSequencesHeight - 3 * bottomCharHeight); |
266 |
2 |
double maxRatio = (totalHeight - bottomPanelMinHeight) / totalHeight; |
267 |
|
|
268 |
|
|
269 |
|
|
270 |
|
|
271 |
2 |
int insets = Platform.isAMacAndNotJS() ? MAC_INSETS_HEIGHT |
272 |
|
: WINDOWS_INSETS_HEIGHT; |
273 |
|
|
274 |
2 |
int topHeight = insets + (3 + topCount) * topCharHeight |
275 |
2 |
+ (topAnnotations ? topViewport.calcPanelHeight() : 0); |
276 |
2 |
int bottomHeight = insets + (3 + bottomCount) * bottomCharHeight |
277 |
2 |
+ (bottomAnnotations ? bottomViewport.calcPanelHeight() : 0); |
278 |
2 |
double ratio = ((double) topHeight) |
279 |
|
/ (double) (topHeight + bottomHeight); |
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
2 |
ratio = Math.min(ratio, maxRatio); |
285 |
2 |
ratio = Math.max(ratio, minRatio); |
286 |
2 |
setRelativeDividerLocation(ratio); |
287 |
|
} |
288 |
|
|
289 |
|
|
290 |
|
|
291 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
292 |
3 |
protected void addCloseFrameListener()... |
293 |
|
{ |
294 |
3 |
addInternalFrameListener(new InternalFrameAdapter() |
295 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
296 |
2 |
@Override... |
297 |
|
public void internalFrameClosed(InternalFrameEvent evt) |
298 |
|
{ |
299 |
2 |
close(); |
300 |
|
}; |
301 |
|
}); |
302 |
|
} |
303 |
|
|
304 |
|
|
305 |
|
|
306 |
|
|
307 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
308 |
3 |
protected void addKeyListener()... |
309 |
|
{ |
310 |
3 |
addKeyListener(new KeyAdapter() |
311 |
|
{ |
312 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
313 |
0 |
@Override... |
314 |
|
public void keyPressed(KeyEvent e) |
315 |
|
{ |
316 |
0 |
AlignFrame af = (AlignFrame) getFrameAtMouse(); |
317 |
|
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
0 |
if (!overrideKey(e, af)) |
322 |
|
{ |
323 |
0 |
if (af != null) |
324 |
|
{ |
325 |
0 |
for (KeyListener kl : af.getKeyListeners()) |
326 |
|
{ |
327 |
0 |
kl.keyPressed(e); |
328 |
|
} |
329 |
|
} |
330 |
|
} |
331 |
|
} |
332 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
333 |
0 |
@Override... |
334 |
|
public void keyReleased(KeyEvent e) |
335 |
|
{ |
336 |
0 |
Component c = getFrameAtMouse(); |
337 |
0 |
if (c != null) |
338 |
|
{ |
339 |
0 |
for (KeyListener kl : c.getKeyListeners()) |
340 |
|
{ |
341 |
0 |
kl.keyReleased(e); |
342 |
|
} |
343 |
|
} |
344 |
|
} |
345 |
|
|
346 |
|
}); |
347 |
|
} |
348 |
|
|
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
353 |
|
|
354 |
|
|
355 |
|
|
356 |
|
|
357 |
|
@see |
358 |
|
@param |
359 |
|
@param |
360 |
|
@return |
361 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 7 |
Complexity Density: 0.37 |
|
362 |
0 |
protected boolean overrideKey(KeyEvent e, AlignFrame af)... |
363 |
|
{ |
364 |
0 |
boolean actioned = false; |
365 |
0 |
int keyCode = e.getKeyCode(); |
366 |
0 |
switch (keyCode) |
367 |
|
{ |
368 |
0 |
case KeyEvent.VK_DOWN: |
369 |
0 |
if (e.isAltDown() || !af.viewport.cursorMode) |
370 |
|
{ |
371 |
|
|
372 |
|
|
373 |
|
|
374 |
0 |
((AlignFrame) getTopFrame()).moveSelectedSequences(false); |
375 |
0 |
((AlignFrame) getBottomFrame()).moveSelectedSequences(false); |
376 |
0 |
actioned = true; |
377 |
0 |
e.consume(); |
378 |
|
} |
379 |
0 |
break; |
380 |
0 |
case KeyEvent.VK_UP: |
381 |
0 |
if (e.isAltDown() || !af.viewport.cursorMode) |
382 |
|
{ |
383 |
|
|
384 |
|
|
385 |
|
|
386 |
0 |
((AlignFrame) getTopFrame()).moveSelectedSequences(true); |
387 |
0 |
((AlignFrame) getBottomFrame()).moveSelectedSequences(true); |
388 |
0 |
actioned = true; |
389 |
0 |
e.consume(); |
390 |
|
} |
391 |
0 |
break; |
392 |
0 |
default: |
393 |
|
} |
394 |
0 |
return actioned; |
395 |
|
} |
396 |
|
|
397 |
|
|
398 |
|
|
399 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
400 |
3 |
private void addKeyBindings()... |
401 |
|
{ |
402 |
3 |
overrideDelegatedKeyBindings(); |
403 |
|
|
404 |
3 |
overrideImplementedKeyBindings(); |
405 |
|
} |
406 |
|
|
407 |
|
|
408 |
|
|
409 |
|
|
410 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
411 |
3 |
protected void overrideImplementedKeyBindings()... |
412 |
|
{ |
413 |
3 |
overrideFind(); |
414 |
3 |
overrideNewView(); |
415 |
3 |
overrideCloseView(); |
416 |
3 |
overrideExpandViews(); |
417 |
3 |
overrideGatherViews(); |
418 |
|
} |
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
423 |
3 |
protected void overrideCloseView()... |
424 |
|
{ |
425 |
3 |
AbstractAction action; |
426 |
|
|
427 |
|
|
428 |
|
|
429 |
3 |
KeyStroke key_cmdW = KeyStroke.getKeyStroke(KeyEvent.VK_W, |
430 |
|
jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false); |
431 |
3 |
action = new AbstractAction() |
432 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
433 |
0 |
@Override... |
434 |
|
public void actionPerformed(ActionEvent e) |
435 |
|
{ |
436 |
0 |
closeView_actionPerformed(); |
437 |
|
} |
438 |
|
}; |
439 |
3 |
overrideKeyBinding(key_cmdW, action); |
440 |
|
} |
441 |
|
|
442 |
|
|
443 |
|
|
444 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
445 |
3 |
protected void overrideNewView()... |
446 |
|
{ |
447 |
|
|
448 |
|
|
449 |
|
|
450 |
3 |
KeyStroke key_cmdT = KeyStroke.getKeyStroke(KeyEvent.VK_T, |
451 |
|
jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false); |
452 |
3 |
AbstractAction action = new AbstractAction() |
453 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
454 |
0 |
@Override... |
455 |
|
public void actionPerformed(ActionEvent e) |
456 |
|
{ |
457 |
0 |
newView_actionPerformed(); |
458 |
|
} |
459 |
|
}; |
460 |
3 |
overrideKeyBinding(key_cmdT, action); |
461 |
|
} |
462 |
|
|
463 |
|
|
464 |
|
|
465 |
|
|
466 |
|
|
467 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
468 |
3 |
protected void overrideDelegatedKeyBindings()... |
469 |
|
{ |
470 |
3 |
if (getTopFrame() instanceof AlignFrame) |
471 |
|
{ |
472 |
|
|
473 |
|
|
474 |
|
|
475 |
|
|
476 |
3 |
for (Entry<KeyStroke, JMenuItem> acc : ((AlignFrame) getTopFrame()) |
477 |
|
.getAccelerators().entrySet()) |
478 |
|
{ |
479 |
78 |
overrideKeyBinding(acc); |
480 |
|
} |
481 |
|
} |
482 |
|
} |
483 |
|
|
484 |
|
|
485 |
|
|
486 |
|
|
487 |
|
|
488 |
|
|
489 |
|
@param |
490 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
491 |
78 |
private void overrideKeyBinding(Entry<KeyStroke, JMenuItem> acc)... |
492 |
|
{ |
493 |
78 |
final KeyStroke ks = acc.getKey(); |
494 |
78 |
InputMap inputMap = this.getInputMap(JComponent.WHEN_FOCUSED); |
495 |
78 |
inputMap.put(ks, ks); |
496 |
78 |
this.getActionMap().put(ks, new AbstractAction() |
497 |
|
{ |
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
498 |
0 |
@Override... |
499 |
|
public void actionPerformed(ActionEvent e) |
500 |
|
{ |
501 |
0 |
Component c = getFrameAtMouse(); |
502 |
0 |
if (c != null && c instanceof AlignFrame) |
503 |
|
{ |
504 |
0 |
for (ActionListener a : ((AlignFrame) c).getAccelerators().get(ks) |
505 |
|
.getActionListeners()) |
506 |
|
{ |
507 |
0 |
a.actionPerformed(null); |
508 |
|
} |
509 |
|
} |
510 |
|
} |
511 |
|
}); |
512 |
|
} |
513 |
|
|
514 |
|
|
515 |
|
|
516 |
|
|
517 |
|
@param |
518 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
519 |
9 |
protected void overrideKeyBinding(KeyStroke ks, AbstractAction action)... |
520 |
|
{ |
521 |
9 |
this.getActionMap().put(ks, action); |
522 |
9 |
overrideMenuItem(ks, action); |
523 |
|
} |
524 |
|
|
525 |
|
|
526 |
|
|
527 |
|
|
528 |
|
|
529 |
|
|
530 |
|
|
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
|
535 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 2 |
Complexity Density: 0.13 |
|
536 |
0 |
protected void newView_actionPerformed()... |
537 |
|
{ |
538 |
0 |
AlignFrame topFrame = (AlignFrame) getTopFrame(); |
539 |
0 |
AlignFrame bottomFrame = (AlignFrame) getBottomFrame(); |
540 |
0 |
final boolean scaleProteinAsCdna = topFrame.viewport |
541 |
|
.isScaleProteinAsCdna(); |
542 |
|
|
543 |
0 |
AlignmentPanel newTopPanel = topFrame.newView(null, true); |
544 |
0 |
AlignmentPanel newBottomPanel = bottomFrame.newView(null, true); |
545 |
|
|
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
|
550 |
|
|
551 |
|
|
552 |
0 |
if (topFrame.getTabIndex() != bottomFrame.getTabIndex()) |
553 |
|
{ |
554 |
0 |
topFrame.setDisplayedView(newTopPanel); |
555 |
|
} |
556 |
|
|
557 |
0 |
newBottomPanel.av.setViewName(newTopPanel.av.getViewName()); |
558 |
0 |
newTopPanel.av.setCodingComplement(newBottomPanel.av); |
559 |
|
|
560 |
|
|
561 |
|
|
562 |
|
|
563 |
|
|
564 |
|
|
565 |
0 |
newTopPanel.av.setScaleProteinAsCdna(scaleProteinAsCdna); |
566 |
0 |
newBottomPanel.av.setScaleProteinAsCdna(scaleProteinAsCdna); |
567 |
|
|
568 |
|
|
569 |
|
|
570 |
|
|
571 |
0 |
adjustLayout(); |
572 |
|
|
573 |
0 |
final StructureSelectionManager ssm = StructureSelectionManager |
574 |
|
.getStructureSelectionManager(Desktop.instance); |
575 |
0 |
ssm.addCommandListener(newTopPanel.av); |
576 |
0 |
ssm.addCommandListener(newBottomPanel.av); |
577 |
|
} |
578 |
|
|
579 |
|
|
580 |
|
|
581 |
|
|
582 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
583 |
0 |
protected void closeView_actionPerformed()... |
584 |
|
{ |
585 |
0 |
int viewCount = ((AlignFrame) getTopFrame()).getAlignPanels().size(); |
586 |
0 |
if (viewCount < 2) |
587 |
|
{ |
588 |
0 |
close(); |
589 |
0 |
return; |
590 |
|
} |
591 |
|
|
592 |
0 |
AlignmentPanel topPanel = ((AlignFrame) getTopFrame()).alignPanel; |
593 |
0 |
AlignmentPanel bottomPanel = ((AlignFrame) getBottomFrame()).alignPanel; |
594 |
|
|
595 |
0 |
((AlignFrame) getTopFrame()).closeView(topPanel); |
596 |
0 |
((AlignFrame) getBottomFrame()).closeView(bottomPanel); |
597 |
|
|
598 |
|
} |
599 |
|
|
600 |
|
|
601 |
|
|
602 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
603 |
2 |
public void close()... |
604 |
|
{ |
605 |
2 |
((AlignFrame) getTopFrame()).closeMenuItem_actionPerformed(true); |
606 |
2 |
((AlignFrame) getBottomFrame()).closeMenuItem_actionPerformed(true); |
607 |
2 |
try |
608 |
|
{ |
609 |
2 |
this.setClosed(true); |
610 |
|
} catch (PropertyVetoException e) |
611 |
|
{ |
612 |
|
|
613 |
|
} |
614 |
|
} |
615 |
|
|
616 |
|
|
617 |
|
|
618 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
619 |
3 |
protected void overrideExpandViews()... |
620 |
|
{ |
621 |
3 |
KeyStroke key_X = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0, false); |
622 |
3 |
AbstractAction action = new AbstractAction() |
623 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
624 |
0 |
@Override... |
625 |
|
public void actionPerformed(ActionEvent e) |
626 |
|
{ |
627 |
0 |
expandViews_actionPerformed(); |
628 |
|
} |
629 |
|
}; |
630 |
3 |
overrideMenuItem(key_X, action); |
631 |
|
} |
632 |
|
|
633 |
|
|
634 |
|
|
635 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
636 |
3 |
protected void overrideGatherViews()... |
637 |
|
{ |
638 |
3 |
KeyStroke key_G = KeyStroke.getKeyStroke(KeyEvent.VK_G, 0, false); |
639 |
3 |
AbstractAction action = new AbstractAction() |
640 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
641 |
0 |
@Override... |
642 |
|
public void actionPerformed(ActionEvent e) |
643 |
|
{ |
644 |
0 |
gatherViews_actionPerformed(); |
645 |
|
} |
646 |
|
}; |
647 |
3 |
overrideMenuItem(key_G, action); |
648 |
|
} |
649 |
|
|
650 |
|
|
651 |
|
|
652 |
|
|
653 |
|
|
654 |
|
@param |
655 |
|
@param |
656 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
657 |
15 |
private void overrideMenuItem(KeyStroke ks, AbstractAction action)... |
658 |
|
{ |
659 |
15 |
overrideMenuItem(ks, action, getTopFrame()); |
660 |
15 |
overrideMenuItem(ks, action, getBottomFrame()); |
661 |
|
} |
662 |
|
|
663 |
|
|
664 |
|
|
665 |
|
|
666 |
|
|
667 |
|
@param |
668 |
|
@param |
669 |
|
@param |
670 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
671 |
30 |
private void overrideMenuItem(KeyStroke key, final AbstractAction action,... |
672 |
|
JComponent comp) |
673 |
|
{ |
674 |
30 |
if (comp instanceof AlignFrame) |
675 |
|
{ |
676 |
30 |
JMenuItem mi = ((AlignFrame) comp).getAccelerators().get(key); |
677 |
30 |
if (mi != null) |
678 |
|
{ |
679 |
30 |
for (ActionListener al : mi.getActionListeners()) |
680 |
|
{ |
681 |
30 |
mi.removeActionListener(al); |
682 |
|
} |
683 |
30 |
mi.addActionListener(new ActionListener() |
684 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
685 |
0 |
@Override... |
686 |
|
public void actionPerformed(ActionEvent e) |
687 |
|
{ |
688 |
0 |
action.actionPerformed(e); |
689 |
|
} |
690 |
|
}); |
691 |
|
} |
692 |
|
} |
693 |
|
} |
694 |
|
|
695 |
|
|
696 |
|
|
697 |
|
|
698 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
699 |
0 |
protected void expandViews_actionPerformed()... |
700 |
|
{ |
701 |
0 |
Desktop.instance.explodeViews(this); |
702 |
|
} |
703 |
|
|
704 |
|
|
705 |
|
|
706 |
|
|
707 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
708 |
0 |
protected void gatherViews_actionPerformed()... |
709 |
|
{ |
710 |
0 |
Desktop.instance.gatherViews(this); |
711 |
|
} |
712 |
|
|
713 |
|
|
714 |
|
|
715 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
716 |
0 |
@Override... |
717 |
|
public AlignmentI getComplement(Object alignFrame) |
718 |
|
{ |
719 |
0 |
if (alignFrame == this.getTopFrame()) |
720 |
|
{ |
721 |
0 |
return ((AlignFrame) getBottomFrame()).viewport.getAlignment(); |
722 |
|
} |
723 |
0 |
else if (alignFrame == this.getBottomFrame()) |
724 |
|
{ |
725 |
0 |
return ((AlignFrame) getTopFrame()).viewport.getAlignment(); |
726 |
|
} |
727 |
0 |
return null; |
728 |
|
} |
729 |
|
|
730 |
|
|
731 |
|
|
732 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
733 |
0 |
@Override... |
734 |
|
public String getComplementTitle(Object alignFrame) |
735 |
|
{ |
736 |
0 |
if (alignFrame == this.getTopFrame()) |
737 |
|
{ |
738 |
0 |
return ((AlignFrame) getBottomFrame()).getTitle(); |
739 |
|
} |
740 |
0 |
else if (alignFrame == this.getBottomFrame()) |
741 |
|
{ |
742 |
0 |
return ((AlignFrame) getTopFrame()).getTitle(); |
743 |
|
} |
744 |
0 |
return null; |
745 |
|
} |
746 |
|
|
747 |
|
|
748 |
|
|
749 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
750 |
0 |
@Override... |
751 |
|
public void setComplementVisible(Object alignFrame, boolean show) |
752 |
|
{ |
753 |
|
|
754 |
|
|
755 |
|
|
756 |
0 |
if (alignFrame == getTopFrame()) |
757 |
|
{ |
758 |
0 |
((AlignFrame) getBottomFrame()).alignPanel.setVisible(show); |
759 |
|
} |
760 |
0 |
else if (alignFrame == getBottomFrame()) |
761 |
|
{ |
762 |
0 |
((AlignFrame) getTopFrame()).alignPanel.setVisible(show); |
763 |
|
} |
764 |
0 |
super.setComplementVisible(alignFrame, show); |
765 |
|
} |
766 |
|
|
767 |
|
|
768 |
|
|
769 |
|
|
770 |
|
@return |
771 |
|
|
772 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
773 |
0 |
public List<AlignFrame> getAlignFrames()... |
774 |
|
{ |
775 |
0 |
return Arrays |
776 |
|
.asList(new AlignFrame[] |
777 |
|
{ (AlignFrame) getTopFrame(), (AlignFrame) getBottomFrame() }); |
778 |
|
} |
779 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
780 |
0 |
@Override... |
781 |
|
public AlignFrame getComplementAlignFrame( |
782 |
|
AlignViewControllerGuiI alignFrame) |
783 |
|
{ |
784 |
0 |
if (getTopFrame() == alignFrame) |
785 |
|
{ |
786 |
0 |
return (AlignFrame) getBottomFrame(); |
787 |
|
} |
788 |
0 |
if (getBottomFrame() == alignFrame) |
789 |
|
{ |
790 |
0 |
return (AlignFrame) getTopFrame(); |
791 |
|
} |
792 |
|
|
793 |
0 |
return null; |
794 |
|
} |
795 |
|
|
796 |
|
|
797 |
|
|
798 |
|
|
799 |
|
|
800 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
801 |
3 |
protected void overrideFind()... |
802 |
|
{ |
803 |
|
|
804 |
|
|
805 |
|
|
806 |
3 |
KeyStroke key_cmdF = KeyStroke.getKeyStroke(KeyEvent.VK_F, |
807 |
|
jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false); |
808 |
3 |
AbstractAction action = new AbstractAction() |
809 |
|
{ |
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
810 |
0 |
@Override... |
811 |
|
public void actionPerformed(ActionEvent e) |
812 |
|
{ |
813 |
0 |
Component c = getFrameAtMouse(); |
814 |
0 |
if (c != null && c instanceof AlignFrame) |
815 |
|
{ |
816 |
0 |
AlignFrame af = (AlignFrame) c; |
817 |
0 |
new Finder(af.viewport, af.alignPanel); |
818 |
|
} |
819 |
|
} |
820 |
|
}; |
821 |
3 |
overrideKeyBinding(key_cmdF, action); |
822 |
|
} |
823 |
|
|
824 |
|
|
825 |
|
|
826 |
|
|
|
|
| 53.8% |
Uncovered Elements: 6 (13) |
Complexity: 5 |
Complexity Density: 0.71 |
|
827 |
11 |
@Override... |
828 |
|
public void setSelected(boolean selected) throws PropertyVetoException |
829 |
|
{ |
830 |
11 |
JDesktopPane desktopPane = getDesktopPane(); |
831 |
11 |
JInternalFrame fr = desktopPane == null ? null |
832 |
|
: desktopPane.getSelectedFrame(); |
833 |
11 |
if (fr == getTopFrame() || fr == getBottomFrame()) |
834 |
|
{ |
835 |
|
|
836 |
|
|
837 |
|
|
838 |
|
|
839 |
|
|
840 |
0 |
if (selected) |
841 |
|
{ |
842 |
0 |
moveToFront(); |
843 |
|
} |
844 |
0 |
return; |
845 |
|
} |
846 |
11 |
super.setSelected(selected); |
847 |
|
} |
848 |
|
|
849 |
|
|
850 |
|
|
851 |
|
|
852 |
|
JInternalFrame featureSettingsUI; |
853 |
|
|
854 |
|
JTabbedPane featureSettingsPanels; |
855 |
|
|
|
|
| 0% |
Uncovered Elements: 51 (51) |
Complexity: 8 |
Complexity Density: 0.21 |
|
856 |
0 |
@Override... |
857 |
|
public void addFeatureSettingsUI( |
858 |
|
FeatureSettingsControllerGuiI featureSettings) |
859 |
|
{ |
860 |
0 |
boolean showInternalFrame = false; |
861 |
0 |
if (featureSettingsUI == null || featureSettingsPanels == null) |
862 |
|
{ |
863 |
0 |
showInternalFrame = true; |
864 |
0 |
featureSettingsPanels = new JTabbedPane(); |
865 |
0 |
featureSettingsPanels.addChangeListener(new ChangeListener() |
866 |
|
{ |
867 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 7 |
Complexity Density: 1.17 |
|
868 |
0 |
@Override... |
869 |
|
public void stateChanged(ChangeEvent e) |
870 |
|
{ |
871 |
0 |
if (e.getSource() != featureSettingsPanels |
872 |
|
|| featureSettingsUI == null |
873 |
|
|| featureSettingsUI.isClosed() |
874 |
|
|| !featureSettingsUI.isVisible()) |
875 |
|
{ |
876 |
|
|
877 |
0 |
return; |
878 |
|
} |
879 |
0 |
int tab = featureSettingsPanels.getSelectedIndex(); |
880 |
0 |
if (tab < 0 || featureSettingsPanels |
881 |
|
.getSelectedComponent() instanceof FeatureSettingsControllerGuiI) |
882 |
|
{ |
883 |
|
|
884 |
0 |
return; |
885 |
|
} |
886 |
0 |
getAlignFrames().get(tab).showFeatureSettingsUI(); |
887 |
|
} |
888 |
|
}); |
889 |
0 |
featureSettingsUI = new JInternalFrame(MessageManager.getString( |
890 |
|
"label.sequence_feature_settings_for_CDS_and_Protein")); |
891 |
0 |
featureSettingsPanels.setOpaque(true); |
892 |
|
|
893 |
0 |
JPanel dialog = new JPanel(); |
894 |
0 |
dialog.setOpaque(true); |
895 |
0 |
dialog.setLayout(new BorderLayout()); |
896 |
0 |
dialog.add(featureSettingsPanels, BorderLayout.CENTER); |
897 |
0 |
JPanel buttons = new JPanel(); |
898 |
0 |
JButton ok = new JButton(MessageManager.getString("action.ok")); |
899 |
0 |
ok.addActionListener(new ActionListener() |
900 |
|
{ |
901 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
902 |
0 |
@Override... |
903 |
|
public void actionPerformed(ActionEvent e) |
904 |
|
{ |
905 |
0 |
try |
906 |
|
{ |
907 |
0 |
featureSettingsUI.setClosed(true); |
908 |
|
} catch (PropertyVetoException pv) |
909 |
|
{ |
910 |
0 |
pv.printStackTrace(); |
911 |
|
} |
912 |
|
} |
913 |
|
}); |
914 |
0 |
JButton cancel = new JButton( |
915 |
|
MessageManager.getString("action.cancel")); |
916 |
0 |
cancel.addActionListener(new ActionListener() |
917 |
|
{ |
918 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
919 |
0 |
@Override... |
920 |
|
public void actionPerformed(ActionEvent e) |
921 |
|
{ |
922 |
0 |
try |
923 |
|
{ |
924 |
0 |
for (Component fspanel : featureSettingsPanels.getComponents()) |
925 |
|
{ |
926 |
0 |
if (fspanel instanceof FeatureSettingsControllerGuiI) |
927 |
|
{ |
928 |
0 |
((FeatureSettingsControllerGuiI) fspanel).revert(); |
929 |
|
} |
930 |
|
} |
931 |
0 |
featureSettingsUI.setClosed(true); |
932 |
|
} catch (Exception pv) |
933 |
|
{ |
934 |
0 |
pv.printStackTrace(); |
935 |
|
} |
936 |
|
} |
937 |
|
}); |
938 |
0 |
buttons.add(ok); |
939 |
0 |
buttons.add(cancel); |
940 |
0 |
dialog.add(buttons, BorderLayout.SOUTH); |
941 |
0 |
featureSettingsUI.setContentPane(dialog); |
942 |
0 |
createDummyTabs(); |
943 |
|
} |
944 |
0 |
if (featureSettingsPanels |
945 |
|
.indexOfTabComponent((Component) featureSettings) > -1) |
946 |
|
{ |
947 |
|
|
948 |
0 |
featureSettingsPanels |
949 |
|
.setSelectedComponent((Component) featureSettings); |
950 |
0 |
return; |
951 |
|
} |
952 |
|
|
953 |
0 |
int pos = getAlignFrames().indexOf(featureSettings.getAlignframe()); |
954 |
|
|
955 |
0 |
if (pos == 0) |
956 |
|
{ |
957 |
0 |
featureSettingsPanels.removeTabAt(0); |
958 |
0 |
featureSettingsPanels.insertTab(tabName[0], null, |
959 |
|
(Component) featureSettings, |
960 |
|
MessageManager.formatMessage( |
961 |
|
"label.sequence_feature_settings_for", tabName[0]), |
962 |
|
0); |
963 |
|
} |
964 |
0 |
if (pos == 1) |
965 |
|
{ |
966 |
0 |
featureSettingsPanels.removeTabAt(1); |
967 |
0 |
featureSettingsPanels.insertTab(tabName[1], null, |
968 |
|
(Component) featureSettings, |
969 |
|
MessageManager.formatMessage( |
970 |
|
"label.sequence_feature_settings_for", tabName[1]), |
971 |
|
1); |
972 |
|
} |
973 |
0 |
featureSettingsPanels.setSelectedComponent((Component) featureSettings); |
974 |
|
|
975 |
|
|
976 |
|
|
977 |
|
|
978 |
0 |
if (showInternalFrame) |
979 |
|
{ |
980 |
0 |
if (Platform.isAMacAndNotJS()) |
981 |
|
{ |
982 |
0 |
Desktop.addInternalFrame(featureSettingsUI, |
983 |
|
MessageManager.getString( |
984 |
|
"label.sequence_feature_settings_for_CDS_and_Protein"), |
985 |
|
600, 480); |
986 |
|
} |
987 |
|
else |
988 |
|
{ |
989 |
0 |
Desktop.addInternalFrame(featureSettingsUI, |
990 |
|
MessageManager.getString( |
991 |
|
"label.sequence_feature_settings_for_CDS_and_Protein"), |
992 |
|
600, 450); |
993 |
|
} |
994 |
0 |
featureSettingsUI |
995 |
|
.setMinimumSize(new Dimension(FS_MIN_WIDTH, FS_MIN_HEIGHT)); |
996 |
|
|
997 |
0 |
featureSettingsUI.addInternalFrameListener( |
998 |
|
new javax.swing.event.InternalFrameAdapter() |
999 |
|
{ |
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
1000 |
0 |
@Override... |
1001 |
|
public void internalFrameClosed( |
1002 |
|
javax.swing.event.InternalFrameEvent evt) |
1003 |
|
{ |
1004 |
0 |
for (int tab = 0; tab < featureSettingsPanels |
1005 |
|
.getTabCount();) |
1006 |
|
{ |
1007 |
0 |
FeatureSettingsControllerGuiI fsettings = (FeatureSettingsControllerGuiI) featureSettingsPanels |
1008 |
|
.getTabComponentAt(tab); |
1009 |
0 |
if (fsettings != null) |
1010 |
|
{ |
1011 |
0 |
featureSettingsPanels.removeTabAt(tab); |
1012 |
0 |
fsettings.featureSettings_isClosed(); |
1013 |
|
} |
1014 |
|
else |
1015 |
|
{ |
1016 |
0 |
tab++; |
1017 |
|
} |
1018 |
|
} |
1019 |
0 |
featureSettingsPanels = null; |
1020 |
0 |
featureSettingsUI = null; |
1021 |
|
}; |
1022 |
|
}); |
1023 |
0 |
featureSettingsUI.setLayer(JLayeredPane.PALETTE_LAYER); |
1024 |
|
} |
1025 |
|
} |
1026 |
|
|
1027 |
|
|
1028 |
|
|
1029 |
|
|
1030 |
|
private String[] tabName = new String[] { |
1031 |
|
MessageManager.getString("label.CDS"), |
1032 |
|
MessageManager.getString("label.protein") }; |
1033 |
|
|
1034 |
|
|
1035 |
|
|
1036 |
|
|
1037 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1038 |
0 |
private void createDummyTabs()... |
1039 |
|
{ |
1040 |
0 |
for (int tabIndex = 0; tabIndex < 2; tabIndex++) |
1041 |
|
{ |
1042 |
0 |
JPanel dummyTab = new JPanel(); |
1043 |
0 |
featureSettingsPanels.addTab(tabName[tabIndex], dummyTab); |
1044 |
|
} |
1045 |
|
} |
1046 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
1047 |
0 |
private void replaceWithDummyTab(FeatureSettingsControllerI toClose)... |
1048 |
|
{ |
1049 |
0 |
Component dummyTab = null; |
1050 |
0 |
for (int tabIndex = 0; tabIndex < 2; tabIndex++) |
1051 |
|
{ |
1052 |
0 |
if (featureSettingsPanels.getTabCount() > tabIndex) |
1053 |
|
{ |
1054 |
0 |
dummyTab = featureSettingsPanels.getTabComponentAt(tabIndex); |
1055 |
0 |
if (dummyTab instanceof FeatureSettingsControllerGuiI |
1056 |
|
&& !dummyTab.isVisible()) |
1057 |
|
{ |
1058 |
0 |
featureSettingsPanels.removeTabAt(tabIndex); |
1059 |
|
|
1060 |
0 |
((FeatureSettingsControllerGuiI) dummyTab) |
1061 |
|
.featureSettings_isClosed(); |
1062 |
|
|
1063 |
0 |
dummyTab = new JPanel(); |
1064 |
0 |
featureSettingsPanels.insertTab(tabName[tabIndex], null, dummyTab, |
1065 |
|
MessageManager.formatMessage( |
1066 |
|
"label.sequence_feature_settings_for", |
1067 |
|
tabName[tabIndex]), |
1068 |
|
tabIndex); |
1069 |
|
} |
1070 |
|
} |
1071 |
|
} |
1072 |
|
} |
1073 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
1074 |
0 |
@Override... |
1075 |
|
public void closeFeatureSettings( |
1076 |
|
FeatureSettingsControllerI featureSettings, |
1077 |
|
boolean closeContainingFrame) |
1078 |
|
{ |
1079 |
0 |
if (featureSettingsUI != null) |
1080 |
|
{ |
1081 |
0 |
if (closeContainingFrame) |
1082 |
|
{ |
1083 |
0 |
try |
1084 |
|
{ |
1085 |
0 |
featureSettingsUI.setClosed(true); |
1086 |
|
} catch (Exception x) |
1087 |
|
{ |
1088 |
|
} |
1089 |
0 |
featureSettingsUI = null; |
1090 |
|
} |
1091 |
|
else |
1092 |
|
{ |
1093 |
0 |
replaceWithDummyTab(featureSettings); |
1094 |
|
} |
1095 |
|
} |
1096 |
|
} |
1097 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1098 |
0 |
@Override... |
1099 |
|
public boolean isFeatureSettingsOpen() |
1100 |
|
{ |
1101 |
0 |
return featureSettingsUI != null && !featureSettingsUI.isClosed(); |
1102 |
|
} |
1103 |
|
} |