1. Project Clover database Fri Dec 6 2024 13:47:14 GMT
  2. Package jalview.gui

File JAL1353bugdemo.java

 

Coverage histogram

../../img/srcFileCovDistChart0.png
60% of files have more coverage

Code metrics

4
31
5
1
136
80
8
0.26
6.2
5
1.6

Classes

Class
Line #
Actions
JAL1353bugdemo 38 31 8
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.gui;
22   
23    import java.awt.Dimension;
24    import java.awt.event.MouseAdapter;
25    import java.awt.event.MouseEvent;
26   
27    import javax.swing.JDesktopPane;
28    import javax.swing.JFrame;
29    import javax.swing.JInternalFrame;
30    import javax.swing.JTextArea;
31   
32    import org.testng.annotations.AfterClass;
33    import org.testng.annotations.BeforeClass;
34    import org.testng.annotations.Test;
35   
36    import jalview.bin.Console;
37   
 
38    public class JAL1353bugdemo
39    {
40   
 
41  0 toggle @BeforeClass(alwaysRun = true)
42    public void setUpJvOptionPane()
43    {
44  0 JvOptionPane.setInteractiveMode(false);
45  0 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
46    }
47   
 
48  0 toggle @BeforeClass(alwaysRun = true)
49    public static void setUpBeforeClass() throws Exception
50    {
51    }
52   
 
53  0 toggle @AfterClass(alwaysRun = true)
54    public static void tearDownAfterClass() throws Exception
55    {
56    }
57   
58    volatile boolean finish = false;
59   
 
60  0 toggle @Test(groups = { "Functional" }, enabled = false)
61    public void test()
62    {
63  0 Console.initLogger();
64    // final Desktop foo = new Desktop();
65  0 final JFrame cfoo = new JFrame("Crash Java");
66  0 final JDesktopPane foo = new JDesktopPane();
67  0 foo.setPreferredSize(new Dimension(600, 800));
68  0 cfoo.setSize(600, 800);
69  0 final JInternalFrame cont = new JInternalFrame("My Frame");
70  0 cont.setPreferredSize(new Dimension(400, 400));
71  0 String msg = "This is a dummy string. See the dummy string go.\n";
72  0 msg += msg; // 2
73  0 msg += msg; // 4
74  0 msg += msg; // 8
75  0 msg += msg; // 16
76  0 JTextArea evt = new JTextArea(
77    "Click here and drag text over this window to freeze java.\n\n"
78    + msg);
79  0 cont.add(evt);
80  0 cont.pack();
81  0 foo.add("A frame", cont);
82  0 foo.setVisible(true);
83  0 foo.setEnabled(true);
84  0 foo.doLayout();
85  0 cfoo.add(foo);
86    // final JMenu jm = new JMenu("Do");
87    // JMenuItem jmi = new JMenuItem("this");
88    // jm.add(jmi);
89  0 evt.addMouseListener(new MouseAdapter()
90    {
91   
 
92  0 toggle @Override
93    public void mouseClicked(MouseEvent e)
94    {
95    // JFrame parent = new JFrame();
96    // parent.setBounds(foo.getBounds());
97    // JPanel oo = new JPanel();
98    // parent.add(oo);
99    // oo.setVisible(true);
100    // parent.setVisible(true);
101  0 EditNameDialog end = new EditNameDialog("Sequence Name",
102    "Try and drag between the two text fields", "label 1",
103    "Label 2");// );cont.getRootPane());
104  0 assert (end != null);
105  0 finish = true;
106    }
107    });
108  0 cont.setVisible(true);
109   
110    // jmi.addActionListener(new ActionListener()
111    // {
112    //
113    // @Override
114    // public void actionPerformed(ActionEvent arg0)
115    // {
116    // EditNameDialog end = new EditNameDialog("Sequence Name",
117    // "Sequence Description", "label 1", "Label 2",
118    // "Try and drag between the two text fields", cont);
119    // assert (end != null);
120    // finish = true;
121    // }
122    // });
123  0 foo.setVisible(true);
124  0 cfoo.setVisible(true);
125  0 while (!finish)
126    {
127  0 try
128    {
129  0 Thread.sleep(100);
130    } catch (InterruptedException x)
131    {
132    }
133    }
134    }
135   
136    }