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 static jalview.util.UrlConstants.SEQUENCE_ID; |
24 |
|
|
25 |
|
import jalview.api.AlignViewportI; |
26 |
|
import jalview.api.AlignmentViewPanel; |
27 |
|
import jalview.bin.Cache; |
28 |
|
import jalview.bin.Jalview; |
29 |
|
import jalview.gui.ImageExporter.ImageWriterI; |
30 |
|
import jalview.io.DataSourceType; |
31 |
|
import jalview.io.FileFormat; |
32 |
|
import jalview.io.FileFormatException; |
33 |
|
import jalview.io.FileFormatI; |
34 |
|
import jalview.io.FileFormats; |
35 |
|
import jalview.io.FileLoader; |
36 |
|
import jalview.io.FormatAdapter; |
37 |
|
import jalview.io.IdentifyFile; |
38 |
|
import jalview.io.JalviewFileChooser; |
39 |
|
import jalview.io.JalviewFileView; |
40 |
|
import jalview.jbgui.GSplitFrame; |
41 |
|
import jalview.jbgui.GStructureViewer; |
42 |
|
import jalview.structure.StructureSelectionManager; |
43 |
|
import jalview.urls.IdOrgSettings; |
44 |
|
import jalview.util.BrowserLauncher; |
45 |
|
import jalview.util.ImageMaker.TYPE; |
46 |
|
import jalview.util.MessageManager; |
47 |
|
import jalview.util.Platform; |
48 |
|
import jalview.util.UrlConstants; |
49 |
|
import jalview.util.dialogrunner.RunResponse; |
50 |
|
import jalview.viewmodel.AlignmentViewport; |
51 |
|
import jalview.ws.params.ParamManager; |
52 |
|
import jalview.ws.utils.UrlDownloadClient; |
53 |
|
|
54 |
|
import java.awt.BorderLayout; |
55 |
|
import java.awt.Color; |
56 |
|
import java.awt.Dimension; |
57 |
|
import java.awt.FontMetrics; |
58 |
|
import java.awt.Graphics; |
59 |
|
import java.awt.GridLayout; |
60 |
|
import java.awt.Point; |
61 |
|
import java.awt.Rectangle; |
62 |
|
import java.awt.Toolkit; |
63 |
|
import java.awt.Window; |
64 |
|
import java.awt.datatransfer.Clipboard; |
65 |
|
import java.awt.datatransfer.ClipboardOwner; |
66 |
|
import java.awt.datatransfer.DataFlavor; |
67 |
|
import java.awt.datatransfer.Transferable; |
68 |
|
import java.awt.dnd.DnDConstants; |
69 |
|
import java.awt.dnd.DropTargetDragEvent; |
70 |
|
import java.awt.dnd.DropTargetDropEvent; |
71 |
|
import java.awt.dnd.DropTargetEvent; |
72 |
|
import java.awt.dnd.DropTargetListener; |
73 |
|
import java.awt.event.ActionEvent; |
74 |
|
import java.awt.event.ActionListener; |
75 |
|
import java.awt.event.InputEvent; |
76 |
|
import java.awt.event.KeyEvent; |
77 |
|
import java.awt.event.MouseAdapter; |
78 |
|
import java.awt.event.MouseEvent; |
79 |
|
import java.awt.event.WindowAdapter; |
80 |
|
import java.awt.event.WindowEvent; |
81 |
|
import java.beans.PropertyChangeEvent; |
82 |
|
import java.beans.PropertyChangeListener; |
83 |
|
import java.io.BufferedInputStream; |
84 |
|
import java.io.File; |
85 |
|
import java.io.FileOutputStream; |
86 |
|
import java.io.IOException; |
87 |
|
import java.net.URL; |
88 |
|
import java.util.ArrayList; |
89 |
|
import java.util.Hashtable; |
90 |
|
import java.util.List; |
91 |
|
import java.util.ListIterator; |
92 |
|
import java.util.StringTokenizer; |
93 |
|
import java.util.Vector; |
94 |
|
import java.util.concurrent.ExecutorService; |
95 |
|
import java.util.concurrent.Executors; |
96 |
|
import java.util.concurrent.Semaphore; |
97 |
|
|
98 |
|
import javax.swing.AbstractAction; |
99 |
|
import javax.swing.Action; |
100 |
|
import javax.swing.ActionMap; |
101 |
|
import javax.swing.Box; |
102 |
|
import javax.swing.BoxLayout; |
103 |
|
import javax.swing.DefaultDesktopManager; |
104 |
|
import javax.swing.DesktopManager; |
105 |
|
import javax.swing.InputMap; |
106 |
|
import javax.swing.JButton; |
107 |
|
import javax.swing.JCheckBox; |
108 |
|
import javax.swing.JComboBox; |
109 |
|
import javax.swing.JComponent; |
110 |
|
import javax.swing.JDesktopPane; |
111 |
|
import javax.swing.JFrame; |
112 |
|
import javax.swing.JInternalFrame; |
113 |
|
import javax.swing.JLabel; |
114 |
|
import javax.swing.JMenuItem; |
115 |
|
import javax.swing.JPanel; |
116 |
|
import javax.swing.JPopupMenu; |
117 |
|
import javax.swing.JProgressBar; |
118 |
|
import javax.swing.JTextField; |
119 |
|
import javax.swing.KeyStroke; |
120 |
|
import javax.swing.SwingUtilities; |
121 |
|
import javax.swing.event.HyperlinkEvent; |
122 |
|
import javax.swing.event.HyperlinkEvent.EventType; |
123 |
|
import javax.swing.event.InternalFrameAdapter; |
124 |
|
import javax.swing.event.InternalFrameEvent; |
125 |
|
import javax.swing.event.MenuEvent; |
126 |
|
import javax.swing.event.MenuListener; |
127 |
|
|
128 |
|
import org.stackoverflowusers.file.WindowsShortcut; |
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
@author |
135 |
|
@version |
136 |
|
|
|
|
| 32.4% |
Uncovered Elements: 997 (1,474) |
Complexity: 384 |
Complexity Density: 0.4 |
|
137 |
|
public class Desktop extends jalview.jbgui.GDesktop |
138 |
|
implements DropTargetListener, ClipboardOwner, IProgressIndicator, |
139 |
|
jalview.api.StructureSelectionManagerProvider |
140 |
|
{ |
141 |
|
private static int DEFAULT_MIN_WIDTH = 300; |
142 |
|
|
143 |
|
private static int DEFAULT_MIN_HEIGHT = 250; |
144 |
|
|
145 |
|
private static int ALIGN_FRAME_DEFAULT_MIN_WIDTH = 600; |
146 |
|
|
147 |
|
private static int ALIGN_FRAME_DEFAULT_MIN_HEIGHT = 70; |
148 |
|
|
149 |
|
private static final String EXPERIMENTAL_FEATURES = "EXPERIMENTAL_FEATURES"; |
150 |
|
|
151 |
|
private JalviewChangeSupport changeSupport = new JalviewChangeSupport(); |
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
private BlogReader jvnews = null; |
157 |
|
|
158 |
|
private File projectFile; |
159 |
|
|
160 |
|
|
161 |
|
@param |
162 |
|
@see |
163 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
0 |
public void addJalviewPropertyChangeListener(... |
165 |
|
PropertyChangeListener listener) |
166 |
|
{ |
167 |
0 |
changeSupport.addJalviewPropertyChangeListener(listener); |
168 |
|
} |
169 |
|
|
170 |
|
|
171 |
|
@param |
172 |
|
@param |
173 |
|
@see |
174 |
|
|
175 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
176 |
190 |
public void addJalviewPropertyChangeListener(String propertyName,... |
177 |
|
PropertyChangeListener listener) |
178 |
|
{ |
179 |
190 |
changeSupport.addJalviewPropertyChangeListener(propertyName, listener); |
180 |
|
} |
181 |
|
|
182 |
|
|
183 |
|
@param |
184 |
|
@param |
185 |
|
@see |
186 |
|
|
187 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
188 |
96 |
public void removeJalviewPropertyChangeListener(String propertyName,... |
189 |
|
PropertyChangeListener listener) |
190 |
|
{ |
191 |
96 |
changeSupport.removeJalviewPropertyChangeListener(propertyName, |
192 |
|
listener); |
193 |
|
} |
194 |
|
|
195 |
|
|
196 |
|
public static Desktop instance; |
197 |
|
|
198 |
|
public static MyDesktopPane desktop; |
199 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
200 |
0 |
public static MyDesktopPane getDesktop()... |
201 |
|
{ |
202 |
|
|
203 |
|
|
204 |
0 |
return desktop; |
205 |
|
} |
206 |
|
|
207 |
|
static int openFrameCount = 0; |
208 |
|
|
209 |
|
static final int xOffset = 30; |
210 |
|
|
211 |
|
static final int yOffset = 30; |
212 |
|
|
213 |
|
public static jalview.ws.jws1.Discoverer discoverer; |
214 |
|
|
215 |
|
public static Object[] jalviewClipboard; |
216 |
|
|
217 |
|
public static boolean internalCopy = false; |
218 |
|
|
219 |
|
static int fileLoadingCount = 0; |
220 |
|
|
|
|
| 20% |
Uncovered Elements: 36 (45) |
Complexity: 19 |
Complexity Density: 0.76 |
|
221 |
|
class MyDesktopManager implements DesktopManager |
222 |
|
{ |
223 |
|
|
224 |
|
private DesktopManager delegate; |
225 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
226 |
11 |
public MyDesktopManager(DesktopManager delegate)... |
227 |
|
{ |
228 |
11 |
this.delegate = delegate; |
229 |
|
} |
230 |
|
|
|
|
| 50% |
Uncovered Elements: 2 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
231 |
290 |
@Override... |
232 |
|
public void activateFrame(JInternalFrame f) |
233 |
|
{ |
234 |
290 |
try |
235 |
|
{ |
236 |
290 |
delegate.activateFrame(f); |
237 |
|
} catch (NullPointerException npe) |
238 |
|
{ |
239 |
0 |
Point p = getMousePosition(); |
240 |
0 |
instance.showPasteMenu(p.x, p.y); |
241 |
|
} |
242 |
|
} |
243 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
244 |
0 |
@Override... |
245 |
|
public void beginDraggingFrame(JComponent f) |
246 |
|
{ |
247 |
0 |
delegate.beginDraggingFrame(f); |
248 |
|
} |
249 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
250 |
0 |
@Override... |
251 |
|
public void beginResizingFrame(JComponent f, int direction) |
252 |
|
{ |
253 |
0 |
delegate.beginResizingFrame(f, direction); |
254 |
|
} |
255 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
256 |
145 |
@Override... |
257 |
|
public void closeFrame(JInternalFrame f) |
258 |
|
{ |
259 |
145 |
delegate.closeFrame(f); |
260 |
|
} |
261 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
262 |
281 |
@Override... |
263 |
|
public void deactivateFrame(JInternalFrame f) |
264 |
|
{ |
265 |
281 |
delegate.deactivateFrame(f); |
266 |
|
} |
267 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
268 |
0 |
@Override... |
269 |
|
public void deiconifyFrame(JInternalFrame f) |
270 |
|
{ |
271 |
0 |
delegate.deiconifyFrame(f); |
272 |
|
} |
273 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
274 |
0 |
@Override... |
275 |
|
public void dragFrame(JComponent f, int newX, int newY) |
276 |
|
{ |
277 |
0 |
if (newY < 0) |
278 |
|
{ |
279 |
0 |
newY = 0; |
280 |
|
} |
281 |
0 |
delegate.dragFrame(f, newX, newY); |
282 |
|
} |
283 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
284 |
0 |
@Override... |
285 |
|
public void endDraggingFrame(JComponent f) |
286 |
|
{ |
287 |
0 |
delegate.endDraggingFrame(f); |
288 |
0 |
desktop.repaint(); |
289 |
|
} |
290 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
291 |
0 |
@Override... |
292 |
|
public void endResizingFrame(JComponent f) |
293 |
|
{ |
294 |
0 |
delegate.endResizingFrame(f); |
295 |
0 |
desktop.repaint(); |
296 |
|
} |
297 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
298 |
0 |
@Override... |
299 |
|
public void iconifyFrame(JInternalFrame f) |
300 |
|
{ |
301 |
0 |
delegate.iconifyFrame(f); |
302 |
|
} |
303 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
304 |
0 |
@Override... |
305 |
|
public void maximizeFrame(JInternalFrame f) |
306 |
|
{ |
307 |
0 |
delegate.maximizeFrame(f); |
308 |
|
} |
309 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
310 |
0 |
@Override... |
311 |
|
public void minimizeFrame(JInternalFrame f) |
312 |
|
{ |
313 |
0 |
delegate.minimizeFrame(f); |
314 |
|
} |
315 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
316 |
0 |
@Override... |
317 |
|
public void openFrame(JInternalFrame f) |
318 |
|
{ |
319 |
0 |
delegate.openFrame(f); |
320 |
|
} |
321 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
322 |
0 |
@Override... |
323 |
|
public void resizeFrame(JComponent f, int newX, int newY, int newWidth, |
324 |
|
int newHeight) |
325 |
|
{ |
326 |
0 |
if (newY < 0) |
327 |
|
{ |
328 |
0 |
newY = 0; |
329 |
|
} |
330 |
0 |
delegate.resizeFrame(f, newX, newY, newWidth, newHeight); |
331 |
|
} |
332 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
333 |
0 |
@Override... |
334 |
|
public void setBoundsForFrame(JComponent f, int newX, int newY, |
335 |
|
int newWidth, int newHeight) |
336 |
|
{ |
337 |
0 |
delegate.setBoundsForFrame(f, newX, newY, newWidth, newHeight); |
338 |
|
} |
339 |
|
|
340 |
|
|
341 |
|
|
342 |
|
} |
343 |
|
|
344 |
|
|
345 |
|
|
346 |
|
|
|
|
| 91.8% |
Uncovered Elements: 4 (49) |
Complexity: 6 |
Complexity Density: 0.15 |
|
347 |
11 |
public Desktop()... |
348 |
|
{ |
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
353 |
11 |
instance = this; |
354 |
11 |
if (!Jalview.isJS()) |
355 |
|
{ |
356 |
11 |
doVamsasClientCheck(); |
357 |
|
} |
358 |
|
|
359 |
11 |
doConfigureStructurePrefs(); |
360 |
11 |
setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION")); |
361 |
11 |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
362 |
11 |
boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE", |
363 |
|
false); |
364 |
11 |
boolean showjconsole = jalview.bin.Cache.getDefault("SHOW_JAVA_CONSOLE", |
365 |
|
false); |
366 |
11 |
desktop = new MyDesktopPane(selmemusage); |
367 |
11 |
showMemusage.setSelected(selmemusage); |
368 |
11 |
desktop.setBackground(Color.white); |
369 |
11 |
getContentPane().setLayout(new BorderLayout()); |
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
11 |
getContentPane().add(desktop, BorderLayout.CENTER); |
375 |
11 |
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); |
376 |
|
|
377 |
|
|
378 |
|
|
379 |
11 |
desktop.setDesktopManager(new MyDesktopManager( |
380 |
11 |
(Platform.isWindows() ? new DefaultDesktopManager() |
381 |
11 |
: Platform.isAMac() |
382 |
|
? new AquaInternalFrameManager( |
383 |
|
desktop.getDesktopManager()) |
384 |
|
: desktop.getDesktopManager()))); |
385 |
|
|
386 |
11 |
Rectangle dims = getLastKnownDimensions(""); |
387 |
11 |
if (dims != null) |
388 |
|
{ |
389 |
7 |
setBounds(dims); |
390 |
|
} |
391 |
|
else |
392 |
|
{ |
393 |
4 |
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
394 |
4 |
int xPos = Math.max(5, (screenSize.width - 900) / 2); |
395 |
4 |
int yPos = Math.max(5, (screenSize.height - 650) / 2); |
396 |
4 |
setBounds(xPos, yPos, 900, 650); |
397 |
|
} |
398 |
|
|
399 |
11 |
boolean doFullLoad = true; |
400 |
|
|
401 |
11 |
if (doFullLoad) { |
402 |
|
|
403 |
11 |
jconsole = new Console(this, showjconsole); |
404 |
|
|
405 |
11 |
jconsole.setHeader("Jalview Version: " |
406 |
|
+ jalview.bin.Cache.getProperty("VERSION") + "\n" |
407 |
|
+ "Jalview Installation: " |
408 |
|
+ jalview.bin.Cache.getDefault("INSTALLATION", "unknown") |
409 |
|
+ "\n" + "Build Date: " |
410 |
|
+ jalview.bin.Cache.getDefault("BUILD_DATE", "unknown") + "\n" |
411 |
|
+ "Java version: " + System.getProperty("java.version") + "\n" |
412 |
|
+ System.getProperty("os.arch") + " " |
413 |
|
+ System.getProperty("os.name") + " " |
414 |
|
+ System.getProperty("os.version")); |
415 |
|
|
416 |
11 |
showConsole(showjconsole); |
417 |
|
|
418 |
11 |
showNews.setVisible(false); |
419 |
|
|
420 |
11 |
experimentalFeatures.setSelected(showExperimental()); |
421 |
|
|
422 |
11 |
getIdentifiersOrgData(); |
423 |
|
|
424 |
11 |
checkURLLinks(); |
425 |
|
|
426 |
|
|
427 |
|
|
428 |
11 |
SwingUtilities.invokeLater(new Runnable() |
429 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
430 |
11 |
@Override... |
431 |
|
public void run() |
432 |
|
{ |
433 |
11 |
new SplashScreen(); |
434 |
|
} |
435 |
|
}); |
436 |
|
|
437 |
|
|
438 |
|
|
439 |
11 |
new Thread(new Runnable() |
440 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
441 |
11 |
@Override... |
442 |
|
public void run() |
443 |
|
{ |
444 |
11 |
Cache.log.debug("Filechooser init thread started."); |
445 |
11 |
String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); |
446 |
11 |
JalviewFileChooser.forRead(Cache.getProperty("LAST_DIRECTORY"), |
447 |
|
fileFormat); |
448 |
11 |
Cache.log.debug("Filechooser init thread finished."); |
449 |
|
} |
450 |
|
}).start(); |
451 |
|
|
452 |
11 |
changeSupport.addJalviewPropertyChangeListener("services", |
453 |
|
new PropertyChangeListener() |
454 |
|
{ |
455 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
456 |
131 |
@Override... |
457 |
|
public void propertyChange(PropertyChangeEvent evt) |
458 |
|
{ |
459 |
131 |
Cache.log.debug("Firing service changed event for " |
460 |
|
+ evt.getNewValue()); |
461 |
131 |
JalviewServicesChanged(evt); |
462 |
|
} |
463 |
|
|
464 |
|
}); |
465 |
|
|
466 |
|
} |
467 |
|
|
468 |
11 |
this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this)); |
469 |
|
|
470 |
11 |
this.addWindowListener(new WindowAdapter() |
471 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
472 |
0 |
@Override... |
473 |
|
public void windowClosing(WindowEvent evt) |
474 |
|
{ |
475 |
0 |
quit(); |
476 |
|
} |
477 |
|
}); |
478 |
|
|
479 |
11 |
MouseAdapter ma; |
480 |
11 |
this.addMouseListener(ma = new MouseAdapter() |
481 |
|
{ |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
482 |
0 |
@Override... |
483 |
|
public void mousePressed(MouseEvent evt) |
484 |
|
{ |
485 |
0 |
if (evt.isPopupTrigger()) |
486 |
|
{ |
487 |
0 |
showPasteMenu(evt.getX(), evt.getY()); |
488 |
|
} |
489 |
|
} |
490 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
491 |
0 |
@Override... |
492 |
|
public void mouseReleased(MouseEvent evt) |
493 |
|
{ |
494 |
0 |
if (evt.isPopupTrigger()) |
495 |
|
{ |
496 |
0 |
showPasteMenu(evt.getX(), evt.getY()); |
497 |
|
} |
498 |
|
} |
499 |
|
}); |
500 |
11 |
desktop.addMouseListener(ma); |
501 |
|
|
502 |
|
} |
503 |
|
|
504 |
|
|
505 |
|
|
506 |
|
|
507 |
|
|
508 |
|
@return |
509 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
510 |
11 |
public boolean showExperimental()... |
511 |
|
{ |
512 |
11 |
String experimental = Cache.getDefault(EXPERIMENTAL_FEATURES, |
513 |
|
Boolean.FALSE.toString()); |
514 |
11 |
return Boolean.valueOf(experimental).booleanValue(); |
515 |
|
} |
516 |
|
|
|
|
| 60% |
Uncovered Elements: 4 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
517 |
11 |
public void doConfigureStructurePrefs()... |
518 |
|
{ |
519 |
|
|
520 |
11 |
StructureSelectionManager ssm = StructureSelectionManager |
521 |
|
.getStructureSelectionManager(this); |
522 |
11 |
if (jalview.bin.Cache.getDefault(Preferences.ADD_SS_ANN, true)) |
523 |
|
{ |
524 |
11 |
ssm.setAddTempFacAnnot(jalview.bin.Cache |
525 |
|
.getDefault(Preferences.ADD_TEMPFACT_ANN, true)); |
526 |
11 |
ssm.setProcessSecondaryStructure(jalview.bin.Cache |
527 |
|
.getDefault(Preferences.STRUCT_FROM_PDB, true)); |
528 |
11 |
ssm.setSecStructServices( |
529 |
|
jalview.bin.Cache.getDefault(Preferences.USE_RNAVIEW, true)); |
530 |
|
} |
531 |
|
else |
532 |
|
{ |
533 |
0 |
ssm.setAddTempFacAnnot(false); |
534 |
0 |
ssm.setProcessSecondaryStructure(false); |
535 |
0 |
ssm.setSecStructServices(false); |
536 |
|
} |
537 |
|
} |
538 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
539 |
4 |
public void checkForNews()... |
540 |
|
{ |
541 |
4 |
final Desktop me = this; |
542 |
|
|
543 |
4 |
addDialogThread(new Runnable() |
544 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
545 |
3 |
@Override... |
546 |
|
public void run() |
547 |
|
{ |
548 |
3 |
Cache.log.debug("Starting news thread."); |
549 |
3 |
jvnews = new BlogReader(me); |
550 |
3 |
showNews.setVisible(true); |
551 |
3 |
Cache.log.debug("Completed news thread."); |
552 |
|
} |
553 |
|
}); |
554 |
|
} |
555 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
556 |
11 |
public void getIdentifiersOrgData()... |
557 |
|
{ |
558 |
|
|
559 |
11 |
addDialogThread(new Runnable() |
560 |
|
{ |
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
561 |
5 |
@Override... |
562 |
|
public void run() |
563 |
|
{ |
564 |
5 |
Cache.log.debug("Downloading data from identifiers.org"); |
565 |
5 |
UrlDownloadClient client = new UrlDownloadClient(); |
566 |
5 |
try |
567 |
|
{ |
568 |
5 |
client.download(IdOrgSettings.getUrl(), |
569 |
|
IdOrgSettings.getDownloadLocation()); |
570 |
|
} catch (IOException e) |
571 |
|
{ |
572 |
0 |
Cache.log.debug("Exception downloading identifiers.org data" |
573 |
|
+ e.getMessage()); |
574 |
|
} |
575 |
|
} |
576 |
|
}); |
577 |
|
} |
578 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
579 |
0 |
@Override... |
580 |
|
protected void showNews_actionPerformed(ActionEvent e) |
581 |
|
{ |
582 |
0 |
showNews(showNews.isSelected()); |
583 |
|
} |
584 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 4 |
Complexity Density: 1 |
|
585 |
0 |
void showNews(boolean visible)... |
586 |
|
{ |
587 |
0 |
Cache.log.debug((visible ? "Showing" : "Hiding") + " news."); |
588 |
0 |
showNews.setSelected(visible); |
589 |
0 |
if (visible && !jvnews.isVisible()) |
590 |
|
{ |
591 |
0 |
new Thread(new Runnable() |
592 |
|
{ |
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
593 |
0 |
@Override... |
594 |
|
public void run() |
595 |
|
{ |
596 |
0 |
long now = System.currentTimeMillis(); |
597 |
0 |
Desktop.instance.setProgressBar( |
598 |
|
MessageManager.getString("status.refreshing_news"), now); |
599 |
0 |
jvnews.refreshNews(); |
600 |
0 |
Desktop.instance.setProgressBar(null, now); |
601 |
0 |
jvnews.showNews(); |
602 |
|
} |
603 |
|
}).start(); |
604 |
|
} |
605 |
|
} |
606 |
|
|
607 |
|
|
608 |
|
|
609 |
|
|
610 |
|
@param |
611 |
|
|
612 |
|
@return |
613 |
|
|
614 |
|
|
|
|
| 77.4% |
Uncovered Elements: 7 (31) |
Complexity: 8 |
Complexity Density: 0.35 |
|
615 |
22 |
Rectangle getLastKnownDimensions(String windowName)... |
616 |
|
{ |
617 |
|
|
618 |
22 |
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
619 |
22 |
String x = jalview.bin.Cache.getProperty(windowName + "SCREEN_X"); |
620 |
22 |
String y = jalview.bin.Cache.getProperty(windowName + "SCREEN_Y"); |
621 |
22 |
String width = jalview.bin.Cache |
622 |
|
.getProperty(windowName + "SCREEN_WIDTH"); |
623 |
22 |
String height = jalview.bin.Cache |
624 |
|
.getProperty(windowName + "SCREEN_HEIGHT"); |
625 |
22 |
if ((x != null) && (y != null) && (width != null) && (height != null)) |
626 |
|
{ |
627 |
14 |
int ix = Integer.parseInt(x), iy = Integer.parseInt(y), |
628 |
|
iw = Integer.parseInt(width), ih = Integer.parseInt(height); |
629 |
14 |
if (jalview.bin.Cache.getProperty("SCREENGEOMETRY_WIDTH") != null) |
630 |
|
{ |
631 |
|
|
632 |
|
|
633 |
|
|
634 |
14 |
double sw = ((1f * screenSize.width) / (1f * Integer.parseInt( |
635 |
|
jalview.bin.Cache.getProperty("SCREENGEOMETRY_WIDTH")))); |
636 |
14 |
double sh = ((1f * screenSize.height) / (1f * Integer.parseInt( |
637 |
|
jalview.bin.Cache.getProperty("SCREENGEOMETRY_HEIGHT")))); |
638 |
|
|
639 |
14 |
ix = (int) (ix * sw); |
640 |
14 |
iw = (int) (iw * sw); |
641 |
14 |
iy = (int) (iy * sh); |
642 |
14 |
ih = (int) (ih * sh); |
643 |
14 |
while (ix >= screenSize.width) |
644 |
|
{ |
645 |
0 |
jalview.bin.Cache.log.debug( |
646 |
|
"Window geometry location recall error: shifting horizontal to within screenbounds."); |
647 |
0 |
ix -= screenSize.width; |
648 |
|
} |
649 |
14 |
while (iy >= screenSize.height) |
650 |
|
{ |
651 |
0 |
jalview.bin.Cache.log.debug( |
652 |
|
"Window geometry location recall error: shifting vertical to within screenbounds."); |
653 |
0 |
iy -= screenSize.height; |
654 |
|
} |
655 |
14 |
jalview.bin.Cache.log.debug( |
656 |
|
"Got last known dimensions for " + windowName + ": x:" + ix |
657 |
|
+ " y:" + iy + " width:" + iw + " height:" + ih); |
658 |
|
} |
659 |
|
|
660 |
14 |
return new Rectangle(ix, iy, iw, ih); |
661 |
|
} |
662 |
8 |
return null; |
663 |
|
} |
664 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
665 |
11 |
private void doVamsasClientCheck()... |
666 |
|
{ |
667 |
11 |
if (Cache.vamsasJarsPresent()) |
668 |
|
{ |
669 |
11 |
setupVamsasDisconnectedGui(); |
670 |
11 |
VamsasMenu.setVisible(true); |
671 |
11 |
final Desktop us = this; |
672 |
11 |
VamsasMenu.addMenuListener(new MenuListener() |
673 |
|
{ |
674 |
|
|
675 |
|
|
676 |
|
|
677 |
|
boolean refresh = true; |
678 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
679 |
0 |
@Override... |
680 |
|
public void menuCanceled(MenuEvent e) |
681 |
|
{ |
682 |
0 |
refresh = true; |
683 |
|
} |
684 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
685 |
0 |
@Override... |
686 |
|
public void menuDeselected(MenuEvent e) |
687 |
|
{ |
688 |
0 |
refresh = true; |
689 |
|
} |
690 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
691 |
0 |
@Override... |
692 |
|
public void menuSelected(MenuEvent e) |
693 |
|
{ |
694 |
0 |
if (refresh) |
695 |
|
{ |
696 |
0 |
us.buildVamsasStMenu(); |
697 |
0 |
refresh = false; |
698 |
|
} |
699 |
|
} |
700 |
|
}); |
701 |
11 |
vamsasStart.setVisible(true); |
702 |
|
} |
703 |
|
} |
704 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
705 |
0 |
void showPasteMenu(int x, int y)... |
706 |
|
{ |
707 |
0 |
JPopupMenu popup = new JPopupMenu(); |
708 |
0 |
JMenuItem item = new JMenuItem( |
709 |
|
MessageManager.getString("label.paste_new_window")); |
710 |
0 |
item.addActionListener(new ActionListener() |
711 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
712 |
0 |
@Override... |
713 |
|
public void actionPerformed(ActionEvent evt) |
714 |
|
{ |
715 |
0 |
paste(); |
716 |
|
} |
717 |
|
}); |
718 |
|
|
719 |
0 |
popup.add(item); |
720 |
0 |
popup.show(this, x, y); |
721 |
|
} |
722 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.38 |
|
723 |
0 |
public void paste()... |
724 |
|
{ |
725 |
0 |
try |
726 |
|
{ |
727 |
0 |
Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard(); |
728 |
0 |
Transferable contents = c.getContents(this); |
729 |
|
|
730 |
0 |
if (contents != null) |
731 |
|
{ |
732 |
0 |
String file = (String) contents |
733 |
|
.getTransferData(DataFlavor.stringFlavor); |
734 |
|
|
735 |
0 |
FileFormatI format = new IdentifyFile().identify(file, |
736 |
|
DataSourceType.PASTE); |
737 |
|
|
738 |
0 |
new FileLoader().LoadFile(file, DataSourceType.PASTE, format); |
739 |
|
|
740 |
|
} |
741 |
|
} catch (Exception ex) |
742 |
|
{ |
743 |
0 |
System.out.println( |
744 |
|
"Unable to paste alignment from system clipboard:\n" + ex); |
745 |
|
} |
746 |
|
} |
747 |
|
|
748 |
|
|
749 |
|
|
750 |
|
|
751 |
|
@param |
752 |
|
|
753 |
|
@param |
754 |
|
|
755 |
|
@param |
756 |
|
|
757 |
|
@param |
758 |
|
|
759 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
760 |
157 |
public static synchronized void addInternalFrame(... |
761 |
|
final JInternalFrame frame, String title, int w, int h) |
762 |
|
{ |
763 |
157 |
addInternalFrame(frame, title, true, w, h, true, false); |
764 |
|
} |
765 |
|
|
766 |
|
|
767 |
|
|
768 |
|
|
769 |
|
@param |
770 |
|
|
771 |
|
@param |
772 |
|
|
773 |
|
@param |
774 |
|
|
775 |
|
|
776 |
|
@param |
777 |
|
|
778 |
|
@param |
779 |
|
|
780 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
781 |
0 |
public static synchronized void addInternalFrame(... |
782 |
|
final JInternalFrame frame, String title, boolean makeVisible, |
783 |
|
int w, int h) |
784 |
|
{ |
785 |
0 |
addInternalFrame(frame, title, makeVisible, w, h, true, false); |
786 |
|
} |
787 |
|
|
788 |
|
|
789 |
|
|
790 |
|
|
791 |
|
@param |
792 |
|
|
793 |
|
@param |
794 |
|
|
795 |
|
@param |
796 |
|
|
797 |
|
@param |
798 |
|
|
799 |
|
@param |
800 |
|
|
801 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
802 |
17 |
public static synchronized void addInternalFrame(... |
803 |
|
final JInternalFrame frame, String title, int w, int h, |
804 |
|
boolean resizable) |
805 |
|
{ |
806 |
17 |
addInternalFrame(frame, title, true, w, h, resizable, false); |
807 |
|
} |
808 |
|
|
809 |
|
|
810 |
|
|
811 |
|
|
812 |
|
@param |
813 |
|
|
814 |
|
@param |
815 |
|
|
816 |
|
@param |
817 |
|
|
818 |
|
|
819 |
|
@param |
820 |
|
|
821 |
|
@param |
822 |
|
|
823 |
|
@param |
824 |
|
|
825 |
|
@param |
826 |
|
|
827 |
|
|
|
|
| 97.4% |
Uncovered Elements: 1 (39) |
Complexity: 12 |
Complexity Density: 0.41 |
|
828 |
190 |
public static synchronized void addInternalFrame(... |
829 |
|
final JInternalFrame frame, String title, boolean makeVisible, |
830 |
|
int w, int h, boolean resizable, boolean ignoreMinSize) |
831 |
|
{ |
832 |
|
|
833 |
|
|
834 |
|
|
835 |
|
|
836 |
|
|
837 |
|
|
838 |
190 |
frame.setTitle(title); |
839 |
190 |
if (frame.getWidth() < 1 || frame.getHeight() < 1) |
840 |
|
{ |
841 |
37 |
frame.setSize(w, h); |
842 |
|
} |
843 |
|
|
844 |
|
|
845 |
|
|
846 |
|
|
847 |
190 |
if (instance == null || (System.getProperty("java.awt.headless") != null |
848 |
|
&& System.getProperty("java.awt.headless").equals("true"))) |
849 |
|
{ |
850 |
1 |
return; |
851 |
|
} |
852 |
|
|
853 |
189 |
openFrameCount++; |
854 |
|
|
855 |
189 |
if (!ignoreMinSize) |
856 |
|
{ |
857 |
173 |
frame.setMinimumSize( |
858 |
|
new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT)); |
859 |
|
|
860 |
|
|
861 |
|
|
862 |
|
|
863 |
|
|
864 |
173 |
if (frame instanceof AlignFrame) |
865 |
|
{ |
866 |
130 |
frame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH, |
867 |
|
ALIGN_FRAME_DEFAULT_MIN_HEIGHT)); |
868 |
|
} |
869 |
|
} |
870 |
|
|
871 |
189 |
frame.setVisible(makeVisible); |
872 |
189 |
frame.setClosable(true); |
873 |
189 |
frame.setResizable(resizable); |
874 |
189 |
frame.setMaximizable(resizable); |
875 |
189 |
frame.setIconifiable(resizable); |
876 |
189 |
frame.setOpaque( |
877 |
|
false); |
878 |
|
|
879 |
189 |
if (frame.getX() < 1 && frame.getY() < 1) |
880 |
|
{ |
881 |
92 |
frame.setLocation(xOffset * openFrameCount, |
882 |
|
yOffset * ((openFrameCount - 1) % 10) + yOffset); |
883 |
|
} |
884 |
|
|
885 |
|
|
886 |
|
|
887 |
|
|
888 |
|
|
889 |
189 |
final JMenuItem menuItem = new JMenuItem(title); |
890 |
189 |
frame.addInternalFrameListener(new InternalFrameAdapter() |
891 |
|
{ |
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
892 |
274 |
@Override... |
893 |
|
public void internalFrameActivated(InternalFrameEvent evt) |
894 |
|
{ |
895 |
274 |
JInternalFrame itf = desktop.getSelectedFrame(); |
896 |
274 |
if (itf != null) |
897 |
|
{ |
898 |
274 |
if (itf instanceof AlignFrame) |
899 |
|
{ |
900 |
182 |
Jalview.setCurrentAlignFrame((AlignFrame) itf); |
901 |
|
} |
902 |
274 |
itf.requestFocus(); |
903 |
|
} |
904 |
|
} |
905 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
906 |
134 |
@Override... |
907 |
|
public void internalFrameClosed(InternalFrameEvent evt) |
908 |
|
{ |
909 |
134 |
PaintRefresher.RemoveComponent(frame); |
910 |
|
|
911 |
|
|
912 |
|
|
913 |
|
|
914 |
|
|
915 |
134 |
if (openFrameCount > 0) |
916 |
|
{ |
917 |
134 |
openFrameCount--; |
918 |
|
} |
919 |
|
|
920 |
|
|
921 |
|
|
922 |
|
|
923 |
134 |
if (menuItem.getActionListeners().length > 0) |
924 |
|
{ |
925 |
134 |
menuItem.removeActionListener(menuItem.getActionListeners()[0]); |
926 |
|
} |
927 |
134 |
windowMenu.remove(menuItem); |
928 |
|
}; |
929 |
|
}); |
930 |
|
|
931 |
189 |
menuItem.addActionListener(new ActionListener() |
932 |
|
{ |
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
933 |
0 |
@Override... |
934 |
|
public void actionPerformed(ActionEvent e) |
935 |
|
{ |
936 |
0 |
try |
937 |
|
{ |
938 |
0 |
frame.setSelected(true); |
939 |
0 |
frame.setIcon(false); |
940 |
|
} catch (java.beans.PropertyVetoException ex) |
941 |
|
{ |
942 |
|
|
943 |
|
} |
944 |
|
} |
945 |
|
}); |
946 |
|
|
947 |
189 |
setKeyBindings(frame); |
948 |
|
|
949 |
189 |
desktop.add(frame); |
950 |
|
|
951 |
189 |
windowMenu.add(menuItem); |
952 |
|
|
953 |
189 |
frame.toFront(); |
954 |
189 |
try |
955 |
|
{ |
956 |
189 |
frame.setSelected(true); |
957 |
189 |
frame.requestFocus(); |
958 |
|
} catch (java.beans.PropertyVetoException ve) |
959 |
|
{ |
960 |
|
} catch (java.lang.ClassCastException cex) |
961 |
|
{ |
962 |
0 |
Cache.log.warn( |
963 |
|
"Squashed a possible GUI implementation error. If you can recreate this, please look at http://issues.jalview.org/browse/JAL-869", |
964 |
|
cex); |
965 |
|
} |
966 |
|
} |
967 |
|
|
968 |
|
|
969 |
|
|
970 |
|
|
971 |
|
|
972 |
|
@param |
973 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
|
974 |
189 |
private static void setKeyBindings(JInternalFrame frame)... |
975 |
|
{ |
976 |
189 |
@SuppressWarnings("serial") |
977 |
|
final Action closeAction = new AbstractAction() |
978 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
979 |
0 |
@Override... |
980 |
|
public void actionPerformed(ActionEvent e) |
981 |
|
{ |
982 |
0 |
frame.dispose(); |
983 |
|
} |
984 |
|
}; |
985 |
|
|
986 |
|
|
987 |
|
|
988 |
|
|
989 |
189 |
KeyStroke ctrlWKey = KeyStroke.getKeyStroke(KeyEvent.VK_W, |
990 |
|
InputEvent.CTRL_DOWN_MASK); |
991 |
189 |
KeyStroke cmdWKey = KeyStroke.getKeyStroke(KeyEvent.VK_W, |
992 |
|
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); |
993 |
|
|
994 |
189 |
InputMap inputMap = frame |
995 |
|
.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); |
996 |
189 |
String ctrlW = ctrlWKey.toString(); |
997 |
189 |
inputMap.put(ctrlWKey, ctrlW); |
998 |
189 |
inputMap.put(cmdWKey, ctrlW); |
999 |
|
|
1000 |
189 |
ActionMap actionMap = frame.getActionMap(); |
1001 |
189 |
actionMap.put(ctrlW, closeAction); |
1002 |
|
} |
1003 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1004 |
0 |
@Override... |
1005 |
|
public void lostOwnership(Clipboard clipboard, Transferable contents) |
1006 |
|
{ |
1007 |
0 |
if (!internalCopy) |
1008 |
|
{ |
1009 |
0 |
Desktop.jalviewClipboard = null; |
1010 |
|
} |
1011 |
|
|
1012 |
0 |
internalCopy = false; |
1013 |
|
} |
1014 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1015 |
0 |
@Override... |
1016 |
|
public void dragEnter(DropTargetDragEvent evt) |
1017 |
|
{ |
1018 |
|
} |
1019 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1020 |
0 |
@Override... |
1021 |
|
public void dragExit(DropTargetEvent evt) |
1022 |
|
{ |
1023 |
|
} |
1024 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1025 |
0 |
@Override... |
1026 |
|
public void dragOver(DropTargetDragEvent evt) |
1027 |
|
{ |
1028 |
|
} |
1029 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1030 |
0 |
@Override... |
1031 |
|
public void dropActionChanged(DropTargetDragEvent evt) |
1032 |
|
{ |
1033 |
|
} |
1034 |
|
|
1035 |
|
|
1036 |
|
|
1037 |
|
|
1038 |
|
@param |
1039 |
|
|
1040 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 7 |
Complexity Density: 0.32 |
|
1041 |
0 |
@Override... |
1042 |
|
public void drop(DropTargetDropEvent evt) |
1043 |
|
{ |
1044 |
0 |
boolean success = true; |
1045 |
|
|
1046 |
|
|
1047 |
0 |
evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); |
1048 |
0 |
Transferable t = evt.getTransferable(); |
1049 |
0 |
List<Object> files = new ArrayList<>(); |
1050 |
0 |
List<DataSourceType> protocols = new ArrayList<>(); |
1051 |
|
|
1052 |
0 |
try |
1053 |
|
{ |
1054 |
0 |
Desktop.transferFromDropTarget(files, protocols, evt, t); |
1055 |
|
} catch (Exception e) |
1056 |
|
{ |
1057 |
0 |
e.printStackTrace(); |
1058 |
0 |
success = false; |
1059 |
|
} |
1060 |
|
|
1061 |
0 |
if (files != null) |
1062 |
|
{ |
1063 |
0 |
try |
1064 |
|
{ |
1065 |
0 |
for (int i = 0; i < files.size(); i++) |
1066 |
|
{ |
1067 |
|
|
1068 |
0 |
Object file = files.get(i); |
1069 |
0 |
String fileName = file.toString(); |
1070 |
0 |
DataSourceType protocol = (protocols == null) |
1071 |
|
? DataSourceType.FILE |
1072 |
|
: protocols.get(i); |
1073 |
0 |
FileFormatI format = null; |
1074 |
|
|
1075 |
0 |
if (fileName.endsWith(".jar")) |
1076 |
|
{ |
1077 |
0 |
format = FileFormat.Jalview; |
1078 |
|
|
1079 |
|
} |
1080 |
|
else |
1081 |
|
{ |
1082 |
0 |
format = new IdentifyFile().identify(file, protocol); |
1083 |
|
} |
1084 |
|
|
1085 |
0 |
new FileLoader().LoadFile(null, file, protocol, format); |
1086 |
|
|
1087 |
|
} |
1088 |
|
} catch (Exception ex) |
1089 |
|
{ |
1090 |
0 |
success = false; |
1091 |
|
} |
1092 |
|
} |
1093 |
0 |
evt.dropComplete(success); |
1094 |
|
|
1095 |
|
} |
1096 |
|
|
1097 |
|
|
1098 |
|
|
1099 |
|
|
1100 |
|
@param |
1101 |
|
|
1102 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
1103 |
0 |
@Override... |
1104 |
|
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport) |
1105 |
|
{ |
1106 |
0 |
String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); |
1107 |
0 |
JalviewFileChooser chooser = JalviewFileChooser |
1108 |
|
.forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat); |
1109 |
|
|
1110 |
0 |
chooser.setFileView(new JalviewFileView()); |
1111 |
0 |
chooser.setDialogTitle( |
1112 |
|
MessageManager.getString("label.open_local_file")); |
1113 |
0 |
chooser.setToolTipText(MessageManager.getString("action.open")); |
1114 |
|
|
1115 |
0 |
chooser.response(new RunResponse(JalviewFileChooser.APPROVE_OPTION) |
1116 |
|
{ |
1117 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
1118 |
0 |
@Override... |
1119 |
|
public void run() |
1120 |
|
{ |
1121 |
0 |
File selectedFile = chooser.getSelectedFile(); |
1122 |
0 |
Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent()); |
1123 |
|
|
1124 |
0 |
FileFormatI format = chooser.getSelectedFormat(); |
1125 |
|
|
1126 |
|
|
1127 |
|
|
1128 |
|
|
1129 |
|
|
1130 |
|
|
1131 |
0 |
if (FileFormats.getInstance().isIdentifiable(format)) |
1132 |
|
{ |
1133 |
0 |
try |
1134 |
|
{ |
1135 |
0 |
format = new IdentifyFile().identify(selectedFile, |
1136 |
|
DataSourceType.FILE); |
1137 |
|
} catch (FileFormatException e) |
1138 |
|
{ |
1139 |
|
|
1140 |
|
} |
1141 |
|
} |
1142 |
|
|
1143 |
0 |
new FileLoader().LoadFile(viewport, selectedFile, |
1144 |
|
DataSourceType.FILE, format); |
1145 |
|
} |
1146 |
|
}).openDialog(this); |
1147 |
|
} |
1148 |
|
|
1149 |
|
|
1150 |
|
|
1151 |
|
|
1152 |
|
@param |
1153 |
|
|
|
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 3 |
Complexity Density: 0.14 |
|
1154 |
0 |
@Override... |
1155 |
|
public void inputURLMenuItem_actionPerformed(AlignViewport viewport) |
1156 |
|
{ |
1157 |
|
|
1158 |
|
|
1159 |
0 |
JLabel label = new JLabel( |
1160 |
|
MessageManager.getString("label.input_file_url")); |
1161 |
|
|
1162 |
0 |
JPanel panel = new JPanel(new GridLayout(2, 1)); |
1163 |
0 |
panel.add(label); |
1164 |
|
|
1165 |
|
|
1166 |
|
|
1167 |
|
|
1168 |
|
|
1169 |
|
|
1170 |
0 |
JComponent history; |
1171 |
0 |
String urlBase = "http://www."; |
1172 |
0 |
if (Jalview.isJS()) |
1173 |
|
{ |
1174 |
0 |
history = new JTextField(urlBase, 35); |
1175 |
|
} |
1176 |
|
else |
1177 |
|
{ |
1178 |
0 |
JComboBox<String> asCombo = new JComboBox<>(); |
1179 |
0 |
asCombo.setPreferredSize(new Dimension(400, 20)); |
1180 |
0 |
asCombo.setEditable(true); |
1181 |
0 |
asCombo.addItem(urlBase); |
1182 |
0 |
String historyItems = Cache.getProperty("RECENT_URL"); |
1183 |
0 |
if (historyItems != null) |
1184 |
|
{ |
1185 |
0 |
for (String token : historyItems.split("\\t")) |
1186 |
|
{ |
1187 |
0 |
asCombo.addItem(token); |
1188 |
|
} |
1189 |
|
} |
1190 |
0 |
history = asCombo; |
1191 |
|
} |
1192 |
0 |
panel.add(history); |
1193 |
|
|
1194 |
0 |
Object[] options = new Object[] { MessageManager.getString("action.ok"), |
1195 |
|
MessageManager.getString("action.cancel") }; |
1196 |
0 |
RunResponse action = new RunResponse(JvOptionPane.OK_OPTION) { |
|
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 7 |
Complexity Density: 0.47 |
|
1197 |
0 |
@Override... |
1198 |
|
public void run() |
1199 |
|
{ |
1200 |
0 |
String url = Jalview.isJS() ? ((JTextField) history).getText() |
1201 |
|
: ((JComboBox<String>) history).getSelectedItem() |
1202 |
|
.toString(); |
1203 |
|
|
1204 |
0 |
if (url.toLowerCase().endsWith(".jar")) |
1205 |
|
{ |
1206 |
0 |
if (viewport != null) |
1207 |
|
{ |
1208 |
0 |
new FileLoader().LoadFile(viewport, url, DataSourceType.URL, |
1209 |
|
FileFormat.Jalview); |
1210 |
|
} |
1211 |
|
else |
1212 |
|
{ |
1213 |
0 |
new FileLoader().LoadFile(url, DataSourceType.URL, |
1214 |
|
FileFormat.Jalview); |
1215 |
|
} |
1216 |
|
} |
1217 |
|
else |
1218 |
|
{ |
1219 |
0 |
FileFormatI format = null; |
1220 |
0 |
try |
1221 |
|
{ |
1222 |
0 |
format = new IdentifyFile().identify(url, DataSourceType.URL); |
1223 |
|
} catch (FileFormatException e) |
1224 |
|
{ |
1225 |
|
|
1226 |
|
|
1227 |
|
} |
1228 |
|
|
1229 |
0 |
if (format == null) |
1230 |
|
{ |
1231 |
0 |
String msg = MessageManager.formatMessage("label.couldnt_locate", url); |
1232 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, msg, |
1233 |
|
MessageManager.getString("label.url_not_found"), |
1234 |
|
JvOptionPane.WARNING_MESSAGE); |
1235 |
|
|
1236 |
0 |
return; |
1237 |
|
} |
1238 |
|
|
1239 |
0 |
if (viewport != null) |
1240 |
|
{ |
1241 |
0 |
new FileLoader().LoadFile(viewport, url, DataSourceType.URL, |
1242 |
|
format); |
1243 |
|
} |
1244 |
|
else |
1245 |
|
{ |
1246 |
0 |
new FileLoader().LoadFile(url, DataSourceType.URL, format); |
1247 |
|
} |
1248 |
|
} |
1249 |
|
}}; |
1250 |
0 |
String dialogOption = MessageManager |
1251 |
|
.getString("label.input_alignment_from_url"); |
1252 |
0 |
JvOptionPane.newOptionDialog(desktop).response(action) |
1253 |
|
.showInternalDialog(panel, dialogOption, |
1254 |
|
JvOptionPane.YES_NO_CANCEL_OPTION, |
1255 |
|
JvOptionPane.PLAIN_MESSAGE, null, options, |
1256 |
|
MessageManager.getString("action.ok")); |
1257 |
|
} |
1258 |
|
|
1259 |
|
|
1260 |
|
|
1261 |
|
|
1262 |
|
@param |
1263 |
|
|
1264 |
|
|
1265 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
1266 |
0 |
@Override... |
1267 |
|
public void inputTextboxMenuItem_actionPerformed( |
1268 |
|
AlignmentViewPanel viewPanel) |
1269 |
|
{ |
1270 |
0 |
CutAndPasteTransfer cap = new CutAndPasteTransfer(); |
1271 |
0 |
cap.setForInput(viewPanel); |
1272 |
0 |
Desktop.addInternalFrame(cap, |
1273 |
|
MessageManager.getString("label.cut_paste_alignmen_file"), true, |
1274 |
|
600, 500); |
1275 |
|
} |
1276 |
|
|
1277 |
|
|
1278 |
|
|
1279 |
|
|
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 5 |
Complexity Density: 0.31 |
|
1280 |
0 |
@Override... |
1281 |
|
public void quit() |
1282 |
|
{ |
1283 |
0 |
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); |
1284 |
0 |
jalview.bin.Cache.setProperty("SCREENGEOMETRY_WIDTH", |
1285 |
|
screen.width + ""); |
1286 |
0 |
jalview.bin.Cache.setProperty("SCREENGEOMETRY_HEIGHT", |
1287 |
|
screen.height + ""); |
1288 |
0 |
storeLastKnownDimensions("", new Rectangle(getBounds().x, getBounds().y, |
1289 |
|
getWidth(), getHeight())); |
1290 |
|
|
1291 |
0 |
if (jconsole != null) |
1292 |
|
{ |
1293 |
0 |
storeLastKnownDimensions("JAVA_CONSOLE_", jconsole.getBounds()); |
1294 |
0 |
jconsole.stopConsole(); |
1295 |
|
} |
1296 |
0 |
if (jvnews != null) |
1297 |
|
{ |
1298 |
0 |
storeLastKnownDimensions("JALVIEW_RSS_WINDOW_", jvnews.getBounds()); |
1299 |
|
|
1300 |
|
} |
1301 |
0 |
if (dialogExecutor != null) |
1302 |
|
{ |
1303 |
0 |
dialogExecutor.shutdownNow(); |
1304 |
|
} |
1305 |
0 |
closeAll_actionPerformed(null); |
1306 |
|
|
1307 |
0 |
if (groovyConsole != null) |
1308 |
|
{ |
1309 |
|
|
1310 |
0 |
groovyConsole.setDirty(false); |
1311 |
0 |
groovyConsole.exit(); |
1312 |
|
} |
1313 |
0 |
System.exit(0); |
1314 |
|
} |
1315 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
1316 |
0 |
private void storeLastKnownDimensions(String string, Rectangle jc)... |
1317 |
|
{ |
1318 |
0 |
jalview.bin.Cache.log.debug("Storing last known dimensions for " |
1319 |
|
+ string + ": x:" + jc.x + " y:" + jc.y + " width:" + jc.width |
1320 |
|
+ " height:" + jc.height); |
1321 |
|
|
1322 |
0 |
jalview.bin.Cache.setProperty(string + "SCREEN_X", jc.x + ""); |
1323 |
0 |
jalview.bin.Cache.setProperty(string + "SCREEN_Y", jc.y + ""); |
1324 |
0 |
jalview.bin.Cache.setProperty(string + "SCREEN_WIDTH", jc.width + ""); |
1325 |
0 |
jalview.bin.Cache.setProperty(string + "SCREEN_HEIGHT", jc.height + ""); |
1326 |
|
} |
1327 |
|
|
1328 |
|
|
1329 |
|
|
1330 |
|
|
1331 |
|
@param |
1332 |
|
|
1333 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1334 |
0 |
@Override... |
1335 |
|
public void aboutMenuItem_actionPerformed(ActionEvent e) |
1336 |
|
{ |
1337 |
|
|
1338 |
|
|
1339 |
|
|
1340 |
|
|
1341 |
0 |
new Thread(new Runnable() |
1342 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1343 |
0 |
@Override... |
1344 |
|
public void run() |
1345 |
|
{ |
1346 |
0 |
new SplashScreen(true); |
1347 |
|
} |
1348 |
|
}).start(); |
1349 |
|
} |
1350 |
|
|
|
|
| 42.9% |
Uncovered Elements: 16 (28) |
Complexity: 6 |
Complexity Density: 0.33 |
|
1351 |
114 |
public StringBuffer getAboutMessage(boolean shortv)... |
1352 |
|
{ |
1353 |
114 |
StringBuffer message = new StringBuffer(); |
1354 |
114 |
message.append("<html>"); |
1355 |
114 |
if (shortv) |
1356 |
|
{ |
1357 |
114 |
message.append("<h1><strong>Version: " |
1358 |
|
+ jalview.bin.Cache.getProperty("VERSION") |
1359 |
|
+ "</strong></h1>"); |
1360 |
114 |
message.append("<strong>Last Updated: <em>" |
1361 |
|
+ jalview.bin.Cache.getDefault("BUILD_DATE", "unknown") |
1362 |
|
+ "</em></strong>"); |
1363 |
|
|
1364 |
|
} |
1365 |
|
else |
1366 |
|
{ |
1367 |
|
|
1368 |
0 |
message.append("<strong>Version " |
1369 |
|
+ jalview.bin.Cache.getProperty("VERSION") |
1370 |
|
+ "; last updated: " |
1371 |
|
+ jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")); |
1372 |
|
} |
1373 |
|
|
1374 |
114 |
if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking") |
1375 |
|
.equals("Checking")) |
1376 |
|
{ |
1377 |
0 |
message.append("<br>...Checking latest version...</br>"); |
1378 |
|
} |
1379 |
114 |
else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking") |
1380 |
|
.equals(jalview.bin.Cache.getProperty("VERSION"))) |
1381 |
|
{ |
1382 |
0 |
boolean red = false; |
1383 |
0 |
if (jalview.bin.Cache.getProperty("VERSION").toLowerCase() |
1384 |
|
.indexOf("automated build") == -1) |
1385 |
|
{ |
1386 |
0 |
red = true; |
1387 |
|
|
1388 |
|
|
1389 |
0 |
message.append("<div style=\"color: #FF0000;font-style: bold;\">"); |
1390 |
|
} |
1391 |
|
|
1392 |
0 |
message.append("<br>!! Version " |
1393 |
|
+ jalview.bin.Cache.getDefault("LATEST_VERSION", |
1394 |
|
"..Checking..") |
1395 |
|
+ " is available for download from " |
1396 |
|
+ jalview.bin.Cache.getDefault("www.jalview.org", |
1397 |
|
"http://www.jalview.org") |
1398 |
|
+ " !!"); |
1399 |
0 |
if (red) |
1400 |
|
{ |
1401 |
0 |
message.append("</div>"); |
1402 |
|
} |
1403 |
|
} |
1404 |
114 |
message.append("<br>Authors: " + jalview.bin.Cache.getDefault( |
1405 |
|
"AUTHORFNAMES", |
1406 |
|
"The Jalview Authors (See AUTHORS file for current list)") |
1407 |
|
+ "<br><br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>" |
1408 |
|
+ "<br><br>For help, see the FAQ at <a href=\"http://www.jalview.org/faq\">www.jalview.org/faq</a> and/or join the jalview-discuss@jalview.org mailing list" |
1409 |
|
+ "<br><br>If you use Jalview, please cite:" |
1410 |
|
+ "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)" |
1411 |
|
+ "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench" |
1412 |
|
+ "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033" |
1413 |
|
+ "</html>"); |
1414 |
113 |
return message; |
1415 |
|
} |
1416 |
|
|
1417 |
|
|
1418 |
|
|
1419 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
1420 |
0 |
@Override... |
1421 |
|
public void documentationMenuItem_actionPerformed() |
1422 |
|
{ |
1423 |
0 |
try |
1424 |
|
{ |
1425 |
0 |
if (Jalview.isJS()) |
1426 |
|
{ |
1427 |
0 |
BrowserLauncher.openURL("http://www.jalview.org/help.html"); |
1428 |
|
} |
1429 |
|
else |
1430 |
|
{ |
1431 |
0 |
Help.showHelpWindow(); |
1432 |
|
} |
1433 |
|
} catch (Exception ex) |
1434 |
|
{ |
1435 |
0 |
System.err.println("Error opening help: " + ex.getMessage()); |
1436 |
|
} |
1437 |
|
} |
1438 |
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (16) |
Complexity: 5 |
Complexity Density: 0.5 |
|
1439 |
20 |
@Override... |
1440 |
|
public void closeAll_actionPerformed(ActionEvent e) |
1441 |
|
{ |
1442 |
|
|
1443 |
20 |
JInternalFrame[] frames = desktop.getAllFrames(); |
1444 |
90 |
for (int i = 0; i < frames.length; i++) |
1445 |
|
{ |
1446 |
70 |
try |
1447 |
|
{ |
1448 |
70 |
frames[i].setClosed(true); |
1449 |
|
} catch (java.beans.PropertyVetoException ex) |
1450 |
|
{ |
1451 |
|
} |
1452 |
|
} |
1453 |
20 |
Jalview.setCurrentAlignFrame(null); |
1454 |
20 |
System.out.println("ALL CLOSED"); |
1455 |
20 |
if (v_client != null) |
1456 |
|
{ |
1457 |
|
|
1458 |
|
} |
1459 |
|
|
1460 |
|
|
1461 |
|
|
1462 |
|
|
1463 |
|
|
1464 |
20 |
StructureSelectionManager ssm = StructureSelectionManager |
1465 |
|
.getStructureSelectionManager(this); |
1466 |
20 |
if (ssm != null) |
1467 |
|
{ |
1468 |
20 |
ssm.resetAll(); |
1469 |
|
} |
1470 |
|
} |
1471 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1472 |
0 |
@Override... |
1473 |
|
public void raiseRelated_actionPerformed(ActionEvent e) |
1474 |
|
{ |
1475 |
0 |
reorderAssociatedWindows(false, false); |
1476 |
|
} |
1477 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1478 |
0 |
@Override... |
1479 |
|
public void minimizeAssociated_actionPerformed(ActionEvent e) |
1480 |
|
{ |
1481 |
0 |
reorderAssociatedWindows(true, false); |
1482 |
|
} |
1483 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1484 |
0 |
void closeAssociatedWindows()... |
1485 |
|
{ |
1486 |
0 |
reorderAssociatedWindows(false, true); |
1487 |
|
} |
1488 |
|
|
1489 |
|
|
1490 |
|
|
1491 |
|
|
1492 |
|
|
1493 |
|
|
1494 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
1495 |
0 |
@Override... |
1496 |
|
protected void garbageCollect_actionPerformed(ActionEvent e) |
1497 |
|
{ |
1498 |
|
|
1499 |
0 |
jalview.bin.Cache.log.debug("Collecting garbage..."); |
1500 |
0 |
System.gc(); |
1501 |
0 |
jalview.bin.Cache.log.debug("Finished garbage collection."); |
1502 |
|
} |
1503 |
|
|
1504 |
|
|
1505 |
|
|
1506 |
|
|
1507 |
|
@see |
1508 |
|
|
1509 |
|
|
1510 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1511 |
0 |
@Override... |
1512 |
|
protected void showMemusage_actionPerformed(ActionEvent e) |
1513 |
|
{ |
1514 |
0 |
desktop.showMemoryUsage(showMemusage.isSelected()); |
1515 |
|
} |
1516 |
|
|
1517 |
|
|
1518 |
|
|
1519 |
|
|
1520 |
|
@see |
1521 |
|
|
1522 |
|
|
1523 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1524 |
0 |
@Override... |
1525 |
|
protected void showConsole_actionPerformed(ActionEvent e) |
1526 |
|
{ |
1527 |
0 |
showConsole(showConsole.isSelected()); |
1528 |
|
} |
1529 |
|
|
1530 |
|
Console jconsole = null; |
1531 |
|
|
1532 |
|
|
1533 |
|
|
1534 |
|
|
1535 |
|
@param |
1536 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
1537 |
11 |
void showConsole(boolean selected)... |
1538 |
|
{ |
1539 |
|
|
1540 |
11 |
if (jconsole != null) |
1541 |
|
{ |
1542 |
11 |
showConsole.setSelected(selected); |
1543 |
11 |
Cache.setProperty("SHOW_JAVA_CONSOLE", |
1544 |
|
Boolean.valueOf(selected).toString()); |
1545 |
11 |
jconsole.setVisible(selected); |
1546 |
|
} |
1547 |
|
} |
1548 |
|
|
|
|
| 0% |
Uncovered Elements: 62 (62) |
Complexity: 18 |
Complexity Density: 0.56 |
|
1549 |
0 |
void reorderAssociatedWindows(boolean minimize, boolean close)... |
1550 |
|
{ |
1551 |
0 |
JInternalFrame[] frames = desktop.getAllFrames(); |
1552 |
0 |
if (frames == null || frames.length < 1) |
1553 |
|
{ |
1554 |
0 |
return; |
1555 |
|
} |
1556 |
|
|
1557 |
0 |
AlignmentViewport source = null, target = null; |
1558 |
0 |
if (frames[0] instanceof AlignFrame) |
1559 |
|
{ |
1560 |
0 |
source = ((AlignFrame) frames[0]).getCurrentView(); |
1561 |
|
} |
1562 |
0 |
else if (frames[0] instanceof TreePanel) |
1563 |
|
{ |
1564 |
0 |
source = ((TreePanel) frames[0]).getViewPort(); |
1565 |
|
} |
1566 |
0 |
else if (frames[0] instanceof PCAPanel) |
1567 |
|
{ |
1568 |
0 |
source = ((PCAPanel) frames[0]).av; |
1569 |
|
} |
1570 |
0 |
else if (frames[0].getContentPane() instanceof PairwiseAlignPanel) |
1571 |
|
{ |
1572 |
0 |
source = ((PairwiseAlignPanel) frames[0].getContentPane()).av; |
1573 |
|
} |
1574 |
|
|
1575 |
0 |
if (source != null) |
1576 |
|
{ |
1577 |
0 |
for (int i = 0; i < frames.length; i++) |
1578 |
|
{ |
1579 |
0 |
target = null; |
1580 |
0 |
if (frames[i] == null) |
1581 |
|
{ |
1582 |
0 |
continue; |
1583 |
|
} |
1584 |
0 |
if (frames[i] instanceof AlignFrame) |
1585 |
|
{ |
1586 |
0 |
target = ((AlignFrame) frames[i]).getCurrentView(); |
1587 |
|
} |
1588 |
0 |
else if (frames[i] instanceof TreePanel) |
1589 |
|
{ |
1590 |
0 |
target = ((TreePanel) frames[i]).getViewPort(); |
1591 |
|
} |
1592 |
0 |
else if (frames[i] instanceof PCAPanel) |
1593 |
|
{ |
1594 |
0 |
target = ((PCAPanel) frames[i]).av; |
1595 |
|
} |
1596 |
0 |
else if (frames[i].getContentPane() instanceof PairwiseAlignPanel) |
1597 |
|
{ |
1598 |
0 |
target = ((PairwiseAlignPanel) frames[i].getContentPane()).av; |
1599 |
|
} |
1600 |
|
|
1601 |
0 |
if (source == target) |
1602 |
|
{ |
1603 |
0 |
try |
1604 |
|
{ |
1605 |
0 |
if (close) |
1606 |
|
{ |
1607 |
0 |
frames[i].setClosed(true); |
1608 |
|
} |
1609 |
|
else |
1610 |
|
{ |
1611 |
0 |
frames[i].setIcon(minimize); |
1612 |
0 |
if (!minimize) |
1613 |
|
{ |
1614 |
0 |
frames[i].toFront(); |
1615 |
|
} |
1616 |
|
} |
1617 |
|
|
1618 |
|
} catch (java.beans.PropertyVetoException ex) |
1619 |
|
{ |
1620 |
|
} |
1621 |
|
} |
1622 |
|
} |
1623 |
|
} |
1624 |
|
} |
1625 |
|
|
1626 |
|
|
1627 |
|
|
1628 |
|
|
1629 |
|
@param |
1630 |
|
|
1631 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1632 |
0 |
@Override... |
1633 |
|
protected void preferences_actionPerformed(ActionEvent e) |
1634 |
|
{ |
1635 |
0 |
new Preferences(); |
1636 |
|
} |
1637 |
|
|
1638 |
|
|
1639 |
|
|
1640 |
|
|
1641 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
1642 |
0 |
@Override... |
1643 |
|
public void saveState_actionPerformed() |
1644 |
|
{ |
1645 |
0 |
JalviewFileChooser chooser = new JalviewFileChooser("jvp", |
1646 |
|
"Jalview Project"); |
1647 |
|
|
1648 |
0 |
chooser.setFileView(new JalviewFileView()); |
1649 |
0 |
chooser.setDialogTitle(MessageManager.getString("label.save_state")); |
1650 |
|
|
1651 |
0 |
int value = chooser.showSaveDialog(this); |
1652 |
|
|
1653 |
0 |
if (value == JalviewFileChooser.APPROVE_OPTION) |
1654 |
|
{ |
1655 |
0 |
final Desktop me = this; |
1656 |
0 |
final java.io.File choice = chooser.getSelectedFile(); |
1657 |
0 |
setProjectFile(choice); |
1658 |
|
|
1659 |
0 |
new Thread(new Runnable() |
1660 |
|
{ |
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.38 |
|
1661 |
0 |
@Override... |
1662 |
|
public void run() |
1663 |
|
{ |
1664 |
|
|
1665 |
0 |
setProgressBar(MessageManager.formatMessage( |
1666 |
|
"label.saving_jalview_project", new Object[] |
1667 |
|
{ choice.getName() }), choice.hashCode()); |
1668 |
0 |
jalview.bin.Cache.setProperty("LAST_DIRECTORY", |
1669 |
|
choice.getParent()); |
1670 |
|
|
1671 |
|
|
1672 |
0 |
try |
1673 |
|
{ |
1674 |
0 |
new Jalview2XML().saveState(choice); |
1675 |
|
} catch (OutOfMemoryError oom) |
1676 |
|
{ |
1677 |
0 |
new OOMWarning( |
1678 |
|
"Whilst saving current state to " + choice.getName(), |
1679 |
|
oom); |
1680 |
|
} catch (Exception ex) |
1681 |
|
{ |
1682 |
0 |
Cache.log.error( |
1683 |
|
"Problems whilst trying to save to " + choice.getName(), |
1684 |
|
ex); |
1685 |
0 |
JvOptionPane.showMessageDialog(me, |
1686 |
|
MessageManager.formatMessage( |
1687 |
|
"label.error_whilst_saving_current_state_to", |
1688 |
|
new Object[] |
1689 |
|
{ choice.getName() }), |
1690 |
|
MessageManager.getString("label.couldnt_save_project"), |
1691 |
|
JvOptionPane.WARNING_MESSAGE); |
1692 |
|
} |
1693 |
0 |
setProgressBar(null, choice.hashCode()); |
1694 |
|
} |
1695 |
|
}).start(); |
1696 |
|
} |
1697 |
|
} |
1698 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1699 |
0 |
private void setProjectFile(File choice)... |
1700 |
|
{ |
1701 |
0 |
this.projectFile = choice; |
1702 |
|
} |
1703 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1704 |
0 |
public File getProjectFile()... |
1705 |
|
{ |
1706 |
0 |
return this.projectFile; |
1707 |
|
} |
1708 |
|
|
1709 |
|
|
1710 |
|
|
1711 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 2 |
Complexity Density: 0.2 |
|
1712 |
0 |
@Override... |
1713 |
|
public void loadState_actionPerformed() |
1714 |
|
{ |
1715 |
0 |
JalviewFileChooser chooser = new JalviewFileChooser( |
1716 |
|
Cache.getProperty("LAST_DIRECTORY"), new String[] |
1717 |
|
{ "jvp", "jar" }, |
1718 |
|
new String[] |
1719 |
|
{ "Jalview Project", "Jalview Project (old)" }, |
1720 |
|
"Jalview Project"); |
1721 |
0 |
chooser.setFileView(new JalviewFileView()); |
1722 |
0 |
chooser.setDialogTitle(MessageManager.getString("label.restore_state")); |
1723 |
|
|
1724 |
0 |
int value = chooser.showOpenDialog(this); |
1725 |
|
|
1726 |
0 |
if (value == JalviewFileChooser.APPROVE_OPTION) |
1727 |
|
{ |
1728 |
0 |
final File selectedFile = chooser.getSelectedFile(); |
1729 |
0 |
setProjectFile(selectedFile); |
1730 |
0 |
final String choice = selectedFile.getAbsolutePath(); |
1731 |
0 |
Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent()); |
1732 |
0 |
new Thread(new Runnable() |
1733 |
|
{ |
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.43 |
|
1734 |
0 |
@Override... |
1735 |
|
public void run() |
1736 |
|
{ |
1737 |
0 |
setProgressBar(MessageManager.formatMessage( |
1738 |
|
"label.loading_jalview_project", new Object[] |
1739 |
|
{ choice }), choice.hashCode()); |
1740 |
0 |
try |
1741 |
|
{ |
1742 |
0 |
new Jalview2XML().loadJalviewAlign(choice); |
1743 |
|
} catch (OutOfMemoryError oom) |
1744 |
|
{ |
1745 |
0 |
new OOMWarning("Whilst loading project from " + choice, oom); |
1746 |
|
} catch (Exception ex) |
1747 |
|
{ |
1748 |
0 |
Cache.log.error( |
1749 |
|
"Problems whilst loading project from " + choice, ex); |
1750 |
0 |
JvOptionPane.showMessageDialog(Desktop.desktop, |
1751 |
|
MessageManager.formatMessage( |
1752 |
|
"label.error_whilst_loading_project_from", |
1753 |
|
new Object[] |
1754 |
|
{ choice }), |
1755 |
|
MessageManager.getString("label.couldnt_load_project"), |
1756 |
|
JvOptionPane.WARNING_MESSAGE); |
1757 |
|
} |
1758 |
0 |
setProgressBar(null, choice.hashCode()); |
1759 |
|
} |
1760 |
|
}).start(); |
1761 |
|
} |
1762 |
|
} |
1763 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1764 |
0 |
@Override... |
1765 |
|
public void inputSequence_actionPerformed(ActionEvent e) |
1766 |
|
{ |
1767 |
0 |
new SequenceFetcher(this); |
1768 |
|
} |
1769 |
|
|
1770 |
|
JPanel progressPanel; |
1771 |
|
|
1772 |
|
ArrayList<JPanel> fileLoadingPanels = new ArrayList<>(); |
1773 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1774 |
89 |
public void startLoading(final Object fileName)... |
1775 |
|
{ |
1776 |
89 |
if (fileLoadingCount == 0) |
1777 |
|
{ |
1778 |
89 |
fileLoadingPanels.add(addProgressPanel(MessageManager |
1779 |
|
.formatMessage("label.loading_file", new Object[] |
1780 |
|
{ fileName }))); |
1781 |
|
} |
1782 |
89 |
fileLoadingCount++; |
1783 |
|
} |
1784 |
|
|
|
|
| 93.8% |
Uncovered Elements: 1 (16) |
Complexity: 2 |
Complexity Density: 0.14 |
|
1785 |
89 |
private JPanel addProgressPanel(String string)... |
1786 |
|
{ |
1787 |
89 |
if (progressPanel == null) |
1788 |
|
{ |
1789 |
89 |
progressPanel = new JPanel(new GridLayout(1, 1)); |
1790 |
89 |
totalProgressCount = 0; |
1791 |
89 |
instance.getContentPane().add(progressPanel, BorderLayout.SOUTH); |
1792 |
|
} |
1793 |
89 |
JPanel thisprogress = new JPanel(new BorderLayout(10, 5)); |
1794 |
89 |
JProgressBar progressBar = new JProgressBar(); |
1795 |
89 |
progressBar.setIndeterminate(true); |
1796 |
|
|
1797 |
89 |
thisprogress.add(new JLabel(string), BorderLayout.WEST); |
1798 |
|
|
1799 |
89 |
thisprogress.add(progressBar, BorderLayout.CENTER); |
1800 |
89 |
progressPanel.add(thisprogress); |
1801 |
89 |
((GridLayout) progressPanel.getLayout()).setRows( |
1802 |
|
((GridLayout) progressPanel.getLayout()).getRows() + 1); |
1803 |
89 |
++totalProgressCount; |
1804 |
89 |
instance.validate(); |
1805 |
89 |
return thisprogress; |
1806 |
|
} |
1807 |
|
|
1808 |
|
int totalProgressCount = 0; |
1809 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 3 |
Complexity Density: 0.33 |
|
1810 |
89 |
private void removeProgressPanel(JPanel progbar)... |
1811 |
|
{ |
1812 |
89 |
if (progressPanel != null) |
1813 |
|
{ |
1814 |
89 |
synchronized (progressPanel) |
1815 |
|
{ |
1816 |
89 |
progressPanel.remove(progbar); |
1817 |
89 |
GridLayout gl = (GridLayout) progressPanel.getLayout(); |
1818 |
89 |
gl.setRows(gl.getRows() - 1); |
1819 |
89 |
if (--totalProgressCount < 1) |
1820 |
|
{ |
1821 |
89 |
this.getContentPane().remove(progressPanel); |
1822 |
89 |
progressPanel = null; |
1823 |
|
} |
1824 |
|
} |
1825 |
|
} |
1826 |
89 |
validate(); |
1827 |
|
} |
1828 |
|
|
|
|
| 90.9% |
Uncovered Elements: 1 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
1829 |
109 |
public void stopLoading()... |
1830 |
|
{ |
1831 |
109 |
fileLoadingCount--; |
1832 |
109 |
if (fileLoadingCount < 1) |
1833 |
|
{ |
1834 |
198 |
while (fileLoadingPanels.size() > 0) |
1835 |
|
{ |
1836 |
89 |
removeProgressPanel(fileLoadingPanels.remove(0)); |
1837 |
|
} |
1838 |
109 |
fileLoadingPanels.clear(); |
1839 |
109 |
fileLoadingCount = 0; |
1840 |
|
} |
1841 |
109 |
validate(); |
1842 |
|
} |
1843 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1844 |
3 |
public static int getViewCount(String alignmentId)... |
1845 |
|
{ |
1846 |
3 |
AlignmentViewport[] aps = getViewports(alignmentId); |
1847 |
3 |
return (aps == null) ? 0 : aps.length; |
1848 |
|
} |
1849 |
|
|
1850 |
|
|
1851 |
|
|
1852 |
|
@param |
1853 |
|
|
1854 |
|
@return |
1855 |
|
|
|
|
| 90.9% |
Uncovered Elements: 2 (22) |
Complexity: 6 |
Complexity Density: 0.43 |
|
1856 |
79 |
public static AlignmentPanel[] getAlignmentPanels(String alignmentId)... |
1857 |
|
{ |
1858 |
79 |
if (Desktop.desktop == null) |
1859 |
|
{ |
1860 |
|
|
1861 |
|
|
1862 |
0 |
return null; |
1863 |
|
} |
1864 |
79 |
List<AlignmentPanel> aps = new ArrayList<>(); |
1865 |
79 |
AlignFrame[] frames = getAlignFrames(); |
1866 |
79 |
if (frames == null) |
1867 |
|
{ |
1868 |
12 |
return null; |
1869 |
|
} |
1870 |
67 |
for (AlignFrame af : frames) |
1871 |
|
{ |
1872 |
203 |
for (AlignmentPanel ap : af.alignPanels) |
1873 |
|
{ |
1874 |
405 |
if (alignmentId == null |
1875 |
|
|| alignmentId.equals(ap.av.getSequenceSetId())) |
1876 |
|
{ |
1877 |
157 |
aps.add(ap); |
1878 |
|
} |
1879 |
|
} |
1880 |
|
} |
1881 |
67 |
if (aps.size() == 0) |
1882 |
|
{ |
1883 |
8 |
return null; |
1884 |
|
} |
1885 |
59 |
AlignmentPanel[] vap = aps.toArray(new AlignmentPanel[aps.size()]); |
1886 |
59 |
return vap; |
1887 |
|
} |
1888 |
|
|
1889 |
|
|
1890 |
|
|
1891 |
|
|
1892 |
|
@param |
1893 |
|
|
1894 |
|
|
1895 |
|
@return |
1896 |
|
|
|
|
| 69.6% |
Uncovered Elements: 7 (23) |
Complexity: 8 |
Complexity Density: 0.62 |
|
1897 |
3 |
public static AlignmentViewport[] getViewports(String sequenceSetId)... |
1898 |
|
{ |
1899 |
3 |
List<AlignmentViewport> viewp = new ArrayList<>(); |
1900 |
3 |
if (desktop != null) |
1901 |
|
{ |
1902 |
3 |
AlignFrame[] frames = Desktop.getAlignFrames(); |
1903 |
|
|
1904 |
3 |
for (AlignFrame afr : frames) |
1905 |
|
{ |
1906 |
3 |
if (sequenceSetId == null || afr.getViewport().getSequenceSetId() |
1907 |
|
.equals(sequenceSetId)) |
1908 |
|
{ |
1909 |
3 |
if (afr.alignPanels != null) |
1910 |
|
{ |
1911 |
3 |
for (AlignmentPanel ap : afr.alignPanels) |
1912 |
|
{ |
1913 |
3 |
if (sequenceSetId == null |
1914 |
|
|| sequenceSetId.equals(ap.av.getSequenceSetId())) |
1915 |
|
{ |
1916 |
3 |
viewp.add(ap.av); |
1917 |
|
} |
1918 |
|
} |
1919 |
|
} |
1920 |
|
else |
1921 |
|
{ |
1922 |
0 |
viewp.add(afr.getViewport()); |
1923 |
|
} |
1924 |
|
} |
1925 |
|
} |
1926 |
3 |
if (viewp.size() > 0) |
1927 |
|
{ |
1928 |
3 |
return viewp.toArray(new AlignmentViewport[viewp.size()]); |
1929 |
|
} |
1930 |
|
} |
1931 |
0 |
return null; |
1932 |
|
} |
1933 |
|
|
1934 |
|
|
1935 |
|
|
1936 |
|
|
1937 |
|
@param |
1938 |
|
|
|
|
| 84.2% |
Uncovered Elements: 3 (19) |
Complexity: 4 |
Complexity Density: 0.31 |
|
1939 |
1 |
public static void explodeViews(AlignFrame af)... |
1940 |
|
{ |
1941 |
1 |
int size = af.alignPanels.size(); |
1942 |
1 |
if (size < 2) |
1943 |
|
{ |
1944 |
0 |
return; |
1945 |
|
} |
1946 |
|
|
1947 |
6 |
for (int i = 0; i < size; i++) |
1948 |
|
{ |
1949 |
5 |
AlignmentPanel ap = af.alignPanels.get(i); |
1950 |
5 |
AlignFrame newaf = new AlignFrame(ap); |
1951 |
|
|
1952 |
|
|
1953 |
|
|
1954 |
|
|
1955 |
|
|
1956 |
|
|
1957 |
5 |
Rectangle geometry = ap.av.getExplodedGeometry(); |
1958 |
5 |
if (geometry != null) |
1959 |
|
{ |
1960 |
5 |
newaf.setBounds(geometry); |
1961 |
|
} |
1962 |
|
|
1963 |
5 |
ap.av.setGatherViewsHere(false); |
1964 |
|
|
1965 |
5 |
addInternalFrame(newaf, af.getTitle(), AlignFrame.DEFAULT_WIDTH, |
1966 |
|
AlignFrame.DEFAULT_HEIGHT); |
1967 |
|
} |
1968 |
|
|
1969 |
1 |
af.alignPanels.clear(); |
1970 |
1 |
af.closeMenuItem_actionPerformed(true); |
1971 |
|
|
1972 |
|
} |
1973 |
|
|
1974 |
|
|
1975 |
|
|
1976 |
|
|
1977 |
|
|
1978 |
|
|
1979 |
|
|
1980 |
|
@param |
1981 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (28) |
Complexity: 7 |
Complexity Density: 0.39 |
|
1982 |
12 |
public void gatherViews(AlignFrame source)... |
1983 |
|
{ |
1984 |
12 |
source.viewport.setGatherViewsHere(true); |
1985 |
12 |
source.viewport.setExplodedGeometry(source.getBounds()); |
1986 |
12 |
JInternalFrame[] frames = desktop.getAllFrames(); |
1987 |
12 |
String viewId = source.viewport.getSequenceSetId(); |
1988 |
|
|
1989 |
112 |
for (int t = 0; t < frames.length; t++) |
1990 |
|
{ |
1991 |
100 |
if (frames[t] instanceof AlignFrame && frames[t] != source) |
1992 |
|
{ |
1993 |
54 |
AlignFrame af = (AlignFrame) frames[t]; |
1994 |
54 |
boolean gatherThis = false; |
1995 |
136 |
for (int a = 0; a < af.alignPanels.size(); a++) |
1996 |
|
{ |
1997 |
82 |
AlignmentPanel ap = af.alignPanels.get(a); |
1998 |
82 |
if (viewId.equals(ap.av.getSequenceSetId())) |
1999 |
|
{ |
2000 |
45 |
gatherThis = true; |
2001 |
45 |
ap.av.setGatherViewsHere(false); |
2002 |
45 |
ap.av.setExplodedGeometry(af.getBounds()); |
2003 |
45 |
source.addAlignmentPanel(ap, false); |
2004 |
|
} |
2005 |
|
} |
2006 |
|
|
2007 |
54 |
if (gatherThis) |
2008 |
|
{ |
2009 |
45 |
af.alignPanels.clear(); |
2010 |
45 |
af.closeMenuItem_actionPerformed(true); |
2011 |
|
} |
2012 |
|
} |
2013 |
|
} |
2014 |
|
|
2015 |
|
} |
2016 |
|
|
2017 |
|
jalview.gui.VamsasApplication v_client = null; |
2018 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 4 |
Complexity Density: 0.36 |
|
2019 |
0 |
@Override... |
2020 |
|
public void vamsasImport_actionPerformed(ActionEvent e) |
2021 |
|
{ |
2022 |
|
|
2023 |
|
|
2024 |
0 |
if (v_client == null) |
2025 |
|
{ |
2026 |
|
|
2027 |
0 |
JalviewFileChooser chooser = new JalviewFileChooser( |
2028 |
|
jalview.bin.Cache.getProperty("LAST_DIRECTORY")); |
2029 |
|
|
2030 |
0 |
chooser.setFileView(new JalviewFileView()); |
2031 |
0 |
chooser.setDialogTitle( |
2032 |
|
MessageManager.getString("label.open_saved_vamsas_session")); |
2033 |
0 |
chooser.setToolTipText(MessageManager.getString( |
2034 |
|
"label.select_vamsas_session_opened_as_new_vamsas_session")); |
2035 |
|
|
2036 |
0 |
int value = chooser.showOpenDialog(this); |
2037 |
|
|
2038 |
0 |
if (value == JalviewFileChooser.APPROVE_OPTION) |
2039 |
|
{ |
2040 |
0 |
String fle = chooser.getSelectedFile().toString(); |
2041 |
0 |
if (!vamsasImport(chooser.getSelectedFile())) |
2042 |
|
{ |
2043 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, |
2044 |
|
MessageManager.formatMessage( |
2045 |
|
"label.couldnt_import_as_vamsas_session", |
2046 |
|
new Object[] |
2047 |
|
{ fle }), |
2048 |
|
MessageManager |
2049 |
|
.getString("label.vamsas_document_import_failed"), |
2050 |
|
JvOptionPane.ERROR_MESSAGE); |
2051 |
|
} |
2052 |
|
} |
2053 |
|
} |
2054 |
|
else |
2055 |
|
{ |
2056 |
0 |
jalview.bin.Cache.log.error( |
2057 |
|
"Implementation error - load session from a running session is not supported."); |
2058 |
|
} |
2059 |
|
} |
2060 |
|
|
2061 |
|
|
2062 |
|
|
2063 |
|
|
2064 |
|
@param |
2065 |
|
@return |
2066 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 4 |
Complexity Density: 0.21 |
|
2067 |
0 |
public boolean vamsasImport(URL url)... |
2068 |
|
{ |
2069 |
|
|
2070 |
0 |
if (v_client != null) |
2071 |
|
{ |
2072 |
|
|
2073 |
0 |
jalview.bin.Cache.log.error( |
2074 |
|
"Implementation error - load session from a running session is not supported."); |
2075 |
0 |
return false; |
2076 |
|
} |
2077 |
|
|
2078 |
0 |
try |
2079 |
|
{ |
2080 |
|
|
2081 |
|
|
2082 |
0 |
File file = File.createTempFile("vdocfromurl", ".vdj"); |
2083 |
0 |
FileOutputStream fos = new FileOutputStream(file); |
2084 |
0 |
BufferedInputStream bis = new BufferedInputStream(url.openStream()); |
2085 |
0 |
byte[] buffer = new byte[2048]; |
2086 |
0 |
int ln; |
2087 |
0 |
while ((ln = bis.read(buffer)) > -1) |
2088 |
|
{ |
2089 |
0 |
fos.write(buffer, 0, ln); |
2090 |
|
} |
2091 |
0 |
bis.close(); |
2092 |
0 |
fos.close(); |
2093 |
0 |
v_client = new jalview.gui.VamsasApplication(this, file, |
2094 |
|
url.toExternalForm()); |
2095 |
|
} catch (Exception ex) |
2096 |
|
{ |
2097 |
0 |
jalview.bin.Cache.log.error( |
2098 |
|
"Failed to create new vamsas session from contents of URL " |
2099 |
|
+ url, |
2100 |
|
ex); |
2101 |
0 |
return false; |
2102 |
|
} |
2103 |
0 |
setupVamsasConnectedGui(); |
2104 |
0 |
v_client.initial_update(); |
2105 |
0 |
return v_client.inSession(); |
2106 |
|
} |
2107 |
|
|
2108 |
|
|
2109 |
|
|
2110 |
|
|
2111 |
|
@param |
2112 |
|
@return |
2113 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 3 |
Complexity Density: 0.23 |
|
2114 |
0 |
public boolean vamsasImport(File file)... |
2115 |
|
{ |
2116 |
0 |
if (v_client != null) |
2117 |
|
{ |
2118 |
|
|
2119 |
0 |
jalview.bin.Cache.log.error( |
2120 |
|
"Implementation error - load session from a running session is not supported."); |
2121 |
0 |
return false; |
2122 |
|
} |
2123 |
|
|
2124 |
0 |
setProgressBar(MessageManager.formatMessage( |
2125 |
|
"status.importing_vamsas_session_from", new Object[] |
2126 |
|
{ file.getName() }), file.hashCode()); |
2127 |
0 |
try |
2128 |
|
{ |
2129 |
0 |
v_client = new jalview.gui.VamsasApplication(this, file, null); |
2130 |
|
} catch (Exception ex) |
2131 |
|
{ |
2132 |
0 |
setProgressBar(MessageManager.formatMessage( |
2133 |
|
"status.importing_vamsas_session_from", new Object[] |
2134 |
|
{ file.getName() }), file.hashCode()); |
2135 |
0 |
jalview.bin.Cache.log.error( |
2136 |
|
"New vamsas session from existing session file failed:", ex); |
2137 |
0 |
return false; |
2138 |
|
} |
2139 |
0 |
setupVamsasConnectedGui(); |
2140 |
0 |
v_client.initial_update(); |
2141 |
0 |
setProgressBar(MessageManager.formatMessage( |
2142 |
|
"status.importing_vamsas_session_from", new Object[] |
2143 |
|
{ file.getName() }), file.hashCode()); |
2144 |
0 |
return v_client.inSession(); |
2145 |
|
} |
2146 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
2147 |
0 |
public boolean joinVamsasSession(String mysesid)... |
2148 |
|
{ |
2149 |
0 |
if (v_client != null) |
2150 |
|
{ |
2151 |
0 |
throw new Error(MessageManager |
2152 |
|
.getString("error.try_join_vamsas_session_another")); |
2153 |
|
} |
2154 |
0 |
if (mysesid == null) |
2155 |
|
{ |
2156 |
0 |
throw new Error( |
2157 |
|
MessageManager.getString("error.invalid_vamsas_session_id")); |
2158 |
|
} |
2159 |
0 |
v_client = new VamsasApplication(this, mysesid); |
2160 |
0 |
setupVamsasConnectedGui(); |
2161 |
0 |
v_client.initial_update(); |
2162 |
0 |
return (v_client.inSession()); |
2163 |
|
} |
2164 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
2165 |
0 |
@Override... |
2166 |
|
public void vamsasStart_actionPerformed(ActionEvent e) |
2167 |
|
{ |
2168 |
0 |
if (v_client == null) |
2169 |
|
{ |
2170 |
|
|
2171 |
|
|
2172 |
|
|
2173 |
|
|
2174 |
|
|
2175 |
|
|
2176 |
|
|
2177 |
|
|
2178 |
|
|
2179 |
|
|
2180 |
|
|
2181 |
|
|
2182 |
|
|
2183 |
|
|
2184 |
|
|
2185 |
0 |
v_client = new VamsasApplication(this); |
2186 |
0 |
setupVamsasConnectedGui(); |
2187 |
0 |
v_client.initial_update(); |
2188 |
|
} |
2189 |
|
else |
2190 |
|
{ |
2191 |
|
|
2192 |
0 |
v_client.push_update(); |
2193 |
|
} |
2194 |
|
} |
2195 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
2196 |
0 |
protected void setupVamsasConnectedGui()... |
2197 |
|
{ |
2198 |
0 |
vamsasStart.setText(MessageManager.getString("label.session_update")); |
2199 |
0 |
vamsasSave.setVisible(true); |
2200 |
0 |
vamsasStop.setVisible(true); |
2201 |
0 |
vamsasImport.setVisible(false); |
2202 |
|
|
2203 |
|
} |
2204 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
2205 |
11 |
protected void setupVamsasDisconnectedGui()... |
2206 |
|
{ |
2207 |
11 |
vamsasSave.setVisible(false); |
2208 |
11 |
vamsasStop.setVisible(false); |
2209 |
11 |
vamsasImport.setVisible(true); |
2210 |
11 |
vamsasStart |
2211 |
|
.setText(MessageManager.getString("label.new_vamsas_session")); |
2212 |
|
} |
2213 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
2214 |
0 |
@Override... |
2215 |
|
public void vamsasStop_actionPerformed(ActionEvent e) |
2216 |
|
{ |
2217 |
0 |
if (v_client != null) |
2218 |
|
{ |
2219 |
0 |
v_client.end_session(); |
2220 |
0 |
v_client = null; |
2221 |
0 |
setupVamsasDisconnectedGui(); |
2222 |
|
} |
2223 |
|
} |
2224 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 5 |
Complexity Density: 0.23 |
|
2225 |
0 |
protected void buildVamsasStMenu()... |
2226 |
|
{ |
2227 |
0 |
if (v_client == null) |
2228 |
|
{ |
2229 |
0 |
String[] sess = null; |
2230 |
0 |
try |
2231 |
|
{ |
2232 |
0 |
sess = VamsasApplication.getSessionList(); |
2233 |
|
} catch (Exception e) |
2234 |
|
{ |
2235 |
0 |
jalview.bin.Cache.log.warn("Problem getting current sessions list.", |
2236 |
|
e); |
2237 |
0 |
sess = null; |
2238 |
|
} |
2239 |
0 |
if (sess != null) |
2240 |
|
{ |
2241 |
0 |
jalview.bin.Cache.log.debug( |
2242 |
|
"Got current sessions list: " + sess.length + " entries."); |
2243 |
0 |
VamsasStMenu.removeAll(); |
2244 |
0 |
for (int i = 0; i < sess.length; i++) |
2245 |
|
{ |
2246 |
0 |
JMenuItem sessit = new JMenuItem(); |
2247 |
0 |
sessit.setText(sess[i]); |
2248 |
0 |
sessit.setToolTipText(MessageManager |
2249 |
|
.formatMessage("label.connect_to_session", new Object[] |
2250 |
|
{ sess[i] })); |
2251 |
0 |
final Desktop dsktp = this; |
2252 |
0 |
final String mysesid = sess[i]; |
2253 |
0 |
sessit.addActionListener(new ActionListener() |
2254 |
|
{ |
2255 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
2256 |
0 |
@Override... |
2257 |
|
public void actionPerformed(ActionEvent e) |
2258 |
|
{ |
2259 |
0 |
if (dsktp.v_client == null) |
2260 |
|
{ |
2261 |
0 |
Thread rthr = new Thread(new Runnable() |
2262 |
|
{ |
2263 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
2264 |
0 |
@Override... |
2265 |
|
public void run() |
2266 |
|
{ |
2267 |
0 |
dsktp.v_client = new VamsasApplication(dsktp, mysesid); |
2268 |
0 |
dsktp.setupVamsasConnectedGui(); |
2269 |
0 |
dsktp.v_client.initial_update(); |
2270 |
|
} |
2271 |
|
|
2272 |
|
}); |
2273 |
0 |
rthr.start(); |
2274 |
|
} |
2275 |
|
}; |
2276 |
|
}); |
2277 |
0 |
VamsasStMenu.add(sessit); |
2278 |
|
} |
2279 |
|
|
2280 |
0 |
VamsasStMenu.setVisible(sess.length > 0); |
2281 |
|
|
2282 |
|
} |
2283 |
|
else |
2284 |
|
{ |
2285 |
0 |
jalview.bin.Cache.log.debug("No current vamsas sessions."); |
2286 |
0 |
VamsasStMenu.removeAll(); |
2287 |
0 |
VamsasStMenu.setVisible(false); |
2288 |
|
} |
2289 |
|
} |
2290 |
|
else |
2291 |
|
{ |
2292 |
|
|
2293 |
0 |
VamsasStMenu.setVisible(false); |
2294 |
|
} |
2295 |
|
} |
2296 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 6 |
Complexity Density: 0.27 |
|
2297 |
0 |
@Override... |
2298 |
|
public void vamsasSave_actionPerformed(ActionEvent e) |
2299 |
|
{ |
2300 |
|
|
2301 |
|
|
2302 |
0 |
if (v_client != null) |
2303 |
|
{ |
2304 |
|
|
2305 |
0 |
JalviewFileChooser chooser = new JalviewFileChooser("vdj", |
2306 |
|
"Vamsas Document"); |
2307 |
|
|
2308 |
0 |
chooser.setFileView(new JalviewFileView()); |
2309 |
0 |
chooser.setDialogTitle(MessageManager |
2310 |
|
.getString("label.save_vamsas_document_archive")); |
2311 |
|
|
2312 |
0 |
int value = chooser.showSaveDialog(this); |
2313 |
|
|
2314 |
0 |
if (value == JalviewFileChooser.APPROVE_OPTION) |
2315 |
|
{ |
2316 |
0 |
java.io.File choice = chooser.getSelectedFile(); |
2317 |
0 |
JPanel progpanel = addProgressPanel(MessageManager |
2318 |
|
.formatMessage("label.saving_vamsas_doc", new Object[] |
2319 |
|
{ choice.getName() })); |
2320 |
0 |
Cache.setProperty("LAST_DIRECTORY", choice.getParent()); |
2321 |
0 |
String warnmsg = null; |
2322 |
0 |
String warnttl = null; |
2323 |
0 |
try |
2324 |
|
{ |
2325 |
0 |
v_client.vclient.storeDocument(choice); |
2326 |
|
} catch (Error ex) |
2327 |
|
{ |
2328 |
0 |
warnttl = "Serious Problem saving Vamsas Document"; |
2329 |
0 |
warnmsg = ex.toString(); |
2330 |
0 |
jalview.bin.Cache.log |
2331 |
|
.error("Error Whilst saving document to " + choice, ex); |
2332 |
|
|
2333 |
|
} catch (Exception ex) |
2334 |
|
{ |
2335 |
0 |
warnttl = "Problem saving Vamsas Document."; |
2336 |
0 |
warnmsg = ex.toString(); |
2337 |
0 |
jalview.bin.Cache.log.warn( |
2338 |
|
"Exception Whilst saving document to " + choice, ex); |
2339 |
|
|
2340 |
|
} |
2341 |
0 |
removeProgressPanel(progpanel); |
2342 |
0 |
if (warnmsg != null) |
2343 |
|
{ |
2344 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, |
2345 |
|
|
2346 |
|
warnmsg, warnttl, JvOptionPane.ERROR_MESSAGE); |
2347 |
|
} |
2348 |
|
} |
2349 |
|
} |
2350 |
|
} |
2351 |
|
|
2352 |
|
JPanel vamUpdate = null; |
2353 |
|
|
2354 |
|
|
2355 |
|
|
2356 |
|
|
2357 |
|
@param |
2358 |
|
|
2359 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
2360 |
0 |
public void setVamsasUpdate(boolean b)... |
2361 |
|
{ |
2362 |
0 |
Cache.log.debug("Setting gui for Vamsas update " |
2363 |
0 |
+ (b ? "in progress" : "finished")); |
2364 |
|
|
2365 |
0 |
if (vamUpdate != null) |
2366 |
|
{ |
2367 |
0 |
this.removeProgressPanel(vamUpdate); |
2368 |
|
} |
2369 |
0 |
if (b) |
2370 |
|
{ |
2371 |
0 |
vamUpdate = this.addProgressPanel( |
2372 |
|
MessageManager.getString("label.updating_vamsas_session")); |
2373 |
|
} |
2374 |
0 |
vamsasStart.setVisible(!b); |
2375 |
0 |
vamsasStop.setVisible(!b); |
2376 |
0 |
vamsasSave.setVisible(!b); |
2377 |
|
} |
2378 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2379 |
1 |
public JInternalFrame[] getAllFrames()... |
2380 |
|
{ |
2381 |
1 |
return desktop.getAllFrames(); |
2382 |
|
} |
2383 |
|
|
2384 |
|
|
2385 |
|
|
2386 |
|
|
2387 |
|
|
2388 |
|
@param |
2389 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
2390 |
4 |
public void checkForQuestionnaire(String url)... |
2391 |
|
{ |
2392 |
4 |
UserQuestionnaireCheck jvq = new UserQuestionnaireCheck(url); |
2393 |
|
|
2394 |
4 |
new Thread(jvq).start(); |
2395 |
|
} |
2396 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2397 |
11 |
public void checkURLLinks()... |
2398 |
|
{ |
2399 |
|
|
2400 |
11 |
addDialogThread(new Runnable() |
2401 |
|
{ |
|
|
| 40.5% |
Uncovered Elements: 22 (37) |
Complexity: 7 |
Complexity Density: 0.26 |
|
2402 |
5 |
@Override... |
2403 |
|
public void run() |
2404 |
|
{ |
2405 |
5 |
if (Cache.getDefault("CHECKURLLINKS", true)) |
2406 |
|
{ |
2407 |
|
|
2408 |
|
|
2409 |
5 |
List<String> links = Preferences.sequenceUrlLinks |
2410 |
|
.getLinksForMenu(); |
2411 |
|
|
2412 |
|
|
2413 |
|
|
2414 |
5 |
ListIterator<String> li = links.listIterator(); |
2415 |
5 |
boolean check = false; |
2416 |
5 |
List<JLabel> urls = new ArrayList<>(); |
2417 |
14 |
while (li.hasNext()) |
2418 |
|
{ |
2419 |
9 |
String link = li.next(); |
2420 |
9 |
if (link.contains(SEQUENCE_ID) |
2421 |
|
&& !UrlConstants.isDefaultString(link)) |
2422 |
|
{ |
2423 |
0 |
check = true; |
2424 |
0 |
int barPos = link.indexOf("|"); |
2425 |
0 |
String urlMsg = barPos == -1 ? link |
2426 |
|
: link.substring(0, barPos) + ": " |
2427 |
|
+ link.substring(barPos + 1); |
2428 |
0 |
urls.add(new JLabel(urlMsg)); |
2429 |
|
} |
2430 |
|
} |
2431 |
5 |
if (!check) |
2432 |
|
{ |
2433 |
5 |
return; |
2434 |
|
} |
2435 |
|
|
2436 |
|
|
2437 |
|
|
2438 |
0 |
JPanel msgPanel = new JPanel(); |
2439 |
0 |
msgPanel.setLayout(new BoxLayout(msgPanel, BoxLayout.PAGE_AXIS)); |
2440 |
0 |
msgPanel.add(Box.createVerticalGlue()); |
2441 |
0 |
JLabel msg = new JLabel(MessageManager |
2442 |
|
.getString("label.SEQUENCE_ID_for_DB_ACCESSION1")); |
2443 |
0 |
JLabel msg2 = new JLabel(MessageManager |
2444 |
|
.getString("label.SEQUENCE_ID_for_DB_ACCESSION2")); |
2445 |
0 |
msgPanel.add(msg); |
2446 |
0 |
for (JLabel url : urls) |
2447 |
|
{ |
2448 |
0 |
msgPanel.add(url); |
2449 |
|
} |
2450 |
0 |
msgPanel.add(msg2); |
2451 |
|
|
2452 |
0 |
final JCheckBox jcb = new JCheckBox( |
2453 |
|
MessageManager.getString("label.do_not_display_again")); |
2454 |
0 |
jcb.addActionListener(new ActionListener() |
2455 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
2456 |
0 |
@Override... |
2457 |
|
public void actionPerformed(ActionEvent e) |
2458 |
|
{ |
2459 |
|
|
2460 |
0 |
boolean showWarningAgain = !jcb.isSelected(); |
2461 |
0 |
Cache.setProperty("CHECKURLLINKS", |
2462 |
|
Boolean.valueOf(showWarningAgain).toString()); |
2463 |
|
} |
2464 |
|
}); |
2465 |
0 |
msgPanel.add(jcb); |
2466 |
|
|
2467 |
0 |
JvOptionPane.showMessageDialog(Desktop.desktop, msgPanel, |
2468 |
|
MessageManager |
2469 |
|
.getString("label.SEQUENCE_ID_no_longer_used"), |
2470 |
|
JvOptionPane.WARNING_MESSAGE); |
2471 |
|
} |
2472 |
|
} |
2473 |
|
}); |
2474 |
|
} |
2475 |
|
|
2476 |
|
|
2477 |
|
|
2478 |
|
|
2479 |
|
|
2480 |
|
@author |
2481 |
|
|
|
|
| 29.3% |
Uncovered Elements: 29 (41) |
Complexity: 13 |
Complexity Density: 0.5 |
|
2482 |
|
public class MyDesktopPane extends JDesktopPane |
2483 |
|
implements Runnable |
2484 |
|
{ |
2485 |
|
private static final float ONE_MB = 1048576f; |
2486 |
|
|
2487 |
|
boolean showMemoryUsage = false; |
2488 |
|
|
2489 |
|
Runtime runtime; |
2490 |
|
|
2491 |
|
java.text.NumberFormat df; |
2492 |
|
|
2493 |
|
float maxMemory, allocatedMemory, freeMemory, totalFreeMemory, |
2494 |
|
percentUsage; |
2495 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2496 |
11 |
public MyDesktopPane(boolean showMemoryUsage)... |
2497 |
|
{ |
2498 |
11 |
showMemoryUsage(showMemoryUsage); |
2499 |
|
} |
2500 |
|
|
|
|
| 57.1% |
Uncovered Elements: 3 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
2501 |
11 |
public void showMemoryUsage(boolean showMemory)... |
2502 |
|
{ |
2503 |
11 |
this.showMemoryUsage = showMemory; |
2504 |
11 |
if (showMemory) |
2505 |
|
{ |
2506 |
0 |
Thread worker = new Thread(this); |
2507 |
0 |
worker.start(); |
2508 |
|
} |
2509 |
11 |
repaint(); |
2510 |
|
} |
2511 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2512 |
177 |
public boolean isShowMemoryUsage()... |
2513 |
|
{ |
2514 |
177 |
return showMemoryUsage; |
2515 |
|
} |
2516 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 3 |
Complexity Density: 0.23 |
|
2517 |
0 |
@Override... |
2518 |
|
public void run() |
2519 |
|
{ |
2520 |
0 |
df = java.text.NumberFormat.getNumberInstance(); |
2521 |
0 |
df.setMaximumFractionDigits(2); |
2522 |
0 |
runtime = Runtime.getRuntime(); |
2523 |
|
|
2524 |
0 |
while (showMemoryUsage) |
2525 |
|
{ |
2526 |
0 |
try |
2527 |
|
{ |
2528 |
0 |
maxMemory = runtime.maxMemory() / ONE_MB; |
2529 |
0 |
allocatedMemory = runtime.totalMemory() / ONE_MB; |
2530 |
0 |
freeMemory = runtime.freeMemory() / ONE_MB; |
2531 |
0 |
totalFreeMemory = freeMemory + (maxMemory - allocatedMemory); |
2532 |
|
|
2533 |
0 |
percentUsage = (totalFreeMemory / maxMemory) * 100; |
2534 |
|
|
2535 |
|
|
2536 |
|
{ |
2537 |
|
|
2538 |
|
|
2539 |
|
|
2540 |
|
} |
2541 |
0 |
repaint(); |
2542 |
|
|
2543 |
0 |
Thread.sleep(3000); |
2544 |
|
} catch (Exception ex) |
2545 |
|
{ |
2546 |
0 |
ex.printStackTrace(); |
2547 |
|
} |
2548 |
|
} |
2549 |
|
} |
2550 |
|
|
|
|
| 16.7% |
Uncovered Elements: 10 (12) |
Complexity: 6 |
Complexity Density: 1 |
|
2551 |
480 |
@Override... |
2552 |
|
public void paintComponent(Graphics g) |
2553 |
|
{ |
2554 |
480 |
if (showMemoryUsage && g != null && df != null) |
2555 |
|
{ |
2556 |
0 |
if (percentUsage < 20) |
2557 |
|
{ |
2558 |
0 |
g.setColor(Color.red); |
2559 |
|
} |
2560 |
0 |
FontMetrics fm = g.getFontMetrics(); |
2561 |
0 |
if (fm != null) |
2562 |
|
{ |
2563 |
0 |
g.drawString(MessageManager.formatMessage("label.memory_stats", |
2564 |
|
new Object[] |
2565 |
|
{ df.format(totalFreeMemory), df.format(maxMemory), |
2566 |
|
df.format(percentUsage) }), |
2567 |
|
10, getHeight() - fm.getHeight()); |
2568 |
|
} |
2569 |
|
} |
2570 |
|
} |
2571 |
|
} |
2572 |
|
|
2573 |
|
|
2574 |
|
|
2575 |
|
|
2576 |
|
@return |
2577 |
|
|
|
|
| 60% |
Uncovered Elements: 14 (35) |
Complexity: 9 |
Complexity Density: 0.47 |
|
2578 |
104 |
public static AlignFrame[] getAlignFrames()... |
2579 |
|
{ |
2580 |
104 |
if (Jalview.isHeadlessMode()) |
2581 |
|
{ |
2582 |
|
|
2583 |
0 |
return new AlignFrame[] { Jalview.currentAlignFrame }; |
2584 |
|
} |
2585 |
|
|
2586 |
104 |
JInternalFrame[] frames = Desktop.desktop.getAllFrames(); |
2587 |
|
|
2588 |
104 |
if (frames == null) |
2589 |
|
{ |
2590 |
0 |
return null; |
2591 |
|
} |
2592 |
104 |
List<AlignFrame> avp = new ArrayList<>(); |
2593 |
|
|
2594 |
550 |
for (int i = frames.length - 1; i > -1; i--) |
2595 |
|
{ |
2596 |
446 |
if (frames[i] instanceof AlignFrame) |
2597 |
|
{ |
2598 |
247 |
avp.add((AlignFrame) frames[i]); |
2599 |
|
} |
2600 |
199 |
else if (frames[i] instanceof SplitFrame) |
2601 |
|
{ |
2602 |
|
|
2603 |
|
|
2604 |
|
|
2605 |
0 |
GSplitFrame sf = (GSplitFrame) frames[i]; |
2606 |
0 |
if (sf.getTopFrame() instanceof AlignFrame) |
2607 |
|
{ |
2608 |
0 |
avp.add((AlignFrame) sf.getTopFrame()); |
2609 |
|
} |
2610 |
0 |
if (sf.getBottomFrame() instanceof AlignFrame) |
2611 |
|
{ |
2612 |
0 |
avp.add((AlignFrame) sf.getBottomFrame()); |
2613 |
|
} |
2614 |
|
} |
2615 |
|
} |
2616 |
104 |
if (avp.size() == 0) |
2617 |
|
{ |
2618 |
16 |
return null; |
2619 |
|
} |
2620 |
88 |
AlignFrame afs[] = avp.toArray(new AlignFrame[avp.size()]); |
2621 |
88 |
return afs; |
2622 |
|
} |
2623 |
|
|
2624 |
|
|
2625 |
|
|
2626 |
|
|
2627 |
|
@return |
2628 |
|
|
|
|
| 0% |
Uncovered Elements: 20 (20) |
Complexity: 5 |
Complexity Density: 0.42 |
|
2629 |
0 |
public GStructureViewer[] getJmols()... |
2630 |
|
{ |
2631 |
0 |
JInternalFrame[] frames = Desktop.desktop.getAllFrames(); |
2632 |
|
|
2633 |
0 |
if (frames == null) |
2634 |
|
{ |
2635 |
0 |
return null; |
2636 |
|
} |
2637 |
0 |
List<GStructureViewer> avp = new ArrayList<>(); |
2638 |
|
|
2639 |
0 |
for (int i = frames.length - 1; i > -1; i--) |
2640 |
|
{ |
2641 |
0 |
if (frames[i] instanceof AppJmol) |
2642 |
|
{ |
2643 |
0 |
GStructureViewer af = (GStructureViewer) frames[i]; |
2644 |
0 |
avp.add(af); |
2645 |
|
} |
2646 |
|
} |
2647 |
0 |
if (avp.size() == 0) |
2648 |
|
{ |
2649 |
0 |
return null; |
2650 |
|
} |
2651 |
0 |
GStructureViewer afs[] = avp.toArray(new GStructureViewer[avp.size()]); |
2652 |
0 |
return afs; |
2653 |
|
} |
2654 |
|
|
2655 |
|
|
2656 |
|
|
2657 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
2658 |
0 |
@Override... |
2659 |
|
public void groovyShell_actionPerformed() |
2660 |
|
{ |
2661 |
0 |
try |
2662 |
|
{ |
2663 |
0 |
openGroovyConsole(); |
2664 |
|
} catch (Exception ex) |
2665 |
|
{ |
2666 |
0 |
jalview.bin.Cache.log.error("Groovy Shell Creation failed.", ex); |
2667 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, |
2668 |
|
|
2669 |
|
MessageManager.getString("label.couldnt_create_groovy_shell"), |
2670 |
|
MessageManager.getString("label.groovy_support_failed"), |
2671 |
|
JvOptionPane.ERROR_MESSAGE); |
2672 |
|
} |
2673 |
|
} |
2674 |
|
|
2675 |
|
|
2676 |
|
|
2677 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
2678 |
0 |
void openGroovyConsole()... |
2679 |
|
{ |
2680 |
0 |
if (groovyConsole == null) |
2681 |
|
{ |
2682 |
0 |
groovyConsole = new groovy.ui.Console(); |
2683 |
0 |
groovyConsole.setVariable("Jalview", this); |
2684 |
0 |
groovyConsole.run(); |
2685 |
|
|
2686 |
|
|
2687 |
|
|
2688 |
|
|
2689 |
|
|
2690 |
|
|
2691 |
|
|
2692 |
0 |
Window window = (Window) groovyConsole.getFrame(); |
2693 |
0 |
window.addWindowListener(new WindowAdapter() |
2694 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
2695 |
0 |
@Override... |
2696 |
|
public void windowClosed(WindowEvent e) |
2697 |
|
{ |
2698 |
|
|
2699 |
|
|
2700 |
|
|
2701 |
0 |
addQuitHandler(); |
2702 |
0 |
enableExecuteGroovy(false); |
2703 |
|
} |
2704 |
|
}); |
2705 |
|
} |
2706 |
|
|
2707 |
|
|
2708 |
|
|
2709 |
|
|
2710 |
0 |
((Window) groovyConsole.getFrame()).setVisible(true); |
2711 |
|
|
2712 |
|
|
2713 |
|
|
2714 |
|
|
2715 |
|
|
2716 |
0 |
enableExecuteGroovy(true); |
2717 |
|
} |
2718 |
|
|
2719 |
|
|
2720 |
|
|
2721 |
|
|
2722 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
2723 |
0 |
protected void addQuitHandler()... |
2724 |
|
{ |
2725 |
0 |
getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) |
2726 |
|
.put(KeyStroke.getKeyStroke(KeyEvent.VK_Q, |
2727 |
|
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), |
2728 |
|
"Quit"); |
2729 |
0 |
getRootPane().getActionMap().put("Quit", new AbstractAction() |
2730 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2731 |
0 |
@Override... |
2732 |
|
public void actionPerformed(ActionEvent e) |
2733 |
|
{ |
2734 |
0 |
quit(); |
2735 |
|
} |
2736 |
|
}); |
2737 |
|
} |
2738 |
|
|
2739 |
|
|
2740 |
|
|
2741 |
|
|
2742 |
|
@param |
2743 |
|
|
2744 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
2745 |
0 |
public void enableExecuteGroovy(boolean enabled)... |
2746 |
|
{ |
2747 |
|
|
2748 |
|
|
2749 |
|
|
2750 |
|
|
2751 |
0 |
groovyShell.setEnabled(!enabled); |
2752 |
|
|
2753 |
0 |
AlignFrame[] alignFrames = getAlignFrames(); |
2754 |
0 |
if (alignFrames != null) |
2755 |
|
{ |
2756 |
0 |
for (AlignFrame af : alignFrames) |
2757 |
|
{ |
2758 |
0 |
af.setGroovyEnabled(enabled); |
2759 |
|
} |
2760 |
|
} |
2761 |
|
} |
2762 |
|
|
2763 |
|
|
2764 |
|
|
2765 |
|
|
2766 |
|
private Hashtable<Long, JPanel> progressBars; |
2767 |
|
|
2768 |
|
private Hashtable<Long, IProgressIndicatorHandler> progressBarHandlers; |
2769 |
|
|
2770 |
|
|
2771 |
|
|
2772 |
|
|
2773 |
|
@see |
2774 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 4 |
Complexity Density: 0.44 |
|
2775 |
0 |
@Override... |
2776 |
|
public void setProgressBar(String message, long id) |
2777 |
|
{ |
2778 |
0 |
if (progressBars == null) |
2779 |
|
{ |
2780 |
0 |
progressBars = new Hashtable<>(); |
2781 |
0 |
progressBarHandlers = new Hashtable<>(); |
2782 |
|
} |
2783 |
|
|
2784 |
0 |
if (progressBars.get(new Long(id)) != null) |
2785 |
|
{ |
2786 |
0 |
JPanel panel = progressBars.remove(new Long(id)); |
2787 |
0 |
if (progressBarHandlers.contains(new Long(id))) |
2788 |
|
{ |
2789 |
0 |
progressBarHandlers.remove(new Long(id)); |
2790 |
|
} |
2791 |
0 |
removeProgressPanel(panel); |
2792 |
|
} |
2793 |
|
else |
2794 |
|
{ |
2795 |
0 |
progressBars.put(new Long(id), addProgressPanel(message)); |
2796 |
|
} |
2797 |
|
} |
2798 |
|
|
2799 |
|
|
2800 |
|
|
2801 |
|
|
2802 |
|
@see |
2803 |
|
|
2804 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.44 |
|
2805 |
0 |
@Override... |
2806 |
|
public void registerHandler(final long id, |
2807 |
|
final IProgressIndicatorHandler handler) |
2808 |
|
{ |
2809 |
0 |
if (progressBarHandlers == null |
2810 |
|
|| !progressBars.containsKey(new Long(id))) |
2811 |
|
{ |
2812 |
0 |
throw new Error(MessageManager.getString( |
2813 |
|
"error.call_setprogressbar_before_registering_handler")); |
2814 |
|
} |
2815 |
0 |
progressBarHandlers.put(new Long(id), handler); |
2816 |
0 |
final JPanel progressPanel = progressBars.get(new Long(id)); |
2817 |
0 |
if (handler.canCancel()) |
2818 |
|
{ |
2819 |
0 |
JButton cancel = new JButton( |
2820 |
|
MessageManager.getString("action.cancel")); |
2821 |
0 |
final IProgressIndicator us = this; |
2822 |
0 |
cancel.addActionListener(new ActionListener() |
2823 |
|
{ |
2824 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
2825 |
0 |
@Override... |
2826 |
|
public void actionPerformed(ActionEvent e) |
2827 |
|
{ |
2828 |
0 |
handler.cancelActivity(id); |
2829 |
0 |
us.setProgressBar(MessageManager |
2830 |
|
.formatMessage("label.cancelled_params", new Object[] |
2831 |
|
{ ((JLabel) progressPanel.getComponent(0)).getText() }), |
2832 |
|
id); |
2833 |
|
} |
2834 |
|
}); |
2835 |
0 |
progressPanel.add(cancel, BorderLayout.EAST); |
2836 |
|
} |
2837 |
|
} |
2838 |
|
|
2839 |
|
|
2840 |
|
|
2841 |
|
@return |
2842 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
2843 |
0 |
@Override... |
2844 |
|
public boolean operationInProgress() |
2845 |
|
{ |
2846 |
0 |
if (progressBars != null && progressBars.size() > 0) |
2847 |
|
{ |
2848 |
0 |
return true; |
2849 |
|
} |
2850 |
0 |
return false; |
2851 |
|
} |
2852 |
|
|
2853 |
|
|
2854 |
|
|
2855 |
|
|
2856 |
|
|
2857 |
|
@param |
2858 |
|
@return |
2859 |
|
|
|
|
| 66.7% |
Uncovered Elements: 4 (12) |
Complexity: 6 |
Complexity Density: 1 |
|
2860 |
1 |
public static AlignFrame getAlignFrameFor(AlignViewportI viewport)... |
2861 |
|
{ |
2862 |
1 |
if (desktop != null) |
2863 |
|
{ |
2864 |
1 |
AlignmentPanel[] aps = getAlignmentPanels( |
2865 |
|
viewport.getSequenceSetId()); |
2866 |
1 |
for (int panel = 0; aps != null && panel < aps.length; panel++) |
2867 |
|
{ |
2868 |
1 |
if (aps[panel] != null && aps[panel].av == viewport) |
2869 |
|
{ |
2870 |
1 |
return aps[panel].alignFrame; |
2871 |
|
} |
2872 |
|
} |
2873 |
|
} |
2874 |
0 |
return null; |
2875 |
|
} |
2876 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2877 |
0 |
public VamsasApplication getVamsasApplication()... |
2878 |
|
{ |
2879 |
0 |
return v_client; |
2880 |
|
|
2881 |
|
} |
2882 |
|
|
2883 |
|
|
2884 |
|
|
2885 |
|
|
2886 |
|
private boolean inBatchMode = false; |
2887 |
|
|
2888 |
|
|
2889 |
|
|
2890 |
|
|
2891 |
|
@return |
2892 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2893 |
0 |
public boolean isInBatchMode()... |
2894 |
|
{ |
2895 |
0 |
return inBatchMode; |
2896 |
|
} |
2897 |
|
|
2898 |
|
|
2899 |
|
|
2900 |
|
|
2901 |
|
@param |
2902 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2903 |
22 |
public void setInBatchMode(boolean inBatchMode)... |
2904 |
|
{ |
2905 |
22 |
this.inBatchMode = inBatchMode; |
2906 |
|
} |
2907 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2908 |
11 |
public void startServiceDiscovery()... |
2909 |
|
{ |
2910 |
11 |
startServiceDiscovery(false); |
2911 |
|
} |
2912 |
|
|
|
|
| 65.2% |
Uncovered Elements: 8 (23) |
Complexity: 6 |
Complexity Density: 0.4 |
|
2913 |
11 |
public void startServiceDiscovery(boolean blocking)... |
2914 |
|
{ |
2915 |
11 |
boolean alive = true; |
2916 |
11 |
Thread t0 = null, t1 = null, t2 = null; |
2917 |
|
|
2918 |
11 |
if (true) |
2919 |
|
{ |
2920 |
|
|
2921 |
11 |
if (discoverer == null) |
2922 |
|
{ |
2923 |
1 |
discoverer = new jalview.ws.jws1.Discoverer(); |
2924 |
|
|
2925 |
1 |
discoverer.addPropertyChangeListener(changeSupport); |
2926 |
|
} |
2927 |
|
|
2928 |
|
|
2929 |
11 |
(t0 = new Thread(discoverer)).start(); |
2930 |
|
} |
2931 |
|
|
2932 |
11 |
if (Cache.getDefault("SHOW_JWS2_SERVICES", true)) |
2933 |
|
{ |
2934 |
11 |
t2 = jalview.ws.jws2.Jws2Discoverer.getDiscoverer() |
2935 |
|
.startDiscoverer(changeSupport); |
2936 |
|
} |
2937 |
11 |
Thread t3 = null; |
2938 |
|
{ |
2939 |
|
|
2940 |
|
} |
2941 |
11 |
if (blocking) |
2942 |
|
{ |
2943 |
0 |
while (alive) |
2944 |
|
{ |
2945 |
0 |
try |
2946 |
|
{ |
2947 |
0 |
Thread.sleep(15); |
2948 |
|
} catch (Exception e) |
2949 |
|
{ |
2950 |
|
} |
2951 |
0 |
alive = (t1 != null && t1.isAlive()) || (t2 != null && t2.isAlive()) |
2952 |
|
|| (t3 != null && t3.isAlive()) |
2953 |
|
|| (t0 != null && t0.isAlive()); |
2954 |
|
} |
2955 |
|
} |
2956 |
|
} |
2957 |
|
|
2958 |
|
|
2959 |
|
|
2960 |
|
|
2961 |
|
@param |
2962 |
|
|
|
|
| 33.3% |
Uncovered Elements: 10 (15) |
Complexity: 6 |
Complexity Density: 0.86 |
|
2963 |
131 |
protected void JalviewServicesChanged(PropertyChangeEvent evt)... |
2964 |
|
{ |
2965 |
131 |
if (evt.getNewValue() == null || evt.getNewValue() instanceof Vector) |
2966 |
|
{ |
2967 |
131 |
final String ermsg = jalview.ws.jws2.Jws2Discoverer.getDiscoverer() |
2968 |
|
.getErrorMessages(); |
2969 |
131 |
if (ermsg != null) |
2970 |
|
{ |
2971 |
0 |
if (Cache.getDefault("SHOW_WSDISCOVERY_ERRORS", true)) |
2972 |
|
{ |
2973 |
0 |
if (serviceChangedDialog == null) |
2974 |
|
{ |
2975 |
|
|
2976 |
0 |
addDialogThread(serviceChangedDialog = new Runnable() |
2977 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
2978 |
0 |
@Override... |
2979 |
|
public void run() |
2980 |
|
{ |
2981 |
|
|
2982 |
|
|
2983 |
|
|
2984 |
|
|
2985 |
|
|
2986 |
|
|
2987 |
|
|
2988 |
|
|
2989 |
|
|
2990 |
|
|
2991 |
|
|
2992 |
|
|
2993 |
|
|
2994 |
|
|
2995 |
|
|
2996 |
|
|
2997 |
|
|
2998 |
|
|
2999 |
|
|
3000 |
|
|
3001 |
|
|
3002 |
|
|
3003 |
|
|
3004 |
|
|
3005 |
|
|
3006 |
0 |
JvOptionPane.showConfirmDialog(Desktop.desktop, |
3007 |
|
new JLabel("<html><table width=\"450\"><tr><td>" |
3008 |
|
+ ermsg + "</td></tr></table>" |
3009 |
|
+ "<p>It may be that you have invalid JABA URLs<br/>in your web service preferences," |
3010 |
|
+ "<br>or as a command-line argument, or mis-configured HTTP proxy settings.</p>" |
3011 |
|
+ "<p>Check the <em>Connections</em> and <em>Web services</em> tab<br/>of the" |
3012 |
|
+ " Tools->Preferences dialog box to change them.</p></html>"), |
3013 |
|
"Web Service Configuration Problem", |
3014 |
|
JvOptionPane.DEFAULT_OPTION, |
3015 |
|
JvOptionPane.ERROR_MESSAGE); |
3016 |
0 |
serviceChangedDialog = null; |
3017 |
|
|
3018 |
|
} |
3019 |
|
}); |
3020 |
|
} |
3021 |
|
} |
3022 |
|
else |
3023 |
|
{ |
3024 |
0 |
Cache.log.error( |
3025 |
|
"Errors reported by JABA discovery service. Check web services preferences.\n" |
3026 |
|
+ ermsg); |
3027 |
|
} |
3028 |
|
} |
3029 |
|
} |
3030 |
|
} |
3031 |
|
|
3032 |
|
private Runnable serviceChangedDialog = null; |
3033 |
|
|
3034 |
|
|
3035 |
|
|
3036 |
|
|
3037 |
|
|
3038 |
|
|
3039 |
|
@param |
3040 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3041 |
0 |
public static void showUrl(final String url)... |
3042 |
|
{ |
3043 |
0 |
showUrl(url, Desktop.instance); |
3044 |
|
} |
3045 |
|
|
3046 |
|
|
3047 |
|
|
3048 |
|
|
3049 |
|
@param |
3050 |
|
@param |
3051 |
|
|
3052 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3053 |
0 |
public static void showUrl(final String url,... |
3054 |
|
final IProgressIndicator progress) |
3055 |
|
{ |
3056 |
0 |
new Thread(new Runnable() |
3057 |
|
{ |
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
3058 |
0 |
@Override... |
3059 |
|
public void run() |
3060 |
|
{ |
3061 |
0 |
try |
3062 |
|
{ |
3063 |
0 |
if (progress != null) |
3064 |
|
{ |
3065 |
0 |
progress.setProgressBar(MessageManager |
3066 |
|
.formatMessage("status.opening_params", new Object[] |
3067 |
|
{ url }), this.hashCode()); |
3068 |
|
} |
3069 |
0 |
jalview.util.BrowserLauncher.openURL(url); |
3070 |
|
} catch (Exception ex) |
3071 |
|
{ |
3072 |
0 |
JvOptionPane.showInternalMessageDialog(Desktop.desktop, |
3073 |
|
MessageManager |
3074 |
|
.getString("label.web_browser_not_found_unix"), |
3075 |
|
MessageManager.getString("label.web_browser_not_found"), |
3076 |
|
JvOptionPane.WARNING_MESSAGE); |
3077 |
|
|
3078 |
0 |
ex.printStackTrace(); |
3079 |
|
} |
3080 |
0 |
if (progress != null) |
3081 |
|
{ |
3082 |
0 |
progress.setProgressBar(null, this.hashCode()); |
3083 |
|
} |
3084 |
|
} |
3085 |
|
}).start(); |
3086 |
|
} |
3087 |
|
|
3088 |
|
public static WsParamSetManager wsparamManager = null; |
3089 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
3090 |
132 |
public static ParamManager getUserParameterStore()... |
3091 |
|
{ |
3092 |
132 |
if (wsparamManager == null) |
3093 |
|
{ |
3094 |
1 |
wsparamManager = new WsParamSetManager(); |
3095 |
|
} |
3096 |
132 |
return wsparamManager; |
3097 |
|
} |
3098 |
|
|
3099 |
|
|
3100 |
|
|
3101 |
|
|
3102 |
|
@param |
3103 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
3104 |
0 |
public static void hyperlinkUpdate(HyperlinkEvent e)... |
3105 |
|
{ |
3106 |
0 |
if (e.getEventType() == EventType.ACTIVATED) |
3107 |
|
{ |
3108 |
0 |
String url = null; |
3109 |
0 |
try |
3110 |
|
{ |
3111 |
0 |
url = e.getURL().toString(); |
3112 |
0 |
Desktop.showUrl(url); |
3113 |
|
} catch (Exception x) |
3114 |
|
{ |
3115 |
0 |
if (url != null) |
3116 |
|
{ |
3117 |
0 |
if (Cache.log != null) |
3118 |
|
{ |
3119 |
0 |
Cache.log.error("Couldn't handle string " + url + " as a URL."); |
3120 |
|
} |
3121 |
|
else |
3122 |
|
{ |
3123 |
0 |
System.err.println( |
3124 |
|
"Couldn't handle string " + url + " as a URL."); |
3125 |
|
} |
3126 |
|
} |
3127 |
|
|
3128 |
|
} |
3129 |
|
|
3130 |
|
} |
3131 |
|
} |
3132 |
|
|
3133 |
|
|
3134 |
|
|
3135 |
|
|
3136 |
|
ExecutorService dialogExecutor = Executors.newSingleThreadExecutor(); |
3137 |
|
|
3138 |
|
|
3139 |
|
|
3140 |
|
|
3141 |
|
private volatile boolean dialogPause = true; |
3142 |
|
|
3143 |
|
|
3144 |
|
|
3145 |
|
|
3146 |
|
private java.util.concurrent.Semaphore block = new Semaphore(0); |
3147 |
|
|
3148 |
|
private static groovy.ui.Console groovyConsole; |
3149 |
|
|
3150 |
|
|
3151 |
|
|
3152 |
|
|
3153 |
|
@param |
3154 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3155 |
37 |
public void addDialogThread(final Runnable prompter)... |
3156 |
|
{ |
3157 |
37 |
dialogExecutor.submit(new Runnable() |
3158 |
|
{ |
|
|
| 76.9% |
Uncovered Elements: 3 (13) |
Complexity: 5 |
Complexity Density: 0.56 |
|
3159 |
24 |
@Override... |
3160 |
|
public void run() |
3161 |
|
{ |
3162 |
24 |
if (dialogPause) |
3163 |
|
{ |
3164 |
11 |
try |
3165 |
|
{ |
3166 |
11 |
block.acquire(); |
3167 |
|
} catch (InterruptedException x) |
3168 |
|
{ |
3169 |
|
} |
3170 |
5 |
; |
3171 |
|
} |
3172 |
18 |
if (instance == null) |
3173 |
|
{ |
3174 |
0 |
return; |
3175 |
|
} |
3176 |
18 |
try |
3177 |
|
{ |
3178 |
18 |
SwingUtilities.invokeAndWait(prompter); |
3179 |
|
} catch (Exception q) |
3180 |
|
{ |
3181 |
0 |
Cache.log.warn("Unexpected Exception in dialog thread.", q); |
3182 |
|
} |
3183 |
|
} |
3184 |
|
}); |
3185 |
|
} |
3186 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
3187 |
10 |
public void startDialogQueue()... |
3188 |
|
{ |
3189 |
|
|
3190 |
|
|
3191 |
10 |
dialogPause = false; |
3192 |
10 |
block.release(); |
3193 |
|
} |
3194 |
|
|
3195 |
|
|
3196 |
|
|
3197 |
|
|
3198 |
|
|
3199 |
|
|
3200 |
|
|
3201 |
|
|
3202 |
|
|
3203 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
3204 |
0 |
@Override... |
3205 |
|
protected void snapShotWindow_actionPerformed(ActionEvent e) |
3206 |
|
{ |
3207 |
|
|
3208 |
0 |
invalidate(); |
3209 |
|
|
3210 |
0 |
int width = getWidth(); |
3211 |
0 |
int height = getHeight(); |
3212 |
0 |
File of = new File( |
3213 |
|
"Jalview_snapshot_" + System.currentTimeMillis() + ".eps"); |
3214 |
0 |
ImageWriterI writer = new ImageWriterI() |
3215 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
3216 |
0 |
@Override... |
3217 |
|
public void exportImage(Graphics g) throws Exception |
3218 |
|
{ |
3219 |
0 |
paintAll(g); |
3220 |
0 |
Cache.log.info("Successfully written snapshot to file " |
3221 |
|
+ of.getAbsolutePath()); |
3222 |
|
} |
3223 |
|
}; |
3224 |
0 |
String title = "View of desktop"; |
3225 |
0 |
ImageExporter exporter = new ImageExporter(writer, null, TYPE.EPS, |
3226 |
|
title); |
3227 |
0 |
exporter.doExport(of, this, width, height, title); |
3228 |
|
} |
3229 |
|
|
3230 |
|
|
3231 |
|
|
3232 |
|
|
3233 |
|
|
3234 |
|
|
3235 |
|
|
3236 |
|
|
3237 |
|
@param |
3238 |
|
|
|
|
| 0% |
Uncovered Elements: 41 (41) |
Complexity: 6 |
Complexity Density: 0.19 |
|
3239 |
0 |
public void explodeViews(SplitFrame sf)... |
3240 |
|
{ |
3241 |
0 |
AlignFrame oldTopFrame = (AlignFrame) sf.getTopFrame(); |
3242 |
0 |
AlignFrame oldBottomFrame = (AlignFrame) sf.getBottomFrame(); |
3243 |
0 |
List<? extends AlignmentViewPanel> topPanels = oldTopFrame |
3244 |
|
.getAlignPanels(); |
3245 |
0 |
List<? extends AlignmentViewPanel> bottomPanels = oldBottomFrame |
3246 |
|
.getAlignPanels(); |
3247 |
0 |
int viewCount = topPanels.size(); |
3248 |
0 |
if (viewCount < 2) |
3249 |
|
{ |
3250 |
0 |
return; |
3251 |
|
} |
3252 |
|
|
3253 |
|
|
3254 |
|
|
3255 |
|
|
3256 |
|
|
3257 |
0 |
for (int i = viewCount - 1; i >= 0; i--) |
3258 |
|
{ |
3259 |
|
|
3260 |
|
|
3261 |
|
|
3262 |
|
|
3263 |
|
|
3264 |
|
|
3265 |
|
|
3266 |
|
|
3267 |
|
|
3268 |
0 |
AlignmentPanel topPanel = (AlignmentPanel) topPanels.get(i); |
3269 |
0 |
AlignFrame newTopFrame = new AlignFrame(topPanel); |
3270 |
0 |
newTopFrame.setSize(oldTopFrame.getSize()); |
3271 |
0 |
newTopFrame.setVisible(true); |
3272 |
0 |
Rectangle geometry = ((AlignViewport) topPanel.getAlignViewport()) |
3273 |
|
.getExplodedGeometry(); |
3274 |
0 |
if (geometry != null) |
3275 |
|
{ |
3276 |
0 |
newTopFrame.setSize(geometry.getSize()); |
3277 |
|
} |
3278 |
|
|
3279 |
0 |
AlignmentPanel bottomPanel = (AlignmentPanel) bottomPanels.get(i); |
3280 |
0 |
AlignFrame newBottomFrame = new AlignFrame(bottomPanel); |
3281 |
0 |
newBottomFrame.setSize(oldBottomFrame.getSize()); |
3282 |
0 |
newBottomFrame.setVisible(true); |
3283 |
0 |
geometry = ((AlignViewport) bottomPanel.getAlignViewport()) |
3284 |
|
.getExplodedGeometry(); |
3285 |
0 |
if (geometry != null) |
3286 |
|
{ |
3287 |
0 |
newBottomFrame.setSize(geometry.getSize()); |
3288 |
|
} |
3289 |
|
|
3290 |
0 |
topPanel.av.setGatherViewsHere(false); |
3291 |
0 |
bottomPanel.av.setGatherViewsHere(false); |
3292 |
0 |
JInternalFrame splitFrame = new SplitFrame(newTopFrame, |
3293 |
|
newBottomFrame); |
3294 |
0 |
if (geometry != null) |
3295 |
|
{ |
3296 |
0 |
splitFrame.setLocation(geometry.getLocation()); |
3297 |
|
} |
3298 |
0 |
Desktop.addInternalFrame(splitFrame, sf.getTitle(), -1, -1); |
3299 |
|
} |
3300 |
|
|
3301 |
|
|
3302 |
|
|
3303 |
|
|
3304 |
|
|
3305 |
0 |
topPanels.clear(); |
3306 |
0 |
bottomPanels.clear(); |
3307 |
0 |
sf.close(); |
3308 |
|
} |
3309 |
|
|
3310 |
|
|
3311 |
|
|
3312 |
|
|
3313 |
|
|
3314 |
|
|
3315 |
|
@param |
3316 |
|
|
|
|
| 0% |
Uncovered Elements: 39 (39) |
Complexity: 7 |
Complexity Density: 0.23 |
|
3317 |
0 |
public void gatherViews(GSplitFrame source)... |
3318 |
|
{ |
3319 |
|
|
3320 |
|
|
3321 |
|
|
3322 |
|
|
3323 |
|
|
3324 |
0 |
AlignFrame myTopFrame = (AlignFrame) source.getTopFrame(); |
3325 |
0 |
AlignFrame myBottomFrame = (AlignFrame) source.getBottomFrame(); |
3326 |
0 |
myTopFrame.viewport.setExplodedGeometry(new Rectangle(source.getX(), |
3327 |
|
source.getY(), myTopFrame.getWidth(), myTopFrame.getHeight())); |
3328 |
0 |
myBottomFrame.viewport |
3329 |
|
.setExplodedGeometry(new Rectangle(source.getX(), source.getY(), |
3330 |
|
myBottomFrame.getWidth(), myBottomFrame.getHeight())); |
3331 |
0 |
myTopFrame.viewport.setGatherViewsHere(true); |
3332 |
0 |
myBottomFrame.viewport.setGatherViewsHere(true); |
3333 |
0 |
String topViewId = myTopFrame.viewport.getSequenceSetId(); |
3334 |
0 |
String bottomViewId = myBottomFrame.viewport.getSequenceSetId(); |
3335 |
|
|
3336 |
0 |
JInternalFrame[] frames = desktop.getAllFrames(); |
3337 |
0 |
for (JInternalFrame frame : frames) |
3338 |
|
{ |
3339 |
0 |
if (frame instanceof SplitFrame && frame != source) |
3340 |
|
{ |
3341 |
0 |
SplitFrame sf = (SplitFrame) frame; |
3342 |
0 |
AlignFrame topFrame = (AlignFrame) sf.getTopFrame(); |
3343 |
0 |
AlignFrame bottomFrame = (AlignFrame) sf.getBottomFrame(); |
3344 |
0 |
boolean gatherThis = false; |
3345 |
0 |
for (int a = 0; a < topFrame.alignPanels.size(); a++) |
3346 |
|
{ |
3347 |
0 |
AlignmentPanel topPanel = topFrame.alignPanels.get(a); |
3348 |
0 |
AlignmentPanel bottomPanel = bottomFrame.alignPanels.get(a); |
3349 |
0 |
if (topViewId.equals(topPanel.av.getSequenceSetId()) |
3350 |
|
&& bottomViewId.equals(bottomPanel.av.getSequenceSetId())) |
3351 |
|
{ |
3352 |
0 |
gatherThis = true; |
3353 |
0 |
topPanel.av.setGatherViewsHere(false); |
3354 |
0 |
bottomPanel.av.setGatherViewsHere(false); |
3355 |
0 |
topPanel.av.setExplodedGeometry( |
3356 |
|
new Rectangle(sf.getLocation(), topFrame.getSize())); |
3357 |
0 |
bottomPanel.av.setExplodedGeometry( |
3358 |
|
new Rectangle(sf.getLocation(), bottomFrame.getSize())); |
3359 |
0 |
myTopFrame.addAlignmentPanel(topPanel, false); |
3360 |
0 |
myBottomFrame.addAlignmentPanel(bottomPanel, false); |
3361 |
|
} |
3362 |
|
} |
3363 |
|
|
3364 |
0 |
if (gatherThis) |
3365 |
|
{ |
3366 |
0 |
topFrame.getAlignPanels().clear(); |
3367 |
0 |
bottomFrame.getAlignPanels().clear(); |
3368 |
0 |
sf.close(); |
3369 |
|
} |
3370 |
|
} |
3371 |
|
} |
3372 |
|
|
3373 |
|
|
3374 |
|
|
3375 |
|
|
3376 |
0 |
myTopFrame.setDisplayedView(myTopFrame.alignPanel); |
3377 |
|
} |
3378 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3379 |
376 |
public static groovy.ui.Console getGroovyConsole()... |
3380 |
|
{ |
3381 |
376 |
return groovyConsole; |
3382 |
|
} |
3383 |
|
|
3384 |
|
|
3385 |
|
|
3386 |
|
|
3387 |
|
|
3388 |
|
|
3389 |
|
@param |
3390 |
|
|
3391 |
|
@param |
3392 |
|
|
3393 |
|
@param |
3394 |
|
|
3395 |
|
@param |
3396 |
|
|
3397 |
|
@throws |
3398 |
|
|
|
|
| 0% |
Uncovered Elements: 116 (116) |
Complexity: 31 |
Complexity Density: 0.42 |
|
3399 |
0 |
public static void transferFromDropTarget(List<Object> files,... |
3400 |
|
List<DataSourceType> protocols, DropTargetDropEvent evt, |
3401 |
|
Transferable t) throws Exception |
3402 |
|
{ |
3403 |
|
|
3404 |
|
|
3405 |
|
|
3406 |
|
|
3407 |
|
|
3408 |
|
|
3409 |
|
|
3410 |
|
|
3411 |
|
|
3412 |
|
|
3413 |
|
|
3414 |
|
|
3415 |
|
|
3416 |
|
|
3417 |
|
|
3418 |
|
|
3419 |
|
|
3420 |
|
|
3421 |
|
|
3422 |
|
|
3423 |
|
|
3424 |
0 |
DataFlavor uriListFlavor = new DataFlavor( |
3425 |
|
"text/uri-list;class=java.lang.String"), urlFlavour = null; |
3426 |
0 |
try |
3427 |
|
{ |
3428 |
0 |
urlFlavour = new DataFlavor( |
3429 |
|
"application/x-java-url; class=java.net.URL"); |
3430 |
|
} catch (ClassNotFoundException cfe) |
3431 |
|
{ |
3432 |
0 |
Cache.log.debug("Couldn't instantiate the URL dataflavor.", cfe); |
3433 |
|
} |
3434 |
|
|
3435 |
0 |
if (urlFlavour != null && t.isDataFlavorSupported(urlFlavour)) |
3436 |
|
{ |
3437 |
|
|
3438 |
0 |
try |
3439 |
|
{ |
3440 |
0 |
java.net.URL url = (URL) t.getTransferData(urlFlavour); |
3441 |
|
|
3442 |
|
|
3443 |
0 |
if (url != null) |
3444 |
|
{ |
3445 |
0 |
protocols.add(DataSourceType.URL); |
3446 |
0 |
files.add(url.toString()); |
3447 |
0 |
Cache.log.debug("Drop handled as URL dataflavor " |
3448 |
|
+ files.get(files.size() - 1)); |
3449 |
0 |
return; |
3450 |
|
} |
3451 |
|
else |
3452 |
|
{ |
3453 |
0 |
if (Platform.isAMac()) |
3454 |
|
{ |
3455 |
0 |
System.err.println( |
3456 |
|
"Please ignore plist error - occurs due to problem with java 8 on OSX"); |
3457 |
|
} |
3458 |
0 |
; |
3459 |
|
} |
3460 |
|
} catch (Throwable ex) |
3461 |
|
{ |
3462 |
0 |
Cache.log.debug("URL drop handler failed.", ex); |
3463 |
|
} |
3464 |
|
} |
3465 |
0 |
if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) |
3466 |
|
{ |
3467 |
|
|
3468 |
0 |
Cache.log.debug("Drop handled as javaFileListFlavor"); |
3469 |
0 |
for (Object file : (List) t |
3470 |
|
.getTransferData(DataFlavor.javaFileListFlavor)) |
3471 |
|
{ |
3472 |
0 |
files.add(file); |
3473 |
0 |
protocols.add(DataSourceType.FILE); |
3474 |
|
} |
3475 |
|
} |
3476 |
|
else |
3477 |
|
{ |
3478 |
|
|
3479 |
0 |
boolean added = false; |
3480 |
0 |
String data = null; |
3481 |
0 |
if (t.isDataFlavorSupported(uriListFlavor)) |
3482 |
|
{ |
3483 |
0 |
Cache.log.debug("Drop handled as uriListFlavor"); |
3484 |
|
|
3485 |
0 |
data = (String) t.getTransferData(uriListFlavor); |
3486 |
|
} |
3487 |
0 |
if (data == null) |
3488 |
|
{ |
3489 |
|
|
3490 |
0 |
Cache.log.debug("standard URIListFlavor failed. Trying text"); |
3491 |
|
|
3492 |
0 |
DataFlavor textDf = new DataFlavor( |
3493 |
|
"text/plain;class=java.lang.String"); |
3494 |
0 |
if (t.isDataFlavorSupported(textDf)) |
3495 |
|
{ |
3496 |
0 |
data = (String) t.getTransferData(textDf); |
3497 |
|
} |
3498 |
|
|
3499 |
0 |
Cache.log.debug("Plain text drop content returned " |
3500 |
0 |
+ (data == null ? "Null - failed" : data)); |
3501 |
|
|
3502 |
|
} |
3503 |
0 |
if (data != null) |
3504 |
|
{ |
3505 |
0 |
while (protocols.size() < files.size()) |
3506 |
|
{ |
3507 |
0 |
Cache.log.debug("Adding missing FILE protocol for " |
3508 |
|
+ files.get(protocols.size())); |
3509 |
0 |
protocols.add(DataSourceType.FILE); |
3510 |
|
} |
3511 |
0 |
for (java.util.StringTokenizer st = new java.util.StringTokenizer( |
3512 |
0 |
data, "\r\n"); st.hasMoreTokens();) |
3513 |
|
{ |
3514 |
0 |
added = true; |
3515 |
0 |
String s = st.nextToken(); |
3516 |
0 |
if (s.startsWith("#")) |
3517 |
|
{ |
3518 |
|
|
3519 |
0 |
continue; |
3520 |
|
} |
3521 |
0 |
java.net.URI uri = new java.net.URI(s); |
3522 |
0 |
if (uri.getScheme().toLowerCase().startsWith("http")) |
3523 |
|
{ |
3524 |
0 |
protocols.add(DataSourceType.URL); |
3525 |
0 |
files.add(uri.toString()); |
3526 |
|
} |
3527 |
|
else |
3528 |
|
{ |
3529 |
|
|
3530 |
0 |
java.io.File file = new java.io.File(uri); |
3531 |
0 |
protocols.add(DataSourceType.FILE); |
3532 |
0 |
files.add(file.toString()); |
3533 |
|
} |
3534 |
|
} |
3535 |
|
} |
3536 |
|
|
3537 |
0 |
if (Cache.log.isDebugEnabled()) |
3538 |
|
{ |
3539 |
0 |
if (data == null || !added) |
3540 |
|
{ |
3541 |
|
|
3542 |
0 |
if (t.getTransferDataFlavors() != null |
3543 |
|
&& t.getTransferDataFlavors().length > 0) |
3544 |
|
{ |
3545 |
0 |
Cache.log.debug( |
3546 |
|
"Couldn't resolve drop data. Here are the supported flavors:"); |
3547 |
0 |
for (DataFlavor fl : t.getTransferDataFlavors()) |
3548 |
|
{ |
3549 |
0 |
Cache.log.debug( |
3550 |
|
"Supported transfer dataflavor: " + fl.toString()); |
3551 |
0 |
Object df = t.getTransferData(fl); |
3552 |
0 |
if (df != null) |
3553 |
|
{ |
3554 |
0 |
Cache.log.debug("Retrieves: " + df); |
3555 |
|
} |
3556 |
|
else |
3557 |
|
{ |
3558 |
0 |
Cache.log.debug("Retrieved nothing"); |
3559 |
|
} |
3560 |
|
} |
3561 |
|
} |
3562 |
|
else |
3563 |
|
{ |
3564 |
0 |
Cache.log.debug("Couldn't resolve dataflavor for drop: " |
3565 |
|
+ t.toString()); |
3566 |
|
} |
3567 |
|
} |
3568 |
|
} |
3569 |
|
} |
3570 |
0 |
if (Platform.isWindows()) |
3571 |
|
|
3572 |
|
{ |
3573 |
0 |
Cache.log.debug("Scanning dropped content for Windows Link Files"); |
3574 |
|
|
3575 |
|
|
3576 |
0 |
for (int f = 0; f < files.size(); f++) |
3577 |
|
{ |
3578 |
0 |
String source = files.get(f).toString().toLowerCase(); |
3579 |
0 |
if (protocols.get(f).equals(DataSourceType.FILE) |
3580 |
|
&& (source.endsWith(".lnk") || source.endsWith(".url") |
3581 |
|
|| source.endsWith(".site"))) |
3582 |
|
{ |
3583 |
0 |
try |
3584 |
|
{ |
3585 |
0 |
Object obj = files.get(f); |
3586 |
0 |
File lf = (obj instanceof File ? (File) obj |
3587 |
|
: new File((String) obj)); |
3588 |
|
|
3589 |
0 |
Cache.log.debug("Found potential link file: " + lf); |
3590 |
0 |
WindowsShortcut wscfile = new WindowsShortcut(lf); |
3591 |
0 |
String fullname = wscfile.getRealFilename(); |
3592 |
0 |
protocols.set(f, FormatAdapter.checkProtocol(fullname)); |
3593 |
0 |
files.set(f, fullname); |
3594 |
0 |
Cache.log.debug("Parsed real filename " + fullname |
3595 |
|
+ " to extract protocol: " + protocols.get(f)); |
3596 |
|
} catch (Exception ex) |
3597 |
|
{ |
3598 |
0 |
Cache.log.error( |
3599 |
|
"Couldn't parse " + files.get(f) + " as a link file.", |
3600 |
|
ex); |
3601 |
|
} |
3602 |
|
} |
3603 |
|
} |
3604 |
|
} |
3605 |
|
} |
3606 |
|
|
3607 |
|
|
3608 |
|
|
3609 |
|
|
3610 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3611 |
0 |
@Override... |
3612 |
|
protected void showExperimental_actionPerformed(boolean selected) |
3613 |
|
{ |
3614 |
0 |
Cache.setProperty(EXPERIMENTAL_FEATURES, Boolean.toString(selected)); |
3615 |
|
} |
3616 |
|
|
3617 |
|
|
3618 |
|
|
3619 |
|
|
3620 |
|
|
3621 |
|
|
3622 |
|
|
3623 |
|
@param |
3624 |
|
|
3625 |
|
@param |
3626 |
|
|
3627 |
|
@return |
3628 |
|
|
|
|
| 85.7% |
Uncovered Elements: 2 (14) |
Complexity: 6 |
Complexity Density: 0.75 |
|
3629 |
1 |
public List<StructureViewerBase> getStructureViewers(... |
3630 |
|
AlignmentPanel apanel, |
3631 |
|
Class<? extends StructureViewerBase> structureViewerClass) |
3632 |
|
{ |
3633 |
1 |
List<StructureViewerBase> result = new ArrayList<>(); |
3634 |
1 |
JInternalFrame[] frames = Desktop.instance.getAllFrames(); |
3635 |
|
|
3636 |
1 |
for (JInternalFrame frame : frames) |
3637 |
|
{ |
3638 |
3 |
if (frame instanceof StructureViewerBase) |
3639 |
|
{ |
3640 |
1 |
if (structureViewerClass == null |
3641 |
|
|| structureViewerClass.isInstance(frame)) |
3642 |
|
{ |
3643 |
1 |
if (apanel == null |
3644 |
|
|| ((StructureViewerBase) frame).isLinkedWith(apanel)) |
3645 |
|
{ |
3646 |
1 |
result.add((StructureViewerBase) frame); |
3647 |
|
} |
3648 |
|
} |
3649 |
|
} |
3650 |
|
} |
3651 |
1 |
return result; |
3652 |
|
} |
3653 |
|
} |