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.Color; |
25 |
|
import java.awt.Component; |
26 |
|
import java.awt.Dimension; |
27 |
|
import java.awt.Font; |
28 |
|
import java.awt.event.ActionEvent; |
29 |
|
import java.awt.event.ActionListener; |
30 |
|
import java.awt.event.MouseEvent; |
31 |
|
import java.io.File; |
32 |
|
import java.util.ArrayList; |
33 |
|
import java.util.List; |
34 |
|
|
35 |
|
import javax.help.HelpSetException; |
36 |
|
import javax.swing.JComboBox; |
37 |
|
import javax.swing.JFileChooser; |
38 |
|
import javax.swing.JInternalFrame; |
39 |
|
import javax.swing.JPanel; |
40 |
|
import javax.swing.ListSelectionModel; |
41 |
|
import javax.swing.RowFilter; |
42 |
|
import javax.swing.RowSorter; |
43 |
|
import javax.swing.SortOrder; |
44 |
|
import javax.swing.event.DocumentEvent; |
45 |
|
import javax.swing.event.DocumentListener; |
46 |
|
import javax.swing.event.ListSelectionEvent; |
47 |
|
import javax.swing.event.ListSelectionListener; |
48 |
|
import javax.swing.table.TableCellRenderer; |
49 |
|
import javax.swing.table.TableColumn; |
50 |
|
import javax.swing.table.TableModel; |
51 |
|
import javax.swing.table.TableRowSorter; |
52 |
|
|
53 |
|
import ext.edu.ucsf.rbvi.strucviz2.StructureManager; |
54 |
|
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; |
55 |
|
import jalview.bin.Cache; |
56 |
|
import jalview.ext.pymol.PymolManager; |
57 |
|
import jalview.gui.Help.HelpId; |
58 |
|
import jalview.gui.StructureViewer.ViewerType; |
59 |
|
import jalview.io.BackupFiles; |
60 |
|
import jalview.io.BackupFilesPresetEntry; |
61 |
|
import jalview.io.FileFormatI; |
62 |
|
import jalview.io.JalviewFileChooser; |
63 |
|
import jalview.io.JalviewFileView; |
64 |
|
import jalview.jbgui.GPreferences; |
65 |
|
import jalview.jbgui.GSequenceLink; |
66 |
|
import jalview.schemes.ColourSchemeI; |
67 |
|
import jalview.schemes.ColourSchemes; |
68 |
|
import jalview.schemes.ResidueColourScheme; |
69 |
|
import jalview.urls.UrlLinkTableModel; |
70 |
|
import jalview.urls.api.UrlProviderFactoryI; |
71 |
|
import jalview.urls.api.UrlProviderI; |
72 |
|
import jalview.urls.desktop.DesktopUrlProviderFactory; |
73 |
|
import jalview.util.MessageManager; |
74 |
|
import jalview.util.Platform; |
75 |
|
import jalview.util.UrlConstants; |
76 |
|
import jalview.ws.sifts.SiftsSettings; |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
@author |
82 |
|
@version |
83 |
|
|
|
|
| 2% |
Uncovered Elements: 598 (610) |
Complexity: 104 |
Complexity Density: 0.22 |
|
84 |
|
public class Preferences extends GPreferences |
85 |
|
{ |
86 |
|
public static final String ENABLE_SPLIT_FRAME = "ENABLE_SPLIT_FRAME"; |
87 |
|
|
88 |
|
public static final String SCALE_PROTEIN_TO_CDNA = "SCALE_PROTEIN_TO_CDNA"; |
89 |
|
|
90 |
|
public static final String DEFAULT_COLOUR = "DEFAULT_COLOUR"; |
91 |
|
|
92 |
|
public static final String DEFAULT_COLOUR_PROT = "DEFAULT_COLOUR_PROT"; |
93 |
|
|
94 |
|
public static final String DEFAULT_COLOUR_NUC = "DEFAULT_COLOUR_NUC"; |
95 |
|
|
96 |
|
public static final String ADD_TEMPFACT_ANN = "ADD_TEMPFACT_ANN"; |
97 |
|
|
98 |
|
public static final String ADD_SS_ANN = "ADD_SS_ANN"; |
99 |
|
|
100 |
|
public static final String USE_RNAVIEW = "USE_RNAVIEW"; |
101 |
|
|
102 |
|
public static final String STRUCT_FROM_PDB = "STRUCT_FROM_PDB"; |
103 |
|
|
104 |
|
public static final String STRUCTURE_DISPLAY = "STRUCTURE_DISPLAY"; |
105 |
|
|
106 |
|
public static final String CHIMERA_PATH = "CHIMERA_PATH"; |
107 |
|
|
108 |
|
public static final String CHIMERAX_PATH = "CHIMERAX_PATH"; |
109 |
|
|
110 |
|
public static final String PYMOL_PATH = "PYMOL_PATH"; |
111 |
|
|
112 |
|
public static final String SORT_ANNOTATIONS = "SORT_ANNOTATIONS"; |
113 |
|
|
114 |
|
public static final String SHOW_AUTOCALC_ABOVE = "SHOW_AUTOCALC_ABOVE"; |
115 |
|
|
116 |
|
public static final String SHOW_OCCUPANCY = "SHOW_OCCUPANCY"; |
117 |
|
|
118 |
|
public static final String SHOW_OV_HIDDEN_AT_START = "SHOW_OV_HIDDEN_AT_START"; |
119 |
|
|
120 |
|
public static final String USE_LEGACY_GAP = "USE_LEGACY_GAP"; |
121 |
|
|
122 |
|
public static final String GAP_COLOUR = "GAP_COLOUR"; |
123 |
|
|
124 |
|
public static final String HIDDEN_COLOUR = "HIDDEN_COLOUR"; |
125 |
|
|
126 |
|
private static final int MIN_FONT_SIZE = 1; |
127 |
|
|
128 |
|
private static final int MAX_FONT_SIZE = 30; |
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
public static UrlProviderI sequenceUrlLinks; |
135 |
|
|
136 |
|
public static UrlLinkTableModel dataModel; |
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
public static List<String> groupURLLinks; |
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 3 |
Complexity Density: 0.33 |
|
147 |
2 |
static... |
148 |
|
{ |
149 |
|
|
150 |
|
|
151 |
2 |
String inMenuString = Cache.getDefault("SEQUENCE_LINKS", ""); |
152 |
2 |
String notInMenuString = Cache.getDefault("STORED_LINKS", ""); |
153 |
2 |
String defaultUrl = Cache.getDefault("DEFAULT_URL", |
154 |
|
UrlConstants.DEFAULT_LABEL); |
155 |
|
|
156 |
|
|
157 |
|
|
158 |
2 |
if (inMenuString.isEmpty() && notInMenuString.isEmpty()) |
159 |
|
{ |
160 |
1 |
inMenuString = UrlConstants.DEFAULT_STRING; |
161 |
|
} |
162 |
2 |
UrlProviderFactoryI factory = new DesktopUrlProviderFactory(defaultUrl, |
163 |
|
inMenuString, notInMenuString); |
164 |
2 |
sequenceUrlLinks = factory.createUrlProvider(); |
165 |
2 |
dataModel = new UrlLinkTableModel(sequenceUrlLinks); |
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
|
171 |
|
|
172 |
2 |
groupURLLinks = new ArrayList<>(); |
173 |
|
} |
174 |
|
|
175 |
|
JInternalFrame frame; |
176 |
|
|
177 |
|
private WsPreferences wsPrefs; |
178 |
|
|
179 |
|
private OptionsParam promptEachTimeOpt = new OptionsParam( |
180 |
|
MessageManager.getString("label.prompt_each_time"), |
181 |
|
"Prompt each time"); |
182 |
|
|
183 |
|
private OptionsParam lineArtOpt = new OptionsParam( |
184 |
|
MessageManager.getString("label.lineart"), "Lineart"); |
185 |
|
|
186 |
|
private OptionsParam textOpt = new OptionsParam( |
187 |
|
MessageManager.getString("action.text"), "Text"); |
188 |
|
|
189 |
|
|
190 |
|
|
191 |
|
|
|
|
| 0% |
Uncovered Elements: 199 (199) |
Complexity: 17 |
Complexity Density: 0.1 |
|
192 |
0 |
public Preferences()... |
193 |
|
{ |
194 |
0 |
super(); |
195 |
0 |
frame = new JInternalFrame(); |
196 |
0 |
frame.setContentPane(this); |
197 |
0 |
if (!Platform.isJS()) |
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
|
{ |
204 |
0 |
wsPrefs = new WsPreferences(); |
205 |
0 |
wsTab.add(wsPrefs, BorderLayout.CENTER); |
206 |
|
} |
207 |
0 |
int width = 500, height = 450; |
208 |
0 |
if (Platform.isAMacAndNotJS()) |
209 |
|
{ |
210 |
0 |
width = 570; |
211 |
0 |
height = 480; |
212 |
|
} |
213 |
|
|
214 |
0 |
Desktop.addInternalFrame(frame, |
215 |
|
MessageManager.getString("label.preferences"), width, height); |
216 |
0 |
frame.setMinimumSize(new Dimension(width, height)); |
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
|
221 |
0 |
seqLimit.setSelected(Cache.getDefault("SHOW_JVSUFFIX", true)); |
222 |
0 |
rightAlign.setSelected(Cache.getDefault("RIGHT_ALIGN_IDS", false)); |
223 |
0 |
fullScreen.setSelected(Cache.getDefault("SHOW_FULLSCREEN", false)); |
224 |
0 |
annotations.setSelected(Cache.getDefault("SHOW_ANNOTATIONS", true)); |
225 |
|
|
226 |
0 |
conservation.setSelected(Cache.getDefault("SHOW_CONSERVATION", true)); |
227 |
0 |
quality.setSelected(Cache.getDefault("SHOW_QUALITY", true)); |
228 |
0 |
identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true)); |
229 |
0 |
openoverv.setSelected(Cache.getDefault("SHOW_OVERVIEW", false)); |
230 |
0 |
showUnconserved |
231 |
|
.setSelected(Cache.getDefault("SHOW_UNCONSERVED", false)); |
232 |
0 |
showOccupancy.setSelected(Cache.getDefault(SHOW_OCCUPANCY, false)); |
233 |
0 |
showGroupConsensus |
234 |
|
.setSelected(Cache.getDefault("SHOW_GROUP_CONSENSUS", false)); |
235 |
0 |
showGroupConservation.setSelected( |
236 |
|
Cache.getDefault("SHOW_GROUP_CONSERVATION", false)); |
237 |
0 |
showConsensHistogram.setSelected( |
238 |
|
Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM", true)); |
239 |
0 |
showConsensLogo |
240 |
|
.setSelected(Cache.getDefault("SHOW_CONSENSUS_LOGO", false)); |
241 |
0 |
showNpTooltip |
242 |
|
.setSelected(Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true)); |
243 |
0 |
showDbRefTooltip |
244 |
|
.setSelected(Cache.getDefault("SHOW_DBREFS_TOOLTIP", true)); |
245 |
|
|
246 |
0 |
String[] fonts = java.awt.GraphicsEnvironment |
247 |
|
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); |
248 |
0 |
for (int i = 0; i < fonts.length; i++) |
249 |
|
{ |
250 |
0 |
fontNameCB.addItem(fonts[i]); |
251 |
|
} |
252 |
|
|
253 |
0 |
for (int i = MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) |
254 |
|
{ |
255 |
0 |
fontSizeCB.addItem(i + ""); |
256 |
|
} |
257 |
|
|
258 |
0 |
fontStyleCB.addItem("plain"); |
259 |
0 |
fontStyleCB.addItem("bold"); |
260 |
0 |
fontStyleCB.addItem("italic"); |
261 |
|
|
262 |
0 |
fontNameCB.setSelectedItem(Cache.getDefault("FONT_NAME", "SansSerif")); |
263 |
0 |
fontSizeCB.setSelectedItem(Cache.getDefault("FONT_SIZE", "10")); |
264 |
0 |
fontStyleCB.setSelectedItem( |
265 |
|
Cache.getDefault("FONT_STYLE", Font.PLAIN + "")); |
266 |
|
|
267 |
0 |
smoothFont.setSelected(Cache.getDefault("ANTI_ALIAS", true)); |
268 |
0 |
scaleProteinToCdna |
269 |
|
.setSelected(Cache.getDefault(SCALE_PROTEIN_TO_CDNA, false)); |
270 |
|
|
271 |
0 |
idItalics.setSelected(Cache.getDefault("ID_ITALICS", true)); |
272 |
|
|
273 |
0 |
wrap.setSelected(Cache.getDefault("WRAP_ALIGNMENT", false)); |
274 |
|
|
275 |
0 |
gapSymbolCB.addItem("-"); |
276 |
0 |
gapSymbolCB.addItem("."); |
277 |
|
|
278 |
0 |
gapSymbolCB.setSelectedItem(Cache.getDefault("GAP_SYMBOL", "-")); |
279 |
|
|
280 |
0 |
sortby.addItem("No sort"); |
281 |
0 |
sortby.addItem("Id"); |
282 |
0 |
sortby.addItem("Pairwise Identity"); |
283 |
0 |
sortby.setSelectedItem(Cache.getDefault("SORT_ALIGNMENT", "No sort")); |
284 |
|
|
285 |
0 |
sortAnnBy.addItem(SequenceAnnotationOrder.NONE.toString()); |
286 |
0 |
sortAnnBy |
287 |
|
.addItem(SequenceAnnotationOrder.SEQUENCE_AND_LABEL.toString()); |
288 |
0 |
sortAnnBy |
289 |
|
.addItem(SequenceAnnotationOrder.LABEL_AND_SEQUENCE.toString()); |
290 |
0 |
SequenceAnnotationOrder savedSort = SequenceAnnotationOrder |
291 |
|
.valueOf(Cache.getDefault(SORT_ANNOTATIONS, |
292 |
|
SequenceAnnotationOrder.NONE.name())); |
293 |
0 |
sortAnnBy.setSelectedItem(savedSort.toString()); |
294 |
|
|
295 |
0 |
sortAutocalc.addItem("Autocalculated first"); |
296 |
0 |
sortAutocalc.addItem("Autocalculated last"); |
297 |
0 |
final boolean showAbove = Cache.getDefault(SHOW_AUTOCALC_ABOVE, true); |
298 |
0 |
sortAutocalc.setSelectedItem(showAbove ? sortAutocalc.getItemAt(0) |
299 |
|
: sortAutocalc.getItemAt(1)); |
300 |
0 |
startupCheckbox |
301 |
|
.setSelected(Cache.getDefault("SHOW_STARTUP_FILE", true)); |
302 |
0 |
startupFileTextfield.setText(Cache.getDefault("STARTUP_FILE", |
303 |
|
Cache.getDefault("www.jalview.org", "http://www.jalview.org") |
304 |
|
+ "/examples/exampleFile_2_3.jar")); |
305 |
|
|
306 |
|
|
307 |
|
|
308 |
|
|
309 |
0 |
protColour.addItem(ResidueColourScheme.NONE); |
310 |
0 |
nucColour.addItem(ResidueColourScheme.NONE); |
311 |
0 |
for (ColourSchemeI cs : ColourSchemes.getInstance().getColourSchemes()) |
312 |
|
{ |
313 |
0 |
String name = cs.getSchemeName(); |
314 |
0 |
protColour.addItem(name); |
315 |
0 |
nucColour.addItem(name); |
316 |
|
} |
317 |
0 |
String oldProp = Cache.getDefault(DEFAULT_COLOUR, |
318 |
|
ResidueColourScheme.NONE); |
319 |
0 |
String newProp = Cache.getDefault(DEFAULT_COLOUR_PROT, null); |
320 |
0 |
protColour.setSelectedItem(newProp != null ? newProp : oldProp); |
321 |
0 |
newProp = Cache.getDefault(DEFAULT_COLOUR_NUC, null); |
322 |
0 |
nucColour.setSelectedItem(newProp != null ? newProp : oldProp); |
323 |
0 |
minColour.setBackground( |
324 |
|
Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN", Color.orange)); |
325 |
0 |
maxColour.setBackground( |
326 |
|
Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX", Color.red)); |
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
0 |
gapColour.setBackground( |
332 |
|
Cache.getDefaultColour(GAP_COLOUR, |
333 |
|
jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_GAP)); |
334 |
0 |
hiddenColour.setBackground( |
335 |
|
Cache.getDefaultColour(HIDDEN_COLOUR, |
336 |
|
jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_HIDDEN)); |
337 |
0 |
useLegacyGap.setSelected(Cache.getDefault(USE_LEGACY_GAP, false)); |
338 |
0 |
gapLabel.setEnabled(!useLegacyGap.isSelected()); |
339 |
0 |
gapColour.setEnabled(!useLegacyGap.isSelected()); |
340 |
0 |
showHiddenAtStart |
341 |
|
.setSelected(Cache.getDefault(SHOW_OV_HIDDEN_AT_START, false)); |
342 |
|
|
343 |
|
|
344 |
|
|
345 |
|
|
346 |
0 |
final boolean structSelected = Cache.getDefault(STRUCT_FROM_PDB, false); |
347 |
0 |
structFromPdb.setSelected(structSelected); |
348 |
0 |
useRnaView.setSelected(Cache.getDefault(USE_RNAVIEW, false)); |
349 |
0 |
useRnaView.setEnabled(structSelected); |
350 |
0 |
addSecondaryStructure.setSelected(Cache.getDefault(ADD_SS_ANN, false)); |
351 |
0 |
addSecondaryStructure.setEnabled(structSelected); |
352 |
0 |
addTempFactor.setSelected(Cache.getDefault(ADD_TEMPFACT_ANN, false)); |
353 |
0 |
addTempFactor.setEnabled(structSelected); |
354 |
|
|
355 |
|
|
356 |
|
|
357 |
|
|
358 |
|
|
359 |
0 |
String viewerType = Cache.getDefault(STRUCTURE_DISPLAY, ViewerType.JMOL.name()); |
360 |
0 |
structViewer.setSelectedItem(viewerType); |
361 |
0 |
String viewerPath = ""; |
362 |
0 |
ViewerType type = null; |
363 |
0 |
try |
364 |
|
{ |
365 |
0 |
type = ViewerType.valueOf(viewerType); |
366 |
0 |
switch (type) |
367 |
|
{ |
368 |
0 |
case JMOL: |
369 |
0 |
break; |
370 |
0 |
case CHIMERA: |
371 |
0 |
viewerPath = Cache.getDefault(CHIMERA_PATH, ""); |
372 |
0 |
break; |
373 |
0 |
case CHIMERAX: |
374 |
0 |
viewerPath = Cache.getDefault(CHIMERAX_PATH, ""); |
375 |
0 |
break; |
376 |
0 |
case PYMOL: |
377 |
0 |
viewerPath = Cache.getDefault(PYMOL_PATH, ""); |
378 |
0 |
break; |
379 |
|
} |
380 |
|
} catch (IllegalArgumentException e) |
381 |
|
{ |
382 |
0 |
Cache.log.error("Unknown structure viewer type: " + viewerType |
383 |
|
+ ", defaulting to Jmol"); |
384 |
0 |
type = ViewerType.JMOL; |
385 |
|
} |
386 |
0 |
structureViewerPath.setText(viewerPath); |
387 |
|
|
388 |
0 |
structureViewerPath.addActionListener(new ActionListener() |
389 |
|
{ |
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 1.5 |
|
390 |
0 |
@Override... |
391 |
|
public void actionPerformed(ActionEvent e) |
392 |
|
{ |
393 |
0 |
if (validateViewerPath()) |
394 |
|
{ |
395 |
0 |
Cache.setProperty(structViewer.getSelectedItem() |
396 |
|
.equals(ViewerType.CHIMERAX.name()) |
397 |
|
? CHIMERAX_PATH |
398 |
|
: CHIMERA_PATH, structureViewerPath.getText()); |
399 |
|
} |
400 |
|
} |
401 |
|
}); |
402 |
|
|
403 |
0 |
if (Cache.getDefault("MAP_WITH_SIFTS", false)) |
404 |
|
{ |
405 |
0 |
siftsMapping.setSelected(true); |
406 |
|
} |
407 |
|
else |
408 |
|
{ |
409 |
0 |
nwMapping.setSelected(true); |
410 |
|
} |
411 |
|
|
412 |
0 |
SiftsSettings |
413 |
|
.setMapWithSifts(Cache.getDefault("MAP_WITH_SIFTS", false)); |
414 |
|
|
415 |
|
|
416 |
|
|
417 |
|
|
418 |
|
|
419 |
|
|
420 |
0 |
linkUrlTable.setModel(dataModel); |
421 |
0 |
final TableRowSorter<TableModel> sorter = new TableRowSorter<>( |
422 |
|
linkUrlTable.getModel()); |
423 |
0 |
linkUrlTable.setRowSorter(sorter); |
424 |
0 |
List<RowSorter.SortKey> sortKeys = new ArrayList<>(); |
425 |
|
|
426 |
0 |
UrlLinkTableModel m = (UrlLinkTableModel) linkUrlTable.getModel(); |
427 |
0 |
sortKeys.add(new RowSorter.SortKey(m.getPrimaryColumn(), |
428 |
|
SortOrder.DESCENDING)); |
429 |
0 |
sortKeys.add(new RowSorter.SortKey(m.getSelectedColumn(), |
430 |
|
SortOrder.DESCENDING)); |
431 |
0 |
sortKeys.add( |
432 |
|
new RowSorter.SortKey(m.getNameColumn(), SortOrder.ASCENDING)); |
433 |
|
|
434 |
0 |
sorter.setSortKeys(sortKeys); |
435 |
|
|
436 |
|
|
437 |
|
|
438 |
|
|
439 |
0 |
ActionListener onReset; |
440 |
0 |
onReset = new ActionListener() |
441 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
442 |
0 |
@Override... |
443 |
|
public void actionPerformed(ActionEvent e) |
444 |
|
{ |
445 |
0 |
filterTB.setText(""); |
446 |
0 |
sorter.setRowFilter(RowFilter.regexFilter("")); |
447 |
|
} |
448 |
|
|
449 |
|
}; |
450 |
0 |
doReset.addActionListener(onReset); |
451 |
|
|
452 |
|
|
453 |
0 |
final RowFilter<TableModel, Object> customUrlFilter = new RowFilter<TableModel, Object>() |
454 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
455 |
0 |
@Override... |
456 |
|
public boolean include( |
457 |
|
Entry<? extends TableModel, ? extends Object> entry) |
458 |
|
{ |
459 |
0 |
return ((UrlLinkTableModel) entry.getModel()).isUserEntry(entry); |
460 |
|
} |
461 |
|
}; |
462 |
|
|
463 |
0 |
final TableRowSorter<TableModel> customSorter = new TableRowSorter<>( |
464 |
|
linkUrlTable.getModel()); |
465 |
0 |
customSorter.setRowFilter(customUrlFilter); |
466 |
|
|
467 |
0 |
ActionListener onCustomOnly; |
468 |
0 |
onCustomOnly = new ActionListener() |
469 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
470 |
0 |
@Override... |
471 |
|
public void actionPerformed(ActionEvent e) |
472 |
|
{ |
473 |
0 |
filterTB.setText(""); |
474 |
0 |
sorter.setRowFilter(customUrlFilter); |
475 |
|
} |
476 |
|
}; |
477 |
0 |
userOnly.addActionListener(onCustomOnly); |
478 |
|
|
479 |
0 |
filterTB.getDocument().addDocumentListener(new DocumentListener() |
480 |
|
{ |
481 |
|
String caseInsensitiveFlag = "(?i)"; |
482 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
483 |
0 |
@Override... |
484 |
|
public void changedUpdate(DocumentEvent e) |
485 |
|
{ |
486 |
0 |
sorter.setRowFilter(RowFilter |
487 |
|
.regexFilter(caseInsensitiveFlag + filterTB.getText())); |
488 |
|
} |
489 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
490 |
0 |
@Override... |
491 |
|
public void removeUpdate(DocumentEvent e) |
492 |
|
{ |
493 |
0 |
sorter.setRowFilter(RowFilter |
494 |
|
.regexFilter(caseInsensitiveFlag + filterTB.getText())); |
495 |
|
} |
496 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
497 |
0 |
@Override... |
498 |
|
public void insertUpdate(DocumentEvent e) |
499 |
|
{ |
500 |
0 |
sorter.setRowFilter(RowFilter |
501 |
|
.regexFilter(caseInsensitiveFlag + filterTB.getText())); |
502 |
|
} |
503 |
|
}); |
504 |
|
|
505 |
|
|
506 |
0 |
linkUrlTable.getSelectionModel() |
507 |
|
.addListSelectionListener(new UrlListSelectionHandler()); |
508 |
|
|
509 |
|
|
510 |
0 |
int onClickCol = ((UrlLinkTableModel) linkUrlTable.getModel()) |
511 |
|
.getPrimaryColumn(); |
512 |
0 |
String onClickName = linkUrlTable.getColumnName(onClickCol); |
513 |
0 |
linkUrlTable.getColumn(onClickName) |
514 |
|
.setCellRenderer(new RadioButtonRenderer()); |
515 |
0 |
linkUrlTable.getColumn(onClickName) |
516 |
|
.setCellEditor(new RadioButtonEditor()); |
517 |
|
|
518 |
|
|
519 |
0 |
for (int column = 0; column < linkUrlTable.getColumnCount(); column++) |
520 |
|
{ |
521 |
0 |
if (linkUrlTable.getModel().getColumnClass(column) |
522 |
|
.equals(Boolean.class)) |
523 |
|
{ |
524 |
0 |
TableColumn tableColumn = linkUrlTable.getColumnModel() |
525 |
|
.getColumn(column); |
526 |
0 |
int preferredWidth = tableColumn.getMinWidth(); |
527 |
|
|
528 |
0 |
TableCellRenderer cellRenderer = linkUrlTable.getCellRenderer(0, |
529 |
|
column); |
530 |
0 |
Component c = linkUrlTable.prepareRenderer(cellRenderer, 0, column); |
531 |
0 |
int cwidth = c.getPreferredSize().width |
532 |
|
+ linkUrlTable.getIntercellSpacing().width; |
533 |
0 |
preferredWidth = Math.max(preferredWidth, cwidth); |
534 |
|
|
535 |
0 |
tableColumn.setPreferredWidth(preferredWidth); |
536 |
|
} |
537 |
|
} |
538 |
|
|
539 |
0 |
useProxy.setSelected(Cache.getDefault("USE_PROXY", false)); |
540 |
0 |
useProxy_actionPerformed(); |
541 |
0 |
proxyServerTB.setText(Cache.getDefault("PROXY_SERVER", "")); |
542 |
0 |
proxyPortTB.setText(Cache.getDefault("PROXY_PORT", "")); |
543 |
|
|
544 |
0 |
defaultBrowser.setText(Cache.getDefault("DEFAULT_BROWSER", "")); |
545 |
|
|
546 |
0 |
usagestats.setSelected(Cache.getDefault("USAGESTATS", false)); |
547 |
|
|
548 |
0 |
questionnaire |
549 |
|
.setSelected(Cache.getProperty("NOQUESTIONNAIRES") == null); |
550 |
0 |
versioncheck.setSelected(Cache.getDefault("VERSION_CHECK", true)); |
551 |
|
|
552 |
|
|
553 |
|
|
554 |
|
|
555 |
0 |
setupOutputCombo(epsRendering, "EPS_RENDERING"); |
556 |
0 |
setupOutputCombo(htmlRendering, "HTML_RENDERING"); |
557 |
0 |
setupOutputCombo(svgRendering, "SVG_RENDERING"); |
558 |
0 |
autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false)); |
559 |
0 |
userIdWidth.setEnabled(!autoIdWidth.isSelected()); |
560 |
0 |
userIdWidthlabel.setEnabled(!autoIdWidth.isSelected()); |
561 |
0 |
Integer wi = Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH"); |
562 |
0 |
userIdWidth.setText(wi == null ? "" : wi.toString()); |
563 |
|
|
564 |
|
|
565 |
0 |
blcjv.setSelected(Cache.getDefault("BLC_JVSUFFIX", true)); |
566 |
0 |
clustaljv.setSelected(Cache.getDefault("CLUSTAL_JVSUFFIX", true)); |
567 |
0 |
fastajv.setSelected(Cache.getDefault("FASTA_JVSUFFIX", true)); |
568 |
0 |
msfjv.setSelected(Cache.getDefault("MSF_JVSUFFIX", true)); |
569 |
0 |
pfamjv.setSelected(Cache.getDefault("PFAM_JVSUFFIX", true)); |
570 |
0 |
pileupjv.setSelected(Cache.getDefault("PILEUP_JVSUFFIX", true)); |
571 |
0 |
pirjv.setSelected(Cache.getDefault("PIR_JVSUFFIX", true)); |
572 |
0 |
modellerOutput.setSelected(Cache.getDefault("PIR_MODELLER", false)); |
573 |
0 |
embbedBioJSON |
574 |
|
.setSelected(Cache.getDefault("EXPORT_EMBBED_BIOJSON", true)); |
575 |
|
|
576 |
|
|
577 |
|
|
578 |
|
|
579 |
0 |
autoCalculateConsCheck |
580 |
|
.setSelected(Cache.getDefault("AUTO_CALC_CONSENSUS", true)); |
581 |
0 |
padGaps.setSelected(Cache.getDefault("PAD_GAPS", false)); |
582 |
0 |
sortByTree.setSelected(Cache.getDefault("SORT_BY_TREE", false)); |
583 |
|
|
584 |
0 |
annotations_actionPerformed(null); |
585 |
|
|
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
|
590 |
|
|
591 |
0 |
loadLastSavedBackupsOptions(); |
592 |
|
} |
593 |
|
|
594 |
|
|
595 |
|
|
596 |
|
|
597 |
|
|
598 |
|
@param |
599 |
|
@param |
600 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 4 |
Complexity Density: 0.44 |
|
601 |
0 |
protected void setupOutputCombo(JComboBox<Object> comboBox,... |
602 |
|
String propertyKey) |
603 |
|
{ |
604 |
0 |
comboBox.addItem(promptEachTimeOpt); |
605 |
0 |
comboBox.addItem(lineArtOpt); |
606 |
0 |
comboBox.addItem(textOpt); |
607 |
|
|
608 |
|
|
609 |
|
|
610 |
|
|
611 |
0 |
String defaultOption = Platform.isJS() ? "Text" |
612 |
|
: Cache.getDefault(propertyKey, "Prompt each time"); |
613 |
0 |
if (defaultOption.equalsIgnoreCase("Text")) |
614 |
|
{ |
615 |
0 |
comboBox.setSelectedItem(textOpt); |
616 |
|
} |
617 |
0 |
else if (defaultOption.equalsIgnoreCase("Lineart")) |
618 |
|
{ |
619 |
0 |
comboBox.setSelectedItem(lineArtOpt); |
620 |
|
} |
621 |
|
else |
622 |
|
{ |
623 |
0 |
comboBox.setSelectedItem(promptEachTimeOpt); |
624 |
|
} |
625 |
|
} |
626 |
|
|
627 |
|
|
628 |
|
|
629 |
|
|
630 |
|
|
631 |
|
@param |
632 |
|
|
|
|
| 0% |
Uncovered Elements: 140 (140) |
Complexity: 15 |
Complexity Density: 0.13 |
|
633 |
0 |
@Override... |
634 |
|
public void ok_actionPerformed(ActionEvent e) |
635 |
|
{ |
636 |
0 |
if (!validateSettings()) |
637 |
|
{ |
638 |
0 |
return; |
639 |
|
} |
640 |
|
|
641 |
|
|
642 |
|
|
643 |
|
|
644 |
0 |
Cache.applicationProperties.setProperty("SHOW_JVSUFFIX", |
645 |
|
Boolean.toString(seqLimit.isSelected())); |
646 |
0 |
Cache.applicationProperties.setProperty("RIGHT_ALIGN_IDS", |
647 |
|
Boolean.toString(rightAlign.isSelected())); |
648 |
0 |
Cache.applicationProperties.setProperty("SHOW_FULLSCREEN", |
649 |
|
Boolean.toString(fullScreen.isSelected())); |
650 |
0 |
Cache.applicationProperties.setProperty("SHOW_OVERVIEW", |
651 |
|
Boolean.toString(openoverv.isSelected())); |
652 |
0 |
Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", |
653 |
|
Boolean.toString(annotations.isSelected())); |
654 |
0 |
Cache.applicationProperties.setProperty("SHOW_CONSERVATION", |
655 |
|
Boolean.toString(conservation.isSelected())); |
656 |
0 |
Cache.applicationProperties.setProperty("SHOW_QUALITY", |
657 |
|
Boolean.toString(quality.isSelected())); |
658 |
0 |
Cache.applicationProperties.setProperty("SHOW_IDENTITY", |
659 |
|
Boolean.toString(identity.isSelected())); |
660 |
|
|
661 |
0 |
Cache.applicationProperties.setProperty("GAP_SYMBOL", |
662 |
|
gapSymbolCB.getSelectedItem().toString()); |
663 |
|
|
664 |
0 |
Cache.applicationProperties.setProperty("FONT_NAME", |
665 |
|
fontNameCB.getSelectedItem().toString()); |
666 |
0 |
Cache.applicationProperties.setProperty("FONT_STYLE", |
667 |
|
fontStyleCB.getSelectedItem().toString()); |
668 |
0 |
Cache.applicationProperties.setProperty("FONT_SIZE", |
669 |
|
fontSizeCB.getSelectedItem().toString()); |
670 |
|
|
671 |
0 |
Cache.applicationProperties.setProperty("ID_ITALICS", |
672 |
|
Boolean.toString(idItalics.isSelected())); |
673 |
0 |
Cache.applicationProperties.setProperty("SHOW_UNCONSERVED", |
674 |
|
Boolean.toString(showUnconserved.isSelected())); |
675 |
0 |
Cache.applicationProperties.setProperty(SHOW_OCCUPANCY, |
676 |
|
Boolean.toString(showOccupancy.isSelected())); |
677 |
0 |
Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS", |
678 |
|
Boolean.toString(showGroupConsensus.isSelected())); |
679 |
0 |
Cache.applicationProperties.setProperty("SHOW_GROUP_CONSERVATION", |
680 |
|
Boolean.toString(showGroupConservation.isSelected())); |
681 |
0 |
Cache.applicationProperties.setProperty("SHOW_CONSENSUS_HISTOGRAM", |
682 |
|
Boolean.toString(showConsensHistogram.isSelected())); |
683 |
0 |
Cache.applicationProperties.setProperty("SHOW_CONSENSUS_LOGO", |
684 |
|
Boolean.toString(showConsensLogo.isSelected())); |
685 |
0 |
Cache.applicationProperties.setProperty("ANTI_ALIAS", |
686 |
|
Boolean.toString(smoothFont.isSelected())); |
687 |
0 |
Cache.applicationProperties.setProperty(SCALE_PROTEIN_TO_CDNA, |
688 |
|
Boolean.toString(scaleProteinToCdna.isSelected())); |
689 |
0 |
Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP", |
690 |
|
Boolean.toString(showNpTooltip.isSelected())); |
691 |
0 |
Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP", |
692 |
|
Boolean.toString(showDbRefTooltip.isSelected())); |
693 |
|
|
694 |
0 |
Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", |
695 |
|
Boolean.toString(wrap.isSelected())); |
696 |
|
|
697 |
0 |
Cache.applicationProperties.setProperty("STARTUP_FILE", |
698 |
|
startupFileTextfield.getText()); |
699 |
0 |
Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE", |
700 |
|
Boolean.toString(startupCheckbox.isSelected())); |
701 |
|
|
702 |
0 |
Cache.applicationProperties.setProperty("SORT_ALIGNMENT", |
703 |
|
sortby.getSelectedItem().toString()); |
704 |
|
|
705 |
|
|
706 |
0 |
SequenceAnnotationOrder annSortOrder = SequenceAnnotationOrder |
707 |
|
.forDescription(sortAnnBy.getSelectedItem().toString()); |
708 |
0 |
if (annSortOrder != null) |
709 |
|
{ |
710 |
0 |
Cache.applicationProperties.setProperty(SORT_ANNOTATIONS, |
711 |
|
annSortOrder.name()); |
712 |
|
} |
713 |
|
|
714 |
0 |
final boolean showAutocalcFirst = sortAutocalc.getSelectedIndex() == 0; |
715 |
0 |
Cache.applicationProperties.setProperty(SHOW_AUTOCALC_ABOVE, |
716 |
|
Boolean.valueOf(showAutocalcFirst).toString()); |
717 |
|
|
718 |
|
|
719 |
|
|
720 |
|
|
721 |
0 |
Cache.applicationProperties.setProperty(DEFAULT_COLOUR_PROT, |
722 |
|
protColour.getSelectedItem().toString()); |
723 |
0 |
Cache.applicationProperties.setProperty(DEFAULT_COLOUR_NUC, |
724 |
|
nucColour.getSelectedItem().toString()); |
725 |
0 |
Cache.setColourProperty("ANNOTATIONCOLOUR_MIN", |
726 |
|
minColour.getBackground()); |
727 |
0 |
Cache.setColourProperty("ANNOTATIONCOLOUR_MAX", |
728 |
|
maxColour.getBackground()); |
729 |
|
|
730 |
|
|
731 |
|
|
732 |
|
|
733 |
0 |
Cache.setColourProperty(GAP_COLOUR, gapColour.getBackground()); |
734 |
0 |
Cache.setColourProperty(HIDDEN_COLOUR, hiddenColour.getBackground()); |
735 |
0 |
Cache.applicationProperties.setProperty(USE_LEGACY_GAP, |
736 |
|
Boolean.toString(useLegacyGap.isSelected())); |
737 |
0 |
Cache.applicationProperties.setProperty(SHOW_OV_HIDDEN_AT_START, |
738 |
|
Boolean.toString(showHiddenAtStart.isSelected())); |
739 |
|
|
740 |
|
|
741 |
|
|
742 |
|
|
743 |
0 |
Cache.applicationProperties.setProperty(ADD_TEMPFACT_ANN, |
744 |
|
Boolean.toString(addTempFactor.isSelected())); |
745 |
0 |
Cache.applicationProperties.setProperty(ADD_SS_ANN, |
746 |
|
Boolean.toString(addSecondaryStructure.isSelected())); |
747 |
0 |
Cache.applicationProperties.setProperty(USE_RNAVIEW, |
748 |
|
Boolean.toString(useRnaView.isSelected())); |
749 |
0 |
Cache.applicationProperties.setProperty(STRUCT_FROM_PDB, |
750 |
|
Boolean.toString(structFromPdb.isSelected())); |
751 |
0 |
String viewer = structViewer.getSelectedItem().toString(); |
752 |
0 |
String viewerPath = structureViewerPath.getText(); |
753 |
0 |
Cache.applicationProperties.setProperty(STRUCTURE_DISPLAY, |
754 |
|
viewer); |
755 |
0 |
if (viewer.equals(ViewerType.CHIMERA.name())) |
756 |
|
{ |
757 |
0 |
Cache.setOrRemove(CHIMERA_PATH, viewerPath); |
758 |
|
} |
759 |
0 |
else if (viewer.equals(ViewerType.CHIMERAX.name())) |
760 |
|
{ |
761 |
0 |
Cache.setOrRemove(CHIMERAX_PATH, viewerPath); |
762 |
|
} |
763 |
0 |
else if (viewer.equals(ViewerType.PYMOL.name())) |
764 |
|
{ |
765 |
0 |
Cache.setOrRemove(PYMOL_PATH, viewerPath); |
766 |
|
} |
767 |
0 |
Cache.applicationProperties.setProperty("MAP_WITH_SIFTS", |
768 |
|
Boolean.toString(siftsMapping.isSelected())); |
769 |
0 |
SiftsSettings.setMapWithSifts(siftsMapping.isSelected()); |
770 |
|
|
771 |
|
|
772 |
|
|
773 |
|
|
774 |
0 |
Cache.applicationProperties.setProperty("EPS_RENDERING", |
775 |
|
((OptionsParam) epsRendering.getSelectedItem()).getCode()); |
776 |
0 |
Cache.applicationProperties.setProperty("HTML_RENDERING", |
777 |
|
((OptionsParam) htmlRendering.getSelectedItem()).getCode()); |
778 |
0 |
Cache.applicationProperties.setProperty("SVG_RENDERING", |
779 |
|
((OptionsParam) svgRendering.getSelectedItem()).getCode()); |
780 |
|
|
781 |
|
|
782 |
|
|
783 |
|
|
784 |
0 |
Cache.setOrRemove("DEFAULT_BROWSER", defaultBrowser.getText()); |
785 |
|
|
786 |
0 |
jalview.util.BrowserLauncher.resetBrowser(); |
787 |
|
|
788 |
|
|
789 |
0 |
String menuLinks = sequenceUrlLinks.writeUrlsAsString(true); |
790 |
0 |
if (menuLinks.isEmpty()) |
791 |
|
{ |
792 |
0 |
Cache.applicationProperties.remove("SEQUENCE_LINKS"); |
793 |
|
} |
794 |
|
else |
795 |
|
{ |
796 |
0 |
Cache.applicationProperties.setProperty("SEQUENCE_LINKS", |
797 |
|
menuLinks.toString()); |
798 |
|
} |
799 |
|
|
800 |
0 |
String nonMenuLinks = sequenceUrlLinks.writeUrlsAsString(false); |
801 |
0 |
if (nonMenuLinks.isEmpty()) |
802 |
|
{ |
803 |
0 |
Cache.applicationProperties.remove("STORED_LINKS"); |
804 |
|
} |
805 |
|
else |
806 |
|
{ |
807 |
0 |
Cache.applicationProperties.setProperty("STORED_LINKS", |
808 |
|
nonMenuLinks.toString()); |
809 |
|
} |
810 |
|
|
811 |
0 |
Cache.applicationProperties.setProperty("DEFAULT_URL", |
812 |
|
sequenceUrlLinks.getPrimaryUrlId()); |
813 |
|
|
814 |
0 |
Cache.applicationProperties.setProperty("USE_PROXY", |
815 |
|
Boolean.toString(useProxy.isSelected())); |
816 |
|
|
817 |
0 |
Cache.setOrRemove("PROXY_SERVER", proxyServerTB.getText()); |
818 |
|
|
819 |
0 |
Cache.setOrRemove("PROXY_PORT", proxyPortTB.getText()); |
820 |
|
|
821 |
0 |
if (useProxy.isSelected()) |
822 |
|
{ |
823 |
0 |
System.setProperty("http.proxyHost", proxyServerTB.getText()); |
824 |
0 |
System.setProperty("http.proxyPort", proxyPortTB.getText()); |
825 |
|
} |
826 |
|
else |
827 |
|
{ |
828 |
0 |
System.setProperty("http.proxyHost", ""); |
829 |
0 |
System.setProperty("http.proxyPort", ""); |
830 |
|
} |
831 |
0 |
Cache.setProperty("VERSION_CHECK", |
832 |
|
Boolean.toString(versioncheck.isSelected())); |
833 |
0 |
if (Cache.getProperty("USAGESTATS") != null || usagestats.isSelected()) |
834 |
|
{ |
835 |
|
|
836 |
0 |
Cache.setProperty("USAGESTATS", |
837 |
|
Boolean.toString(usagestats.isSelected())); |
838 |
|
} |
839 |
0 |
if (!questionnaire.isSelected()) |
840 |
|
{ |
841 |
0 |
Cache.setProperty("NOQUESTIONNAIRES", "true"); |
842 |
|
} |
843 |
|
else |
844 |
|
{ |
845 |
|
|
846 |
|
|
847 |
0 |
Cache.removeProperty("NOQUESTIONNAIRES"); |
848 |
|
} |
849 |
|
|
850 |
|
|
851 |
|
|
852 |
|
|
853 |
0 |
Cache.applicationProperties.setProperty("BLC_JVSUFFIX", |
854 |
|
Boolean.toString(blcjv.isSelected())); |
855 |
0 |
Cache.applicationProperties.setProperty("CLUSTAL_JVSUFFIX", |
856 |
|
Boolean.toString(clustaljv.isSelected())); |
857 |
0 |
Cache.applicationProperties.setProperty("FASTA_JVSUFFIX", |
858 |
|
Boolean.toString(fastajv.isSelected())); |
859 |
0 |
Cache.applicationProperties.setProperty("MSF_JVSUFFIX", |
860 |
|
Boolean.toString(msfjv.isSelected())); |
861 |
0 |
Cache.applicationProperties.setProperty("PFAM_JVSUFFIX", |
862 |
|
Boolean.toString(pfamjv.isSelected())); |
863 |
0 |
Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX", |
864 |
|
Boolean.toString(pileupjv.isSelected())); |
865 |
0 |
Cache.applicationProperties.setProperty("PIR_JVSUFFIX", |
866 |
|
Boolean.toString(pirjv.isSelected())); |
867 |
0 |
Cache.applicationProperties.setProperty("PIR_MODELLER", |
868 |
|
Boolean.toString(modellerOutput.isSelected())); |
869 |
0 |
Cache.applicationProperties.setProperty("EXPORT_EMBBED_BIOJSON", |
870 |
|
Boolean.toString(embbedBioJSON.isSelected())); |
871 |
0 |
jalview.io.PIRFile.useModellerOutput = modellerOutput.isSelected(); |
872 |
|
|
873 |
0 |
Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH", |
874 |
|
Boolean.toString(autoIdWidth.isSelected())); |
875 |
0 |
userIdWidth_actionPerformed(); |
876 |
0 |
Cache.applicationProperties.setProperty("FIGURE_FIXEDIDWIDTH", |
877 |
|
userIdWidth.getText()); |
878 |
|
|
879 |
|
|
880 |
|
|
881 |
|
|
882 |
0 |
Cache.applicationProperties.setProperty("AUTO_CALC_CONSENSUS", |
883 |
|
Boolean.toString(autoCalculateConsCheck.isSelected())); |
884 |
0 |
Cache.applicationProperties.setProperty("SORT_BY_TREE", |
885 |
|
Boolean.toString(sortByTree.isSelected())); |
886 |
0 |
Cache.applicationProperties.setProperty("PAD_GAPS", |
887 |
|
Boolean.toString(padGaps.isSelected())); |
888 |
|
|
889 |
0 |
if (!Platform.isJS()) |
890 |
|
{ |
891 |
0 |
wsPrefs.updateAndRefreshWsMenuConfig(false); |
892 |
|
} |
893 |
|
|
894 |
|
|
895 |
|
|
896 |
|
|
897 |
0 |
Cache.applicationProperties.setProperty(BackupFiles.ENABLED, |
898 |
|
Boolean.toString(enableBackupFiles.isSelected())); |
899 |
0 |
int preset = getComboIntStringKey(backupfilesPresetsCombo); |
900 |
0 |
Cache.applicationProperties.setProperty(BackupFiles.NS + "_PRESET", Integer.toString(preset)); |
901 |
|
|
902 |
0 |
if (preset == BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM) |
903 |
|
{ |
904 |
0 |
BackupFilesPresetEntry customBFPE = getBackupfilesCurrentEntry(); |
905 |
0 |
BackupFilesPresetEntry.backupfilesPresetEntriesValues.put( |
906 |
|
BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM, customBFPE); |
907 |
0 |
Cache.applicationProperties |
908 |
|
.setProperty(BackupFilesPresetEntry.CUSTOMCONFIG, |
909 |
|
customBFPE.toString()); |
910 |
|
} |
911 |
|
|
912 |
0 |
BackupFilesPresetEntry savedBFPE = BackupFilesPresetEntry.backupfilesPresetEntriesValues |
913 |
|
.get(preset); |
914 |
0 |
Cache.applicationProperties.setProperty( |
915 |
|
BackupFilesPresetEntry.SAVEDCONFIG, savedBFPE.toString()); |
916 |
|
|
917 |
0 |
Cache.saveProperties(); |
918 |
0 |
Desktop.instance.doConfigureStructurePrefs(); |
919 |
0 |
try |
920 |
|
{ |
921 |
0 |
frame.setClosed(true); |
922 |
|
} catch (Exception ex) |
923 |
|
{ |
924 |
|
} |
925 |
|
} |
926 |
|
|
927 |
|
|
928 |
|
|
929 |
|
|
930 |
|
|
931 |
|
@return |
932 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
933 |
0 |
private boolean validateSettings()... |
934 |
|
{ |
935 |
0 |
if (!validateStructure()) |
936 |
|
{ |
937 |
0 |
structureTab.requestFocusInWindow(); |
938 |
0 |
return false; |
939 |
|
} |
940 |
0 |
return true; |
941 |
|
} |
942 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
943 |
0 |
@Override... |
944 |
|
protected boolean validateStructure() |
945 |
|
{ |
946 |
0 |
return validateViewerPath(); |
947 |
|
|
948 |
|
} |
949 |
|
|
950 |
|
|
951 |
|
|
952 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
953 |
0 |
@Override... |
954 |
|
public void startupFileTextfield_mouseClicked() |
955 |
|
{ |
956 |
|
|
957 |
0 |
String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); |
958 |
0 |
JalviewFileChooser chooser = JalviewFileChooser |
959 |
|
.forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat); |
960 |
0 |
chooser.setFileView(new JalviewFileView()); |
961 |
0 |
chooser.setDialogTitle( |
962 |
|
MessageManager.getString("label.select_startup_file")); |
963 |
|
|
964 |
0 |
int value = chooser.showOpenDialog(this); |
965 |
|
|
966 |
0 |
if (value == JalviewFileChooser.APPROVE_OPTION) |
967 |
|
{ |
968 |
0 |
FileFormatI format = chooser.getSelectedFormat(); |
969 |
0 |
if (format != null) |
970 |
|
{ |
971 |
0 |
Cache.applicationProperties.setProperty("DEFAULT_FILE_FORMAT", |
972 |
|
format.getName()); |
973 |
|
} |
974 |
0 |
startupFileTextfield |
975 |
|
.setText(chooser.getSelectedFile().getAbsolutePath()); |
976 |
|
} |
977 |
|
} |
978 |
|
|
979 |
|
|
980 |
|
|
981 |
|
|
982 |
|
@param |
983 |
|
|
984 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
985 |
0 |
@Override... |
986 |
|
public void cancel_actionPerformed(ActionEvent e) |
987 |
|
{ |
988 |
0 |
try |
989 |
|
{ |
990 |
0 |
if (!Platform.isJS()) |
991 |
|
{ |
992 |
0 |
wsPrefs.updateWsMenuConfig(true); |
993 |
0 |
wsPrefs.refreshWs_actionPerformed(e); |
994 |
|
} |
995 |
0 |
frame.setClosed(true); |
996 |
|
} catch (Exception ex) |
997 |
|
{ |
998 |
|
} |
999 |
|
} |
1000 |
|
|
1001 |
|
|
1002 |
|
|
1003 |
|
|
1004 |
|
@param |
1005 |
|
|
1006 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
1007 |
0 |
@Override... |
1008 |
|
public void annotations_actionPerformed(ActionEvent e) |
1009 |
|
{ |
1010 |
0 |
conservation.setEnabled(annotations.isSelected()); |
1011 |
0 |
quality.setEnabled(annotations.isSelected()); |
1012 |
0 |
identity.setEnabled(annotations.isSelected()); |
1013 |
0 |
showOccupancy.setEnabled(annotations.isSelected()); |
1014 |
0 |
showGroupConsensus.setEnabled(annotations.isSelected()); |
1015 |
0 |
showGroupConservation.setEnabled(annotations.isSelected()); |
1016 |
0 |
showConsensHistogram.setEnabled(annotations.isSelected() |
1017 |
|
&& (identity.isSelected() || showGroupConsensus.isSelected())); |
1018 |
0 |
showConsensLogo.setEnabled(annotations.isSelected() |
1019 |
|
&& (identity.isSelected() || showGroupConsensus.isSelected())); |
1020 |
|
} |
1021 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 5 |
Complexity Density: 0.45 |
|
1022 |
0 |
@Override... |
1023 |
|
public void newLink_actionPerformed(ActionEvent e) |
1024 |
|
{ |
1025 |
0 |
GSequenceLink link = new GSequenceLink(); |
1026 |
0 |
boolean valid = false; |
1027 |
0 |
while (!valid) |
1028 |
|
{ |
1029 |
0 |
if (JvOptionPane.showInternalConfirmDialog(Desktop.desktop, link, |
1030 |
|
MessageManager.getString("label.new_sequence_url_link"), |
1031 |
|
JvOptionPane.OK_CANCEL_OPTION, -1, |
1032 |
|
null) == JvOptionPane.OK_OPTION) |
1033 |
|
{ |
1034 |
0 |
if (link.checkValid()) |
1035 |
|
{ |
1036 |
0 |
if (((UrlLinkTableModel) linkUrlTable.getModel()) |
1037 |
|
.isUniqueName(link.getName())) |
1038 |
|
{ |
1039 |
0 |
((UrlLinkTableModel) linkUrlTable.getModel()) |
1040 |
|
.insertRow(link.getName(), link.getURL()); |
1041 |
0 |
valid = true; |
1042 |
|
} |
1043 |
|
else |
1044 |
|
{ |
1045 |
0 |
link.notifyDuplicate(); |
1046 |
0 |
continue; |
1047 |
|
} |
1048 |
|
} |
1049 |
|
} |
1050 |
|
else |
1051 |
|
{ |
1052 |
0 |
break; |
1053 |
|
} |
1054 |
|
} |
1055 |
|
} |
1056 |
|
|
|
|
| 0% |
Uncovered Elements: 31 (31) |
Complexity: 7 |
Complexity Density: 0.33 |
|
1057 |
0 |
@Override... |
1058 |
|
public void editLink_actionPerformed(ActionEvent e) |
1059 |
|
{ |
1060 |
0 |
GSequenceLink link = new GSequenceLink(); |
1061 |
|
|
1062 |
0 |
int index = linkUrlTable.getSelectedRow(); |
1063 |
0 |
if (index == -1) |
1064 |
|
{ |
1065 |
|
|
1066 |
0 |
Cache.log.debug("Edit with no row selected in linkUrlTable"); |
1067 |
0 |
return; |
1068 |
|
} |
1069 |
|
|
1070 |
0 |
int nameCol = ((UrlLinkTableModel) linkUrlTable.getModel()) |
1071 |
|
.getNameColumn(); |
1072 |
0 |
int urlCol = ((UrlLinkTableModel) linkUrlTable.getModel()) |
1073 |
|
.getUrlColumn(); |
1074 |
0 |
String oldName = linkUrlTable.getValueAt(index, nameCol).toString(); |
1075 |
0 |
link.setName(oldName); |
1076 |
0 |
link.setURL(linkUrlTable.getValueAt(index, urlCol).toString()); |
1077 |
|
|
1078 |
0 |
boolean valid = false; |
1079 |
0 |
while (!valid) |
1080 |
|
{ |
1081 |
0 |
if (JvOptionPane.showInternalConfirmDialog(Desktop.desktop, link, |
1082 |
|
MessageManager.getString("label.edit_sequence_url_link"), |
1083 |
|
JvOptionPane.OK_CANCEL_OPTION, -1, |
1084 |
|
null) == JvOptionPane.OK_OPTION) |
1085 |
|
{ |
1086 |
0 |
if (link.checkValid()) |
1087 |
|
{ |
1088 |
0 |
if ((oldName.equals(link.getName())) |
1089 |
|
|| (((UrlLinkTableModel) linkUrlTable.getModel()) |
1090 |
|
.isUniqueName(link.getName()))) |
1091 |
|
{ |
1092 |
0 |
linkUrlTable.setValueAt(link.getName(), index, nameCol); |
1093 |
0 |
linkUrlTable.setValueAt(link.getURL(), index, urlCol); |
1094 |
0 |
valid = true; |
1095 |
|
} |
1096 |
|
else |
1097 |
|
{ |
1098 |
0 |
link.notifyDuplicate(); |
1099 |
0 |
continue; |
1100 |
|
} |
1101 |
|
} |
1102 |
|
} |
1103 |
|
else |
1104 |
|
{ |
1105 |
0 |
break; |
1106 |
|
} |
1107 |
|
} |
1108 |
|
} |
1109 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
1110 |
0 |
@Override... |
1111 |
|
public void deleteLink_actionPerformed(ActionEvent e) |
1112 |
|
{ |
1113 |
0 |
int index = linkUrlTable.getSelectedRow(); |
1114 |
0 |
int modelIndex = -1; |
1115 |
0 |
if (index == -1) |
1116 |
|
{ |
1117 |
|
|
1118 |
0 |
Cache.log.debug("Delete with no row selected in linkUrlTable"); |
1119 |
0 |
return; |
1120 |
|
} |
1121 |
|
else |
1122 |
|
{ |
1123 |
0 |
modelIndex = linkUrlTable.convertRowIndexToModel(index); |
1124 |
|
} |
1125 |
|
|
1126 |
|
|
1127 |
0 |
((UrlLinkTableModel) linkUrlTable.getModel()).removeRow(modelIndex); |
1128 |
|
} |
1129 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
1130 |
0 |
@Override... |
1131 |
|
public void defaultBrowser_mouseClicked(MouseEvent e) |
1132 |
|
{ |
1133 |
|
|
1134 |
0 |
if (!Platform.isJS()) |
1135 |
|
|
1136 |
|
|
1137 |
|
|
1138 |
|
|
1139 |
|
|
1140 |
|
{ |
1141 |
0 |
JFileChooser chooser = new JFileChooser("."); |
1142 |
0 |
chooser.setDialogTitle( |
1143 |
|
MessageManager.getString("label.select_default_browser")); |
1144 |
|
|
1145 |
0 |
int value = chooser.showOpenDialog(this); |
1146 |
|
|
1147 |
0 |
if (value == JFileChooser.APPROVE_OPTION) |
1148 |
|
{ |
1149 |
0 |
defaultBrowser.setText(chooser.getSelectedFile().getAbsolutePath()); |
1150 |
|
} |
1151 |
|
} |
1152 |
|
} |
1153 |
|
|
1154 |
|
|
1155 |
|
|
1156 |
|
|
1157 |
|
@see |
1158 |
|
|
1159 |
|
|
1160 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1161 |
0 |
@Override... |
1162 |
|
protected void showunconserved_actionPerformed(ActionEvent e) |
1163 |
|
{ |
1164 |
|
|
1165 |
0 |
super.showunconserved_actionPerformed(e); |
1166 |
|
} |
1167 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1168 |
0 |
public static List<String> getGroupURLLinks()... |
1169 |
|
{ |
1170 |
0 |
return groupURLLinks; |
1171 |
|
} |
1172 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1173 |
0 |
@Override... |
1174 |
|
public void minColour_actionPerformed(JPanel panel) |
1175 |
|
{ |
1176 |
0 |
JalviewColourChooser.showColourChooser(this, |
1177 |
|
MessageManager.getString("label.select_colour_minimum_value"), |
1178 |
|
panel); |
1179 |
|
} |
1180 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1181 |
0 |
@Override... |
1182 |
|
public void maxColour_actionPerformed(JPanel panel) |
1183 |
|
{ |
1184 |
0 |
JalviewColourChooser.showColourChooser(this, |
1185 |
|
MessageManager.getString("label.select_colour_maximum_value"), |
1186 |
|
panel); |
1187 |
|
} |
1188 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1189 |
0 |
@Override... |
1190 |
|
public void gapColour_actionPerformed(JPanel gap) |
1191 |
|
{ |
1192 |
0 |
if (!useLegacyGap.isSelected()) |
1193 |
|
{ |
1194 |
0 |
JalviewColourChooser.showColourChooser(this, |
1195 |
|
MessageManager.getString("label.select_gap_colour"), |
1196 |
|
gap); |
1197 |
|
} |
1198 |
|
} |
1199 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1200 |
0 |
@Override... |
1201 |
|
public void hiddenColour_actionPerformed(JPanel hidden) |
1202 |
|
{ |
1203 |
0 |
JalviewColourChooser.showColourChooser(this, |
1204 |
|
MessageManager.getString("label.select_hidden_colour"), |
1205 |
|
hidden); |
1206 |
|
} |
1207 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
1208 |
0 |
@Override... |
1209 |
|
protected void useLegacyGaps_actionPerformed(ActionEvent e) |
1210 |
|
{ |
1211 |
0 |
boolean enabled = useLegacyGap.isSelected(); |
1212 |
0 |
if (enabled) |
1213 |
|
{ |
1214 |
0 |
gapColour.setBackground( |
1215 |
|
jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_LEGACY_GAP); |
1216 |
|
} |
1217 |
|
else |
1218 |
|
{ |
1219 |
0 |
gapColour.setBackground( |
1220 |
|
jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_GAP); |
1221 |
|
} |
1222 |
0 |
gapColour.setEnabled(!enabled); |
1223 |
0 |
gapLabel.setEnabled(!enabled); |
1224 |
|
} |
1225 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
1226 |
0 |
@Override... |
1227 |
|
protected void resetOvDefaults_actionPerformed(ActionEvent e) |
1228 |
|
{ |
1229 |
0 |
useLegacyGap.setSelected(false); |
1230 |
0 |
useLegacyGaps_actionPerformed(null); |
1231 |
0 |
showHiddenAtStart.setSelected(false); |
1232 |
0 |
hiddenColour.setBackground( |
1233 |
|
jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_HIDDEN); |
1234 |
|
} |
1235 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.44 |
|
1236 |
0 |
@Override... |
1237 |
|
protected void userIdWidth_actionPerformed() |
1238 |
|
{ |
1239 |
0 |
try |
1240 |
|
{ |
1241 |
0 |
String val = userIdWidth.getText().trim(); |
1242 |
0 |
if (val.length() > 0) |
1243 |
|
{ |
1244 |
0 |
Integer iw = Integer.parseInt(val); |
1245 |
0 |
if (iw.intValue() < 12) |
1246 |
|
{ |
1247 |
0 |
throw new NumberFormatException(); |
1248 |
|
} |
1249 |
0 |
userIdWidth.setText(iw.toString()); |
1250 |
|
} |
1251 |
|
} catch (NumberFormatException x) |
1252 |
|
{ |
1253 |
0 |
userIdWidth.setText(""); |
1254 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, |
1255 |
|
MessageManager |
1256 |
|
.getString("warn.user_defined_width_requirements"), |
1257 |
|
MessageManager.getString("label.invalid_id_column_width"), |
1258 |
|
JvOptionPane.WARNING_MESSAGE); |
1259 |
|
} |
1260 |
|
} |
1261 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1262 |
0 |
@Override... |
1263 |
|
protected void autoIdWidth_actionPerformed() |
1264 |
|
{ |
1265 |
0 |
userIdWidth.setEnabled(!autoIdWidth.isSelected()); |
1266 |
0 |
userIdWidthlabel.setEnabled(!autoIdWidth.isSelected()); |
1267 |
|
} |
1268 |
|
|
1269 |
|
|
1270 |
|
|
1271 |
|
|
1272 |
|
|
1273 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
1274 |
0 |
private boolean validateViewerPath()... |
1275 |
|
{ |
1276 |
0 |
if (structureViewerPath.getText().trim().length() > 0) |
1277 |
|
{ |
1278 |
0 |
File f = new File(structureViewerPath.getText()); |
1279 |
0 |
if (!f.canExecute()) |
1280 |
|
{ |
1281 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, |
1282 |
|
MessageManager.getString("label.invalid_viewer_path"), |
1283 |
|
MessageManager.getString("label.invalid_viewer_path"), |
1284 |
|
JvOptionPane.ERROR_MESSAGE); |
1285 |
0 |
return false; |
1286 |
|
} |
1287 |
|
} |
1288 |
0 |
return true; |
1289 |
|
} |
1290 |
|
|
1291 |
|
|
1292 |
|
|
1293 |
|
|
1294 |
|
|
|
|
| 0% |
Uncovered Elements: 48 (48) |
Complexity: 11 |
Complexity Density: 0.28 |
|
1295 |
0 |
@Override... |
1296 |
|
protected void structureViewer_actionPerformed(String selectedItem) |
1297 |
|
{ |
1298 |
0 |
if (selectedItem.equals(ViewerType.JMOL.name())) |
1299 |
|
{ |
1300 |
0 |
structureViewerPath.setEnabled(false); |
1301 |
0 |
structureViewerPathLabel.setEnabled(false); |
1302 |
0 |
return; |
1303 |
|
} |
1304 |
0 |
boolean found = false; |
1305 |
0 |
structureViewerPath.setEnabled(true); |
1306 |
0 |
structureViewerPathLabel.setEnabled(true); |
1307 |
0 |
structureViewerPathLabel.setText(MessageManager |
1308 |
|
.formatMessage("label.viewer_path", selectedItem)); |
1309 |
|
|
1310 |
|
|
1311 |
|
|
1312 |
|
|
1313 |
0 |
String viewerPath = ""; |
1314 |
0 |
List<String> paths = null; |
1315 |
0 |
try |
1316 |
|
{ |
1317 |
0 |
ViewerType viewerType = ViewerType.valueOf(selectedItem); |
1318 |
0 |
switch (viewerType) |
1319 |
|
{ |
1320 |
0 |
case JMOL: |
1321 |
|
|
1322 |
0 |
break; |
1323 |
0 |
case CHIMERA: |
1324 |
0 |
viewerPath = Cache.getDefault(CHIMERA_PATH, ""); |
1325 |
0 |
paths = StructureManager.getChimeraPaths(false); |
1326 |
0 |
break; |
1327 |
0 |
case CHIMERAX: |
1328 |
0 |
viewerPath = Cache.getDefault(CHIMERAX_PATH, ""); |
1329 |
0 |
paths = StructureManager.getChimeraPaths(true); |
1330 |
0 |
break; |
1331 |
0 |
case PYMOL: |
1332 |
0 |
viewerPath = Cache.getDefault(PYMOL_PATH, ""); |
1333 |
0 |
paths = PymolManager.getPymolPaths(); |
1334 |
0 |
break; |
1335 |
|
} |
1336 |
|
} catch (IllegalArgumentException e) |
1337 |
|
{ |
1338 |
|
|
1339 |
|
} |
1340 |
0 |
structureViewerPath.setText(viewerPath); |
1341 |
|
|
1342 |
0 |
paths.add(0, structureViewerPath.getText()); |
1343 |
0 |
for (String path : paths) |
1344 |
|
{ |
1345 |
0 |
if (new File(path.trim()).canExecute()) |
1346 |
|
{ |
1347 |
0 |
found = true; |
1348 |
0 |
break; |
1349 |
|
} |
1350 |
|
} |
1351 |
|
|
1352 |
0 |
if (!found) |
1353 |
|
{ |
1354 |
0 |
String[] options = { "OK", "Help" }; |
1355 |
0 |
int showHelp = JvOptionPane.showInternalOptionDialog(Desktop.desktop, |
1356 |
|
JvSwingUtils.wrapTooltip(true, |
1357 |
|
MessageManager.getString("label.viewer_missing")), |
1358 |
|
"", JvOptionPane.YES_NO_OPTION, JvOptionPane.WARNING_MESSAGE, |
1359 |
|
null, options, options[0]); |
1360 |
0 |
if (showHelp == JvOptionPane.NO_OPTION) |
1361 |
|
{ |
1362 |
0 |
try |
1363 |
|
{ |
1364 |
0 |
Help.showHelpWindow(HelpId.StructureViewer); |
1365 |
|
} catch (HelpSetException e) |
1366 |
|
{ |
1367 |
0 |
e.printStackTrace(); |
1368 |
|
} |
1369 |
|
} |
1370 |
|
} |
1371 |
|
} |
1372 |
|
|
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 9 |
Complexity Density: 0.82 |
|
1373 |
|
public class OptionsParam |
1374 |
|
{ |
1375 |
|
private String name; |
1376 |
|
|
1377 |
|
private String code; |
1378 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1379 |
0 |
public OptionsParam(String name, String code)... |
1380 |
|
{ |
1381 |
0 |
this.name = name; |
1382 |
0 |
this.code = code; |
1383 |
|
} |
1384 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1385 |
0 |
public String getName()... |
1386 |
|
{ |
1387 |
0 |
return name; |
1388 |
|
} |
1389 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1390 |
0 |
public void setName(String name)... |
1391 |
|
{ |
1392 |
0 |
this.name = name; |
1393 |
|
} |
1394 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1395 |
0 |
public String getCode()... |
1396 |
|
{ |
1397 |
0 |
return code; |
1398 |
|
} |
1399 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1400 |
0 |
public void setCode(String code)... |
1401 |
|
{ |
1402 |
0 |
this.code = code; |
1403 |
|
} |
1404 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1405 |
0 |
@Override... |
1406 |
|
public String toString() |
1407 |
|
{ |
1408 |
0 |
return name; |
1409 |
|
} |
1410 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1411 |
0 |
@Override... |
1412 |
|
public boolean equals(Object that) |
1413 |
|
{ |
1414 |
0 |
if (!(that instanceof OptionsParam)) |
1415 |
|
{ |
1416 |
0 |
return false; |
1417 |
|
} |
1418 |
0 |
return this.code.equalsIgnoreCase(((OptionsParam) that).code); |
1419 |
|
} |
1420 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1421 |
0 |
@Override... |
1422 |
|
public int hashCode() |
1423 |
|
{ |
1424 |
0 |
return name.hashCode() + code.hashCode(); |
1425 |
|
} |
1426 |
|
} |
1427 |
|
|
|
|
| 0% |
Uncovered Elements: 20 (20) |
Complexity: 4 |
Complexity Density: 0.31 |
|
1428 |
|
private class UrlListSelectionHandler implements ListSelectionListener |
1429 |
|
{ |
1430 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 4 |
Complexity Density: 0.31 |
|
1431 |
0 |
@Override... |
1432 |
|
public void valueChanged(ListSelectionEvent e) |
1433 |
|
{ |
1434 |
0 |
ListSelectionModel lsm = (ListSelectionModel) e.getSource(); |
1435 |
|
|
1436 |
0 |
int index = lsm.getMinSelectionIndex(); |
1437 |
0 |
if (index == -1) |
1438 |
|
{ |
1439 |
|
|
1440 |
0 |
editLink.setEnabled(false); |
1441 |
0 |
deleteLink.setEnabled(false); |
1442 |
0 |
return; |
1443 |
|
} |
1444 |
0 |
int modelIndex = linkUrlTable.convertRowIndexToModel(index); |
1445 |
|
|
1446 |
|
|
1447 |
0 |
if (((UrlLinkTableModel) linkUrlTable.getModel()) |
1448 |
|
.isRowDeletable(modelIndex)) |
1449 |
|
{ |
1450 |
0 |
deleteLink.setEnabled(true); |
1451 |
|
} |
1452 |
|
else |
1453 |
|
{ |
1454 |
0 |
deleteLink.setEnabled(false); |
1455 |
|
} |
1456 |
|
|
1457 |
0 |
if (((UrlLinkTableModel) linkUrlTable.getModel()) |
1458 |
|
.isRowEditable(modelIndex)) |
1459 |
|
{ |
1460 |
0 |
editLink.setEnabled(true); |
1461 |
|
} |
1462 |
|
else |
1463 |
|
{ |
1464 |
0 |
editLink.setEnabled(false); |
1465 |
|
} |
1466 |
|
} |
1467 |
|
} |
1468 |
|
} |