From 2f497e35821e09179115565d29a26f41186385c7 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 19 Sep 2016 11:29:30 +0100 Subject: [PATCH] JAL-1353 small tidy of test --- test/jalview/gui/JAL1353bugdemo.java | 80 ++++++++++++---------------------- 1 file changed, 28 insertions(+), 52 deletions(-) diff --git a/test/jalview/gui/JAL1353bugdemo.java b/test/jalview/gui/JAL1353bugdemo.java index 9d0cedb..489fe4f 100644 --- a/test/jalview/gui/JAL1353bugdemo.java +++ b/test/jalview/gui/JAL1353bugdemo.java @@ -23,16 +23,12 @@ package jalview.gui; import jalview.bin.Cache; import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JInternalFrame; -import javax.swing.JMenu; -import javax.swing.JMenuItem; import javax.swing.JTextArea; import org.testng.annotations.AfterClass; @@ -64,49 +60,29 @@ public class JAL1353bugdemo foo.setPreferredSize(new Dimension(600, 800)); cfoo.setSize(600, 800); final JInternalFrame cont = new JInternalFrame("My Frame"); - JTextArea evt; - cont.setPreferredSize(new Dimension(400, 300)); - cont.add(evt = new JTextArea( - "Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n")); + cont.setPreferredSize(new Dimension(400, 400)); + String msg = "This is a dummy string. See the dummy string go.\n"; + msg += msg; // 2 + msg += msg; // 4 + msg += msg; // 8 + msg += msg; // 16 + JTextArea evt = new JTextArea( + "Click here and drag text over this window to freeze java.\n\n" + + msg); + cont.add(evt); cont.pack(); foo.add("A frame", cont); foo.setVisible(true); foo.setEnabled(true); foo.doLayout(); cfoo.add(foo); - final JMenu jm = new JMenu("Do"); - JMenuItem jmi = new JMenuItem("this"); - jm.add(jmi); - evt.addMouseListener(new MouseListener() + // final JMenu jm = new JMenu("Do"); + // JMenuItem jmi = new JMenuItem("this"); + // jm.add(jmi); + evt.addMouseListener(new MouseAdapter() { @Override - public void mouseReleased(MouseEvent e) - { - } - - @Override - public void mousePressed(MouseEvent e) - { - // TODO Auto-generated method stub - - } - - @Override - public void mouseExited(MouseEvent e) - { - // TODO Auto-generated method stub - - } - - @Override - public void mouseEntered(MouseEvent e) - { - // TODO Auto-generated method stub - - } - - @Override public void mouseClicked(MouseEvent e) { // JFrame parent = new JFrame(); @@ -124,19 +100,19 @@ public class JAL1353bugdemo }); cont.setVisible(true); - jmi.addActionListener(new ActionListener() - { - - @Override - public void actionPerformed(ActionEvent arg0) - { - EditNameDialog end = new EditNameDialog("Sequence Name", - "Sequence Description", "label 1", "Label 2", - "Try and drag between the two text fields", cont); - assert (end != null); - finish = true; - } - }); + // jmi.addActionListener(new ActionListener() + // { + // + // @Override + // public void actionPerformed(ActionEvent arg0) + // { + // EditNameDialog end = new EditNameDialog("Sequence Name", + // "Sequence Description", "label 1", "Label 2", + // "Try and drag between the two text fields", cont); + // assert (end != null); + // finish = true; + // } + // }); foo.setVisible(true); cfoo.setVisible(true); while (!finish) -- 1.7.10.2