1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
package jalview.jbgui; |
23 |
|
|
24 |
|
import java.awt.BorderLayout; |
25 |
|
import java.awt.CardLayout; |
26 |
|
import java.awt.Component; |
27 |
|
import java.awt.Dimension; |
28 |
|
import java.awt.FlowLayout; |
29 |
|
import java.awt.Font; |
30 |
|
import java.awt.GridBagConstraints; |
31 |
|
import java.awt.GridBagLayout; |
32 |
|
import java.awt.GridLayout; |
33 |
|
import java.awt.Insets; |
34 |
|
import java.awt.Point; |
35 |
|
import java.awt.event.ActionEvent; |
36 |
|
import java.awt.event.ActionListener; |
37 |
|
import java.awt.event.ItemEvent; |
38 |
|
import java.awt.event.ItemListener; |
39 |
|
import java.awt.event.KeyAdapter; |
40 |
|
import java.awt.event.KeyEvent; |
41 |
|
import java.awt.event.MouseAdapter; |
42 |
|
import java.awt.event.MouseEvent; |
43 |
|
import java.util.Arrays; |
44 |
|
import java.util.HashMap; |
45 |
|
import java.util.Map; |
46 |
|
|
47 |
|
import javax.swing.ImageIcon; |
48 |
|
import javax.swing.JButton; |
49 |
|
import javax.swing.JCheckBox; |
50 |
|
import javax.swing.JComboBox; |
51 |
|
import javax.swing.JFrame; |
52 |
|
import javax.swing.JInternalFrame; |
53 |
|
import javax.swing.JLabel; |
54 |
|
import javax.swing.JList; |
55 |
|
import javax.swing.JPanel; |
56 |
|
import javax.swing.JScrollPane; |
57 |
|
import javax.swing.JSeparator; |
58 |
|
import javax.swing.JTabbedPane; |
59 |
|
import javax.swing.JTable; |
60 |
|
import javax.swing.JTextField; |
61 |
|
import javax.swing.ListCellRenderer; |
62 |
|
import javax.swing.SwingConstants; |
63 |
|
import javax.swing.Timer; |
64 |
|
import javax.swing.event.ChangeEvent; |
65 |
|
import javax.swing.event.ChangeListener; |
66 |
|
import javax.swing.event.DocumentEvent; |
67 |
|
import javax.swing.event.DocumentListener; |
68 |
|
import javax.swing.event.InternalFrameEvent; |
69 |
|
import javax.swing.table.TableColumn; |
70 |
|
|
71 |
|
import jalview.datamodel.SequenceI; |
72 |
|
import jalview.fts.api.FTSDataColumnI; |
73 |
|
import jalview.fts.core.FTSDataColumnPreferences; |
74 |
|
import jalview.gui.AlignmentPanel; |
75 |
|
import jalview.gui.Desktop; |
76 |
|
import jalview.gui.JvSwingUtils; |
77 |
|
import jalview.gui.StructureViewer; |
78 |
|
import jalview.structure.StructureImportSettings; |
79 |
|
import jalview.structure.StructureImportSettings.TFType; |
80 |
|
import jalview.util.MessageManager; |
81 |
|
import jalview.util.Platform; |
82 |
|
import net.miginfocom.swing.MigLayout; |
83 |
|
|
84 |
|
@SuppressWarnings("serial") |
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
@author |
89 |
|
|
90 |
|
|
|
|
| 52% |
Uncovered Elements: 194 (404) |
Complexity: 84 |
Complexity Density: 0.28 |
|
91 |
|
public abstract class GStructureChooser extends JPanel |
92 |
|
implements ItemListener |
93 |
|
{ |
94 |
|
private static final Font VERDANA_12 = new Font("Verdana", 0, 12); |
95 |
|
|
96 |
|
private static final Font VERDANA_10 = new Font("Verdana", 0, 10); |
97 |
|
|
98 |
|
public static final String VIEWS_FILTER = "VIEWS_FILTER"; |
99 |
|
|
100 |
|
protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE"; |
101 |
|
|
102 |
|
protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID"; |
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB"; |
108 |
|
|
109 |
|
protected JPanel actionsPanel; |
110 |
|
|
111 |
|
protected JPanel statusPanel = new JPanel(); |
112 |
|
|
113 |
|
public JLabel statusBar = new JLabel(); |
114 |
|
|
115 |
|
protected String frameTitle = MessageManager |
116 |
|
.getString("label.structure_chooser"); |
117 |
|
|
118 |
|
protected JInternalFrame mainFrame = new JInternalFrame(frameTitle); |
119 |
|
|
120 |
|
protected JComboBox<FilterOption> cmb_filterOption = new JComboBox<>(); |
121 |
|
|
122 |
|
protected AlignmentPanel ap; |
123 |
|
|
124 |
|
protected StringBuilder errorWarning = new StringBuilder(); |
125 |
|
|
126 |
|
protected JButton btn_cancel; |
127 |
|
|
128 |
|
protected JButton btn_add; |
129 |
|
|
130 |
|
protected JButton btn_newView; |
131 |
|
|
132 |
|
protected JButton btn_pdbFromFile = new JButton(); |
133 |
|
|
134 |
|
protected JLabel lbl_pdbFile = new JLabel(); |
135 |
|
|
136 |
|
protected JLabel lbl_chooseTempFacType = new JLabel(); |
137 |
|
|
138 |
|
protected JComboBox<StructureImportSettings.TFType> combo_tempFacAs = new JComboBox<>(); |
139 |
|
|
140 |
|
protected boolean tempFacAsChanged = false; |
141 |
|
|
142 |
|
protected JButton btn_paeMatrixFile = new JButton(); |
143 |
|
|
144 |
|
protected JLabel lbl_paeFile = new JLabel(); |
145 |
|
|
146 |
|
|
147 |
|
protected JPanel pnl_queryTDB; |
148 |
|
|
149 |
|
protected JButton btn_queryTDB = new JButton(); |
150 |
|
|
151 |
|
protected JCheckBox chk_superpose = new JCheckBox( |
152 |
|
MessageManager.getString("label.superpose_structures")); |
153 |
|
|
154 |
|
protected JTextField txt_search = new JTextField(14); |
155 |
|
|
156 |
|
protected JPanel pnl_switchableViews = new JPanel(new CardLayout()); |
157 |
|
|
158 |
|
protected CardLayout layout_switchableViews = (CardLayout) (pnl_switchableViews |
159 |
|
.getLayout()); |
160 |
|
|
161 |
|
protected JCheckBox chk_invertFilter = new JCheckBox( |
162 |
|
MessageManager.getString("label.invert")); |
163 |
|
|
164 |
|
protected ImageIcon loadingImage = new ImageIcon( |
165 |
|
getClass().getResource("/images/loading.gif")); |
166 |
|
|
167 |
|
protected ImageIcon goodImage = new ImageIcon( |
168 |
|
getClass().getResource("/images/good.png")); |
169 |
|
|
170 |
|
protected ImageIcon errorImage = new ImageIcon( |
171 |
|
getClass().getResource("/images/error.png")); |
172 |
|
|
173 |
|
protected ImageIcon warningImage = new ImageIcon( |
174 |
|
getClass().getResource("/images/warning.gif")); |
175 |
|
|
176 |
|
protected ImageIcon tdbImage = new ImageIcon(getClass() |
177 |
|
.getResource("/images/3d-beacons-logo-transparent.png")); |
178 |
|
|
179 |
|
protected JLabel lbl_loading = new JLabel(loadingImage); |
180 |
|
|
181 |
|
protected JLabel lbl_pdbManualFetchStatus = new JLabel(errorImage); |
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
protected AssociateSeqPanel idInputAssSeqPanel = new AssociateSeqPanel(); |
186 |
|
|
187 |
|
protected AssociateSeqPanel fileChooserAssSeqPanel = new AssociateSeqPanel(); |
188 |
|
|
189 |
|
protected JComboBox<StructureViewer> targetView = new JComboBox<>(); |
190 |
|
|
191 |
|
protected JTable tbl_local_pdb = new JTable(); |
192 |
|
|
193 |
|
protected JTabbedPane pnl_filter = new JTabbedPane(); |
194 |
|
|
195 |
|
protected abstract FTSDataColumnPreferences getFTSDocFieldPrefs(); |
196 |
|
|
197 |
|
protected abstract void setFTSDocFieldPrefs( |
198 |
|
FTSDataColumnPreferences newPrefs); |
199 |
|
|
200 |
|
protected FTSDataColumnI[] previousWantedFields; |
201 |
|
|
202 |
|
protected static Map<String, Integer> tempUserPrefs = new HashMap<>(); |
203 |
|
|
204 |
|
private JTable tbl_summary = new JTable() |
205 |
|
{ |
206 |
|
private boolean inLayout; |
207 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
208 |
527 |
@Override... |
209 |
|
public boolean getScrollableTracksViewportWidth() |
210 |
|
{ |
211 |
527 |
return hasExcessWidth(); |
212 |
|
|
213 |
|
} |
214 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
215 |
73 |
@Override... |
216 |
|
public void doLayout() |
217 |
|
{ |
218 |
73 |
if (hasExcessWidth()) |
219 |
|
{ |
220 |
72 |
autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; |
221 |
|
} |
222 |
73 |
inLayout = true; |
223 |
73 |
super.doLayout(); |
224 |
73 |
inLayout = false; |
225 |
73 |
autoResizeMode = AUTO_RESIZE_OFF; |
226 |
|
} |
227 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
228 |
600 |
protected boolean hasExcessWidth()... |
229 |
|
{ |
230 |
600 |
return getPreferredSize().width < getParent().getWidth(); |
231 |
|
} |
232 |
|
|
|
|
| 50% |
Uncovered Elements: 6 (12) |
Complexity: 5 |
Complexity Density: 0.62 |
|
233 |
101 |
@Override... |
234 |
|
public void columnMarginChanged(ChangeEvent e) |
235 |
|
{ |
236 |
101 |
if (isEditing()) |
237 |
|
{ |
238 |
0 |
removeEditor(); |
239 |
|
} |
240 |
101 |
TableColumn resizingColumn = getTableHeader().getResizingColumn(); |
241 |
|
|
242 |
|
|
243 |
101 |
if (resizingColumn != null && autoResizeMode == AUTO_RESIZE_OFF |
244 |
|
&& !inLayout) |
245 |
|
{ |
246 |
0 |
resizingColumn.setPreferredWidth(resizingColumn.getWidth()); |
247 |
0 |
String colHeader = resizingColumn.getHeaderValue().toString(); |
248 |
0 |
tempUserPrefs.put(colHeader, resizingColumn.getWidth()); |
249 |
|
} |
250 |
101 |
resizeAndRepaint(); |
251 |
|
} |
252 |
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 5 |
Complexity Density: 0.5 |
|
253 |
0 |
@Override... |
254 |
|
public String getToolTipText(MouseEvent evt) |
255 |
|
{ |
256 |
0 |
String toolTipText = null; |
257 |
0 |
java.awt.Point pnt = evt.getPoint(); |
258 |
0 |
int rowIndex = rowAtPoint(pnt); |
259 |
0 |
int colIndex = columnAtPoint(pnt); |
260 |
|
|
261 |
0 |
try |
262 |
|
{ |
263 |
0 |
if (getValueAt(rowIndex, colIndex) == null) |
264 |
|
{ |
265 |
0 |
return null; |
266 |
|
} |
267 |
0 |
toolTipText = getValueAt(rowIndex, colIndex).toString(); |
268 |
|
} catch (Exception e) |
269 |
|
{ |
270 |
|
|
271 |
|
} |
272 |
0 |
toolTipText = (toolTipText == null ? null |
273 |
0 |
: (toolTipText.length() > 500 |
274 |
|
? JvSwingUtils.wrapTooltip(true, |
275 |
|
"\"" + toolTipText.subSequence(0, 500) |
276 |
|
+ "...\"") |
277 |
|
: JvSwingUtils.wrapTooltip(true, toolTipText))); |
278 |
0 |
return toolTipText; |
279 |
|
} |
280 |
|
}; |
281 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
282 |
55 |
public GStructureChooser()... |
283 |
|
{ |
284 |
|
} |
285 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.25 |
|
286 |
55 |
protected void initDialog()... |
287 |
|
{ |
288 |
|
|
289 |
55 |
try |
290 |
|
{ |
291 |
55 |
jbInit(); |
292 |
55 |
mainFrame.setFrameIcon(null); |
293 |
55 |
mainFrame.setVisible(false); |
294 |
55 |
mainFrame.invalidate(); |
295 |
55 |
mainFrame.pack(); |
296 |
|
} catch (Exception e) |
297 |
|
{ |
298 |
0 |
jalview.bin.Console.outPrintln(e); |
299 |
0 |
e.printStackTrace(); |
300 |
|
} |
301 |
|
} |
302 |
|
|
303 |
|
|
304 |
|
|
305 |
|
|
306 |
|
|
307 |
|
private Timer timer; |
308 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
309 |
0 |
protected void txt_search_ActionPerformedDelayed()... |
310 |
|
{ |
311 |
0 |
if (timer != null) |
312 |
|
{ |
313 |
0 |
timer.stop(); |
314 |
|
} |
315 |
0 |
timer = new Timer(300, new ActionListener() |
316 |
|
{ |
317 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
318 |
0 |
@Override... |
319 |
|
public void actionPerformed(ActionEvent e) |
320 |
|
{ |
321 |
0 |
txt_search_ActionPerformed(); |
322 |
|
} |
323 |
|
}); |
324 |
0 |
timer.setRepeats(false); |
325 |
0 |
timer.start(); |
326 |
|
} |
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
|
332 |
|
@throws |
333 |
|
|
|
|
| 96.3% |
Uncovered Elements: 6 (163) |
Complexity: 6 |
Complexity Density: 0.04 |
|
334 |
55 |
private void jbInit() throws Exception... |
335 |
|
{ |
336 |
55 |
Integer width = tempUserPrefs.get("structureChooser.width") == null |
337 |
|
? 800 |
338 |
|
: tempUserPrefs.get("structureChooser.width"); |
339 |
55 |
Integer height = tempUserPrefs.get("structureChooser.height") == null |
340 |
|
? 400 |
341 |
|
: tempUserPrefs.get("structureChooser.height"); |
342 |
55 |
tbl_summary.setAutoCreateRowSorter(true); |
343 |
55 |
tbl_summary.getTableHeader().setReorderingAllowed(false); |
344 |
55 |
tbl_summary.addMouseListener(new MouseAdapter() |
345 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
346 |
0 |
@Override... |
347 |
|
public void mousePressed(MouseEvent e) |
348 |
|
{ |
349 |
0 |
if (!popupAction(e)) |
350 |
|
{ |
351 |
0 |
super.mousePressed(e); |
352 |
|
} |
353 |
|
} |
354 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
355 |
0 |
@Override... |
356 |
|
public void mouseClicked(MouseEvent e) |
357 |
|
{ |
358 |
0 |
if (!popupAction(e)) |
359 |
|
{ |
360 |
0 |
validateSelections(); |
361 |
|
} |
362 |
|
} |
363 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
364 |
0 |
@Override... |
365 |
|
public void mouseReleased(MouseEvent e) |
366 |
|
{ |
367 |
0 |
if (!popupAction(e)) |
368 |
|
{ |
369 |
0 |
validateSelections(); |
370 |
|
} |
371 |
|
} |
372 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
373 |
0 |
boolean popupAction(MouseEvent e)... |
374 |
|
{ |
375 |
0 |
if (e.isPopupTrigger()) |
376 |
|
{ |
377 |
0 |
Point pt = e.getPoint(); |
378 |
0 |
int selectedRow = tbl_summary.rowAtPoint(pt); |
379 |
0 |
if (showPopupFor(selectedRow, pt.x, pt.y)) |
380 |
|
{ |
381 |
0 |
return true; |
382 |
|
} |
383 |
|
} |
384 |
0 |
return false; |
385 |
|
} |
386 |
|
}); |
387 |
55 |
tbl_summary.addKeyListener(new KeyAdapter() |
388 |
|
{ |
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 6 |
Complexity Density: 0.35 |
|
389 |
0 |
@Override... |
390 |
|
public void keyPressed(KeyEvent evt) |
391 |
|
{ |
392 |
0 |
validateSelections(); |
393 |
0 |
switch (evt.getKeyCode()) |
394 |
|
{ |
395 |
0 |
case KeyEvent.VK_ESCAPE: |
396 |
0 |
mainFrame.dispose(); |
397 |
0 |
break; |
398 |
0 |
case KeyEvent.VK_ENTER: |
399 |
0 |
if (btn_add.isEnabled()) |
400 |
|
{ |
401 |
0 |
add_ActionPerformed(); |
402 |
|
} |
403 |
0 |
break; |
404 |
0 |
case KeyEvent.VK_TAB: |
405 |
0 |
if (evt.isShiftDown()) |
406 |
|
{ |
407 |
0 |
pnl_filter.requestFocus(); |
408 |
|
} |
409 |
|
else |
410 |
|
{ |
411 |
0 |
btn_add.requestFocus(); |
412 |
|
} |
413 |
0 |
evt.consume(); |
414 |
0 |
break; |
415 |
0 |
default: |
416 |
0 |
return; |
417 |
|
} |
418 |
|
} |
419 |
|
}); |
420 |
|
|
421 |
55 |
btn_cancel = new JButton(MessageManager.getString("action.cancel")); |
422 |
55 |
btn_cancel.setFont(VERDANA_12); |
423 |
55 |
btn_cancel.addActionListener(new ActionListener() |
424 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
425 |
0 |
@Override... |
426 |
|
public void actionPerformed(ActionEvent e) |
427 |
|
{ |
428 |
0 |
closeAction(pnl_filter.getHeight()); |
429 |
|
} |
430 |
|
}); |
431 |
55 |
btn_cancel.addKeyListener(new KeyAdapter() |
432 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
433 |
0 |
@Override... |
434 |
|
public void keyPressed(KeyEvent evt) |
435 |
|
{ |
436 |
0 |
if (evt.getKeyCode() == KeyEvent.VK_ENTER) |
437 |
|
{ |
438 |
0 |
closeAction(pnl_filter.getHeight()); |
439 |
|
} |
440 |
|
} |
441 |
|
}); |
442 |
|
|
443 |
55 |
tbl_local_pdb.setAutoCreateRowSorter(true); |
444 |
55 |
tbl_local_pdb.getTableHeader().setReorderingAllowed(false); |
445 |
55 |
tbl_local_pdb.addMouseListener(new MouseAdapter() |
446 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
447 |
0 |
@Override... |
448 |
|
public void mouseClicked(MouseEvent e) |
449 |
|
{ |
450 |
0 |
validateSelections(); |
451 |
|
} |
452 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
453 |
0 |
@Override... |
454 |
|
public void mouseReleased(MouseEvent e) |
455 |
|
{ |
456 |
0 |
validateSelections(); |
457 |
|
} |
458 |
|
}); |
459 |
55 |
tbl_local_pdb.addKeyListener(new KeyAdapter() |
460 |
|
{ |
|
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 7 |
Complexity Density: 0.37 |
|
461 |
0 |
@Override... |
462 |
|
public void keyPressed(KeyEvent evt) |
463 |
|
{ |
464 |
0 |
validateSelections(); |
465 |
0 |
switch (evt.getKeyCode()) |
466 |
|
{ |
467 |
0 |
case KeyEvent.VK_ESCAPE: |
468 |
0 |
mainFrame.dispose(); |
469 |
0 |
break; |
470 |
0 |
case KeyEvent.VK_ENTER: |
471 |
0 |
if (btn_add.isEnabled()) |
472 |
|
{ |
473 |
0 |
add_ActionPerformed(); |
474 |
|
} |
475 |
0 |
break; |
476 |
0 |
case KeyEvent.VK_TAB: |
477 |
0 |
if (evt.isShiftDown()) |
478 |
|
{ |
479 |
0 |
cmb_filterOption.requestFocus(); |
480 |
|
} |
481 |
|
else |
482 |
|
{ |
483 |
0 |
if (btn_add.isEnabled()) |
484 |
|
{ |
485 |
0 |
btn_add.requestFocus(); |
486 |
|
} |
487 |
|
else |
488 |
|
{ |
489 |
0 |
btn_cancel.requestFocus(); |
490 |
|
} |
491 |
|
} |
492 |
0 |
evt.consume(); |
493 |
0 |
break; |
494 |
0 |
default: |
495 |
0 |
return; |
496 |
|
} |
497 |
|
} |
498 |
|
}); |
499 |
|
|
500 |
55 |
btn_newView = new JButton( |
501 |
|
MessageManager.formatMessage("action.new_structure_view_with", |
502 |
|
StructureViewer.getViewerType().toString())); |
503 |
55 |
btn_newView.setFont(VERDANA_12); |
504 |
55 |
btn_newView.addActionListener(new ActionListener() |
505 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
506 |
0 |
@Override... |
507 |
|
public void actionPerformed(ActionEvent e) |
508 |
|
{ |
509 |
0 |
newView_ActionPerformed(); |
510 |
|
} |
511 |
|
}); |
512 |
55 |
btn_newView.addKeyListener(new KeyAdapter() |
513 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
514 |
0 |
@Override... |
515 |
|
public void keyPressed(KeyEvent evt) |
516 |
|
{ |
517 |
0 |
if (evt.getKeyCode() == KeyEvent.VK_ENTER) |
518 |
|
{ |
519 |
0 |
newView_ActionPerformed(); |
520 |
|
} |
521 |
|
} |
522 |
|
}); |
523 |
|
|
524 |
|
|
525 |
|
|
526 |
|
|
527 |
55 |
btn_add = new JButton(MessageManager.getString("action.add")); |
528 |
55 |
btn_add.setFont(VERDANA_12); |
529 |
55 |
btn_add.addActionListener(new ActionListener() |
530 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
531 |
0 |
@Override... |
532 |
|
public void actionPerformed(ActionEvent e) |
533 |
|
{ |
534 |
0 |
add_ActionPerformed(); |
535 |
|
} |
536 |
|
}); |
537 |
55 |
btn_add.addKeyListener(new KeyAdapter() |
538 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
539 |
0 |
@Override... |
540 |
|
public void keyPressed(KeyEvent evt) |
541 |
|
{ |
542 |
0 |
if (evt.getKeyCode() == KeyEvent.VK_ENTER) |
543 |
|
{ |
544 |
0 |
add_ActionPerformed(); |
545 |
|
} |
546 |
|
} |
547 |
|
}); |
548 |
|
|
549 |
55 |
btn_pdbFromFile.setFont(VERDANA_12); |
550 |
55 |
String btn_title = MessageManager.getString("label.select_pdb_file"); |
551 |
55 |
btn_pdbFromFile.setText(btn_title + " "); |
552 |
55 |
btn_pdbFromFile.addActionListener(new ActionListener() |
553 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
554 |
0 |
@Override... |
555 |
|
public void actionPerformed(ActionEvent e) |
556 |
|
{ |
557 |
0 |
pdbFromFile_actionPerformed(); |
558 |
|
} |
559 |
|
}); |
560 |
55 |
btn_pdbFromFile.addKeyListener(new KeyAdapter() |
561 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
562 |
0 |
@Override... |
563 |
|
public void keyPressed(KeyEvent evt) |
564 |
|
{ |
565 |
0 |
if (evt.getKeyCode() == KeyEvent.VK_ENTER) |
566 |
|
{ |
567 |
0 |
pdbFromFile_actionPerformed(); |
568 |
|
} |
569 |
|
} |
570 |
|
}); |
571 |
55 |
lbl_pdbFile.setFont(VERDANA_10); |
572 |
55 |
lbl_pdbFile.setFont(VERDANA_10); |
573 |
|
|
574 |
55 |
lbl_chooseTempFacType.setFont(VERDANA_12); |
575 |
55 |
lbl_chooseTempFacType.setText( |
576 |
|
MessageManager.getString("label.interpret_tempfac_as")); |
577 |
|
|
578 |
55 |
combo_tempFacAs.setFont(VERDANA_12); |
579 |
55 |
for (TFType t : TFType.values()) |
580 |
|
{ |
581 |
110 |
combo_tempFacAs.addItem(t); |
582 |
|
} |
583 |
55 |
combo_tempFacAs.addItemListener(new ItemListener() |
584 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
585 |
0 |
@Override... |
586 |
|
public void itemStateChanged(ItemEvent e) |
587 |
|
{ |
588 |
|
|
589 |
0 |
tempFacAsChanged = true; |
590 |
|
} |
591 |
|
}); |
592 |
|
|
593 |
55 |
btn_paeMatrixFile.setFont(VERDANA_12); |
594 |
55 |
btn_paeMatrixFile |
595 |
|
.setText(MessageManager.getString("label.add_pae_matrix_file")); |
596 |
55 |
btn_paeMatrixFile.addActionListener(new ActionListener() |
597 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
598 |
0 |
@Override... |
599 |
|
public void actionPerformed(ActionEvent e) |
600 |
|
{ |
601 |
0 |
paeMatrixFile_actionPerformed(); |
602 |
|
} |
603 |
|
}); |
604 |
55 |
btn_paeMatrixFile.addKeyListener(new KeyAdapter() |
605 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
606 |
0 |
@Override... |
607 |
|
public void keyPressed(KeyEvent evt) |
608 |
|
{ |
609 |
0 |
if (evt.getKeyCode() == KeyEvent.VK_ENTER) |
610 |
|
{ |
611 |
0 |
paeMatrixFile_actionPerformed(); |
612 |
|
} |
613 |
|
} |
614 |
|
}); |
615 |
55 |
lbl_paeFile.setFont(VERDANA_10); |
616 |
|
|
617 |
55 |
JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary); |
618 |
55 |
scrl_foundStructures.setPreferredSize(new Dimension(width, height)); |
619 |
|
|
620 |
55 |
JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb); |
621 |
55 |
scrl_localPDB.setPreferredSize(new Dimension(width, height)); |
622 |
55 |
scrl_localPDB.setHorizontalScrollBarPolicy( |
623 |
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); |
624 |
|
|
625 |
55 |
chk_invertFilter.setFont(VERDANA_12); |
626 |
55 |
txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true, |
627 |
|
MessageManager.getString("label.enter_pdb_id_tip"))); |
628 |
55 |
txt_search.getDocument().addDocumentListener(new DocumentListener() |
629 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
630 |
0 |
@Override... |
631 |
|
public void insertUpdate(DocumentEvent e) |
632 |
|
{ |
633 |
0 |
txt_search_ActionPerformedDelayed(); |
634 |
|
} |
635 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
636 |
0 |
@Override... |
637 |
|
public void removeUpdate(DocumentEvent e) |
638 |
|
{ |
639 |
0 |
txt_search_ActionPerformedDelayed(); |
640 |
|
} |
641 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
642 |
0 |
@Override... |
643 |
|
public void changedUpdate(DocumentEvent e) |
644 |
|
{ |
645 |
0 |
txt_search_ActionPerformedDelayed(); |
646 |
|
} |
647 |
|
}); |
648 |
|
|
649 |
55 |
cmb_filterOption.setFont(VERDANA_12); |
650 |
55 |
cmb_filterOption.setToolTipText( |
651 |
|
MessageManager.getString("info.select_filter_option")); |
652 |
55 |
cmb_filterOption.addItemListener(this); |
653 |
|
|
654 |
55 |
cmb_filterOption.setRenderer(new CustomComboSeparatorsRenderer( |
655 |
|
(ListCellRenderer<Object>) cmb_filterOption.getRenderer()) |
656 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
657 |
23 |
@Override... |
658 |
|
protected boolean addSeparatorAfter(JList list, FilterOption value, |
659 |
|
int index) |
660 |
|
{ |
661 |
23 |
return value.isAddSeparatorAfter(); |
662 |
|
} |
663 |
|
}); |
664 |
|
|
665 |
55 |
chk_invertFilter.addItemListener(this); |
666 |
55 |
btn_queryTDB = new JButton(); |
667 |
55 |
if (Platform.isMac()) |
668 |
|
{ |
669 |
|
|
670 |
0 |
btn_queryTDB.putClientProperty("JButton.buttonType", "bevel"); |
671 |
|
} |
672 |
55 |
btn_queryTDB.setMargin(new Insets(0, 16, 0, 20)); |
673 |
55 |
btn_queryTDB |
674 |
|
.setText(MessageManager.getString("label.search_3dbeacons")); |
675 |
55 |
btn_queryTDB.setIconTextGap(12); |
676 |
55 |
btn_queryTDB.setIcon(tdbImage); |
677 |
55 |
btn_queryTDB.setVerticalTextPosition(SwingConstants.CENTER); |
678 |
55 |
btn_queryTDB.setHorizontalTextPosition(SwingConstants.TRAILING); |
679 |
55 |
btn_queryTDB.setFont(VERDANA_12); |
680 |
55 |
btn_queryTDB.setToolTipText( |
681 |
|
MessageManager.getString("label.find_models_from_3dbeacons")); |
682 |
|
|
683 |
55 |
btn_queryTDB.setVisible(false); |
684 |
|
|
685 |
55 |
targetView.setVisible(false); |
686 |
|
|
687 |
55 |
actionsPanel = new JPanel(new MigLayout()); |
688 |
55 |
actionsPanel.add(targetView, "left"); |
689 |
55 |
actionsPanel.add(btn_add, "wrap"); |
690 |
55 |
actionsPanel.add(chk_superpose, "left"); |
691 |
55 |
actionsPanel.add(btn_newView); |
692 |
55 |
actionsPanel.add(btn_cancel, "right"); |
693 |
|
|
694 |
55 |
JPanel pnl_main = new JPanel(new BorderLayout()); |
695 |
55 |
JPanel pnl_controls = new JPanel(); |
696 |
55 |
pnl_queryTDB = new JPanel(); |
697 |
55 |
pnl_queryTDB.setLayout(new FlowLayout(FlowLayout.CENTER, 4, 4)); |
698 |
55 |
pnl_queryTDB.setBackground(getBackground()); |
699 |
55 |
pnl_queryTDB.add(btn_queryTDB); |
700 |
|
|
701 |
55 |
pnl_queryTDB.setVisible(false); |
702 |
55 |
pnl_main.add(pnl_queryTDB, BorderLayout.NORTH); |
703 |
55 |
pnl_controls.add(cmb_filterOption); |
704 |
55 |
pnl_controls.add(lbl_loading); |
705 |
55 |
pnl_controls.add(chk_invertFilter); |
706 |
55 |
pnl_main.add(pnl_controls, BorderLayout.CENTER); |
707 |
55 |
lbl_loading.setVisible(false); |
708 |
|
|
709 |
|
|
710 |
|
|
711 |
|
|
712 |
|
|
713 |
55 |
JPanel pnl_fileOptions = new JPanel(); |
714 |
55 |
pnl_fileOptions.setLayout(new GridBagLayout()); |
715 |
55 |
GridBagConstraints gbc = new GridBagConstraints(); |
716 |
55 |
gbc.gridx = 0; |
717 |
55 |
gbc.gridy = 0; |
718 |
55 |
gbc.weightx = 0.0; |
719 |
55 |
gbc.weighty = 0.0; |
720 |
55 |
gbc.insets = new Insets(0, 0, 2, 0); |
721 |
55 |
gbc.fill = GridBagConstraints.NONE; |
722 |
55 |
gbc.anchor = GridBagConstraints.FIRST_LINE_START; |
723 |
|
|
724 |
55 |
pnl_fileOptions.add(btn_pdbFromFile, gbc); |
725 |
55 |
gbc.gridy++; |
726 |
55 |
gbc.insets = new Insets(0, 0, 18, 0); |
727 |
55 |
pnl_fileOptions.add(lbl_pdbFile, gbc); |
728 |
55 |
gbc.gridy++; |
729 |
|
|
730 |
55 |
gbc.insets = new Insets(0, 0, 2, 0); |
731 |
55 |
pnl_fileOptions.add(new JLabel( |
732 |
|
MessageManager.getString("label.structure_import_options")), |
733 |
|
gbc); |
734 |
55 |
gbc.gridy++; |
735 |
|
|
736 |
55 |
gbc.insets = new Insets(0, 0, 6, 0); |
737 |
55 |
pnl_fileOptions.add(lbl_chooseTempFacType, gbc); |
738 |
55 |
gbc.gridy++; |
739 |
55 |
gbc.insets = new Insets(0, 0, 18, 0); |
740 |
55 |
pnl_fileOptions.add(combo_tempFacAs, gbc); |
741 |
55 |
gbc.gridy++; |
742 |
55 |
gbc.insets = new Insets(0, 0, 6, 0); |
743 |
55 |
pnl_fileOptions.add(btn_paeMatrixFile, gbc); |
744 |
55 |
gbc.gridy++; |
745 |
55 |
gbc.insets = new Insets(0, 0, 2, 0); |
746 |
55 |
gbc.weighty = 1.0; |
747 |
55 |
pnl_fileOptions.add(lbl_paeFile, gbc); |
748 |
|
|
749 |
55 |
JPanel pnl_fileChooserBL = new JPanel(new BorderLayout()); |
750 |
55 |
pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.PAGE_START); |
751 |
55 |
pnl_fileChooserBL.add(pnl_fileOptions, BorderLayout.CENTER); |
752 |
|
|
753 |
55 |
JPanel pnl_idInput = new JPanel(new FlowLayout()); |
754 |
55 |
pnl_idInput.add(txt_search); |
755 |
55 |
pnl_idInput.add(lbl_pdbManualFetchStatus); |
756 |
|
|
757 |
55 |
JPanel pnl_idInputBL = new JPanel(new BorderLayout()); |
758 |
55 |
pnl_idInputBL.add(idInputAssSeqPanel, BorderLayout.NORTH); |
759 |
55 |
pnl_idInputBL.add(pnl_idInput, BorderLayout.CENTER); |
760 |
|
|
761 |
55 |
final String foundStructureSummary = MessageManager |
762 |
|
.getString("label.found_structures_summary"); |
763 |
55 |
final String configureCols = MessageManager |
764 |
|
.getString("label.configure_displayed_columns"); |
765 |
55 |
ChangeListener changeListener = new ChangeListener() |
766 |
|
{ |
|
|
| 56.5% |
Uncovered Elements: 10 (23) |
Complexity: 4 |
Complexity Density: 0.24 |
|
767 |
55 |
@Override... |
768 |
|
public void stateChanged(ChangeEvent changeEvent) |
769 |
|
{ |
770 |
55 |
JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent |
771 |
|
.getSource(); |
772 |
55 |
int index = sourceTabbedPane.getSelectedIndex(); |
773 |
55 |
btn_add.setVisible(targetView.isVisible()); |
774 |
55 |
btn_newView.setVisible(true); |
775 |
55 |
btn_cancel.setVisible(true); |
776 |
55 |
if (sourceTabbedPane.getTitleAt(index).equals(configureCols)) |
777 |
|
{ |
778 |
0 |
btn_add.setEnabled(false); |
779 |
0 |
btn_cancel.setEnabled(false); |
780 |
0 |
btn_add.setVisible(false); |
781 |
0 |
btn_newView.setEnabled(false); |
782 |
0 |
btn_cancel.setVisible(false); |
783 |
0 |
previousWantedFields = getFTSDocFieldPrefs() |
784 |
|
.getStructureSummaryFields() |
785 |
|
.toArray(new FTSDataColumnI[0]); |
786 |
|
} |
787 |
55 |
if (sourceTabbedPane.getTitleAt(index) |
788 |
|
.equals(foundStructureSummary)) |
789 |
|
{ |
790 |
55 |
btn_cancel.setEnabled(true); |
791 |
55 |
if (wantedFieldsUpdated()) |
792 |
|
{ |
793 |
55 |
tabRefresh(); |
794 |
|
} |
795 |
|
else |
796 |
|
{ |
797 |
0 |
validateSelections(); |
798 |
|
} |
799 |
|
} |
800 |
|
} |
801 |
|
}; |
802 |
55 |
pnl_filter.addChangeListener(changeListener); |
803 |
55 |
pnl_filter.setPreferredSize(new Dimension(width, height)); |
804 |
55 |
pnl_filter.add(foundStructureSummary, scrl_foundStructures); |
805 |
55 |
pnl_filter.add(configureCols, getFTSDocFieldPrefs()); |
806 |
|
|
807 |
55 |
JPanel pnl_locPDB = new JPanel(new BorderLayout()); |
808 |
55 |
pnl_locPDB.add(scrl_localPDB); |
809 |
|
|
810 |
55 |
pnl_switchableViews.add(pnl_fileChooserBL, VIEWS_FROM_FILE); |
811 |
55 |
pnl_switchableViews.add(pnl_idInputBL, VIEWS_ENTER_ID); |
812 |
55 |
pnl_switchableViews.add(pnl_filter, VIEWS_FILTER); |
813 |
55 |
pnl_switchableViews.add(pnl_locPDB, VIEWS_LOCAL_PDB); |
814 |
|
|
815 |
55 |
this.setLayout(new BorderLayout()); |
816 |
55 |
this.add(pnl_main, java.awt.BorderLayout.NORTH); |
817 |
55 |
this.add(pnl_switchableViews, java.awt.BorderLayout.CENTER); |
818 |
|
|
819 |
55 |
statusPanel.setLayout(new GridLayout()); |
820 |
|
|
821 |
55 |
JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout()); |
822 |
55 |
pnl_actionsAndStatus.add(actionsPanel, BorderLayout.CENTER); |
823 |
55 |
pnl_actionsAndStatus.add(statusPanel, BorderLayout.SOUTH); |
824 |
55 |
statusPanel.add(statusBar, null); |
825 |
55 |
this.add(pnl_actionsAndStatus, java.awt.BorderLayout.SOUTH); |
826 |
|
|
827 |
55 |
mainFrame.addInternalFrameListener( |
828 |
|
new javax.swing.event.InternalFrameAdapter() |
829 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
830 |
0 |
@Override... |
831 |
|
public void internalFrameClosing(InternalFrameEvent e) |
832 |
|
{ |
833 |
0 |
closeAction(pnl_filter.getHeight()); |
834 |
|
} |
835 |
|
}); |
836 |
55 |
mainFrame.setVisible(true); |
837 |
55 |
mainFrame.setContentPane(this); |
838 |
55 |
mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); |
839 |
55 |
Integer x = tempUserPrefs.get("structureChooser.x"); |
840 |
55 |
Integer y = tempUserPrefs.get("structureChooser.y"); |
841 |
55 |
if (x != null && y != null) |
842 |
|
{ |
843 |
0 |
mainFrame.setLocation(x, y); |
844 |
|
} |
845 |
55 |
Desktop.addInternalFrame(mainFrame, frameTitle, width, height); |
846 |
|
} |
847 |
|
|
848 |
|
protected abstract boolean showPopupFor(int selectedRow, int x, int y); |
849 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
850 |
0 |
protected void closeAction(int preferredHeight)... |
851 |
|
{ |
852 |
|
|
853 |
|
|
854 |
|
|
855 |
|
|
856 |
|
|
857 |
0 |
tempUserPrefs.put("structureChooser.width", pnl_filter.getWidth()); |
858 |
0 |
tempUserPrefs.put("structureChooser.height", preferredHeight); |
859 |
0 |
tempUserPrefs.put("structureChooser.x", mainFrame.getX()); |
860 |
0 |
tempUserPrefs.put("structureChooser.y", mainFrame.getY()); |
861 |
0 |
mainFrame.dispose(); |
862 |
|
} |
863 |
|
|
|
|
| 37.5% |
Uncovered Elements: 5 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
864 |
55 |
public boolean wantedFieldsUpdated()... |
865 |
|
{ |
866 |
55 |
if (previousWantedFields == null) |
867 |
|
{ |
868 |
55 |
return true; |
869 |
|
} |
870 |
|
|
871 |
0 |
FTSDataColumnI[] currentWantedFields = getFTSDocFieldPrefs() |
872 |
|
.getStructureSummaryFields().toArray(new FTSDataColumnI[0]); |
873 |
0 |
return Arrays.equals(currentWantedFields, previousWantedFields) ? false |
874 |
|
: true; |
875 |
|
|
876 |
|
} |
877 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
878 |
0 |
@Override... |
879 |
|
|
880 |
|
|
881 |
|
|
882 |
|
public void itemStateChanged(ItemEvent e) |
883 |
|
{ |
884 |
0 |
stateChanged(e); |
885 |
|
} |
886 |
|
|
887 |
|
|
888 |
|
|
889 |
|
|
890 |
|
|
891 |
|
@author |
892 |
|
|
893 |
|
|
|
|
| 27.8% |
Uncovered Elements: 13 (18) |
Complexity: 8 |
Complexity Density: 0.89 |
|
894 |
|
public class AssociateSeqOptions |
895 |
|
{ |
896 |
|
private SequenceI sequence; |
897 |
|
|
898 |
|
private String name; |
899 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
900 |
0 |
public AssociateSeqOptions(SequenceI seq)... |
901 |
|
{ |
902 |
0 |
this.sequence = seq; |
903 |
0 |
this.name = (seq.getName().length() >= 23) |
904 |
|
? seq.getName().substring(0, 23) |
905 |
|
: seq.getName(); |
906 |
|
} |
907 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
908 |
2 |
public AssociateSeqOptions(String name, SequenceI seq)... |
909 |
|
{ |
910 |
2 |
this.name = name; |
911 |
2 |
this.sequence = seq; |
912 |
|
} |
913 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
914 |
2 |
@Override... |
915 |
|
public String toString() |
916 |
|
{ |
917 |
2 |
return name; |
918 |
|
} |
919 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
920 |
0 |
public String getName()... |
921 |
|
{ |
922 |
0 |
return name; |
923 |
|
} |
924 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
925 |
0 |
public void setName(String name)... |
926 |
|
{ |
927 |
0 |
this.name = name; |
928 |
|
} |
929 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
930 |
0 |
public SequenceI getSequence()... |
931 |
|
{ |
932 |
0 |
return sequence; |
933 |
|
} |
934 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
935 |
0 |
public void setSequence(SequenceI sequence)... |
936 |
|
{ |
937 |
0 |
this.sequence = sequence; |
938 |
|
} |
939 |
|
|
940 |
|
} |
941 |
|
|
942 |
|
|
943 |
|
|
944 |
|
|
945 |
|
|
946 |
|
|
947 |
|
@author |
948 |
|
|
949 |
|
|
|
|
| 82.4% |
Uncovered Elements: 3 (17) |
Complexity: 6 |
Complexity Density: 0.6 |
|
950 |
|
public class AssociateSeqPanel extends JPanel implements ItemListener |
951 |
|
{ |
952 |
|
private JComboBox<AssociateSeqOptions> cmb_assSeq = new JComboBox<>(); |
953 |
|
|
954 |
|
private JLabel lbl_associateSeq = new JLabel(); |
955 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
956 |
110 |
public AssociateSeqPanel()... |
957 |
|
{ |
958 |
110 |
this.setLayout(new FlowLayout()); |
959 |
110 |
this.add(cmb_assSeq); |
960 |
110 |
this.add(lbl_associateSeq); |
961 |
110 |
cmb_assSeq.setToolTipText( |
962 |
|
MessageManager.getString("info.associate_wit_sequence")); |
963 |
110 |
cmb_assSeq.addItemListener(this); |
964 |
|
} |
965 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
966 |
2 |
public void loadCmbAssSeq()... |
967 |
|
{ |
968 |
2 |
populateCmbAssociateSeqOptions(cmb_assSeq, lbl_associateSeq); |
969 |
|
} |
970 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
971 |
3 |
public JComboBox<AssociateSeqOptions> getCmb_assSeq()... |
972 |
|
{ |
973 |
3 |
return cmb_assSeq; |
974 |
|
} |
975 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
976 |
0 |
public void setCmb_assSeq(JComboBox<AssociateSeqOptions> cmb_assSeq)... |
977 |
|
{ |
978 |
0 |
this.cmb_assSeq = cmb_assSeq; |
979 |
|
} |
980 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
981 |
2 |
@Override... |
982 |
|
public void itemStateChanged(ItemEvent e) |
983 |
|
{ |
984 |
2 |
if (e.getStateChange() == ItemEvent.SELECTED) |
985 |
|
{ |
986 |
2 |
cmbAssSeqStateChanged(); |
987 |
|
} |
988 |
|
} |
989 |
|
} |
990 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
991 |
10 |
public JTable getResultTable()... |
992 |
|
{ |
993 |
10 |
return tbl_summary; |
994 |
|
} |
995 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
996 |
6 |
public JComboBox<FilterOption> getCmbFilterOption()... |
997 |
|
{ |
998 |
6 |
return cmb_filterOption; |
999 |
|
} |
1000 |
|
|
1001 |
|
|
1002 |
|
|
1003 |
|
|
1004 |
|
|
1005 |
|
@author |
1006 |
|
|
1007 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
1008 |
|
public abstract class CustomComboSeparatorsRenderer |
1009 |
|
implements ListCellRenderer<Object> |
1010 |
|
{ |
1011 |
|
private ListCellRenderer<Object> regent; |
1012 |
|
|
1013 |
|
private JPanel separatorPanel = new JPanel(new BorderLayout()); |
1014 |
|
|
1015 |
|
private JSeparator jSeparator = new JSeparator(); |
1016 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1017 |
55 |
public CustomComboSeparatorsRenderer(... |
1018 |
|
ListCellRenderer<Object> listCellRenderer) |
1019 |
|
{ |
1020 |
55 |
this.regent = listCellRenderer; |
1021 |
|
} |
1022 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
1023 |
52 |
@Override... |
1024 |
|
public Component getListCellRendererComponent(JList list, Object value, |
1025 |
|
int index, boolean isSelected, boolean cellHasFocus) |
1026 |
|
{ |
1027 |
|
|
1028 |
52 |
Component comp = regent.getListCellRendererComponent(list, value, |
1029 |
|
index, isSelected, cellHasFocus); |
1030 |
52 |
if (index != -1 |
1031 |
|
&& addSeparatorAfter(list, (FilterOption) value, index)) |
1032 |
|
{ |
1033 |
1 |
separatorPanel.removeAll(); |
1034 |
1 |
separatorPanel.add(comp, BorderLayout.CENTER); |
1035 |
1 |
separatorPanel.add(jSeparator, BorderLayout.SOUTH); |
1036 |
1 |
return separatorPanel; |
1037 |
|
} |
1038 |
|
else |
1039 |
|
{ |
1040 |
51 |
return comp; |
1041 |
|
} |
1042 |
|
} |
1043 |
|
|
1044 |
|
protected abstract boolean addSeparatorAfter(JList list, |
1045 |
|
FilterOption value, int index); |
1046 |
|
} |
1047 |
|
|
1048 |
|
protected abstract void stateChanged(ItemEvent e); |
1049 |
|
|
1050 |
|
protected abstract void add_ActionPerformed(); |
1051 |
|
|
1052 |
|
protected abstract void newView_ActionPerformed(); |
1053 |
|
|
1054 |
|
protected abstract void pdbFromFile_actionPerformed(); |
1055 |
|
|
1056 |
|
protected abstract void paeMatrixFile_actionPerformed(); |
1057 |
|
|
1058 |
|
protected abstract void txt_search_ActionPerformed(); |
1059 |
|
|
1060 |
|
protected abstract void populateCmbAssociateSeqOptions( |
1061 |
|
JComboBox<AssociateSeqOptions> cmb_assSeq, |
1062 |
|
JLabel lbl_associateSeq); |
1063 |
|
|
1064 |
|
protected abstract void cmbAssSeqStateChanged(); |
1065 |
|
|
1066 |
|
protected abstract void tabRefresh(); |
1067 |
|
|
1068 |
|
protected abstract void validateSelections(); |
1069 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1070 |
0 |
public JInternalFrame getFrame()... |
1071 |
|
{ |
1072 |
0 |
return mainFrame; |
1073 |
|
} |
1074 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
1075 |
0 |
public void setPdbOptionsEnabled(boolean b)... |
1076 |
|
{ |
1077 |
0 |
lbl_chooseTempFacType.setEnabled(b); |
1078 |
0 |
combo_tempFacAs.setEnabled(b); |
1079 |
0 |
btn_paeMatrixFile.setEnabled(b); |
1080 |
0 |
lbl_paeFile.setEnabled(b); |
1081 |
|
} |
1082 |
|
} |