Search in sources :

Example 1 with ButtonTestAction

use of jmri.util.swing.ButtonTestAction in project JMRI by JMRI.

the class SdiWindowTest method testAction.

@Test
public void testAction() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    JmriJFrame f = new JmriJFrame("SDI test");
    JButton b = new JButton(new ButtonTestAction("new frame", new jmri.util.swing.sdi.JmriJFrameInterface()));
    f.add(b);
    f.pack();
    f.setVisible(true);
    //    }
    //  test order isn't guaranteed!
    //    public void testFrameCreation() {
    JFrame f2 = jmri.util.JmriJFrame.getFrame("SDI test");
    Assert.assertTrue("found frame", f2 != null);
    f2.dispose();
}
Also used : JmriJFrame(jmri.util.JmriJFrame) JmriJFrame(jmri.util.JmriJFrame) JFrame(javax.swing.JFrame) JButton(javax.swing.JButton) ButtonTestAction(jmri.util.swing.ButtonTestAction) Test(org.junit.Test)

Example 2 with ButtonTestAction

use of jmri.util.swing.ButtonTestAction in project JMRI by JMRI.

the class MultiPaneWindowTest method testAction.

@Test
public void testAction() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    MultiPaneWindow m = new MultiPaneWindow("Test of Multi Pane Window function", "xml/config/apps/panelpro/Gui3LeftTree.xml", "xml/config/apps/panelpro/Gui3Menus.xml", "xml/config/apps/panelpro/Gui3MainToolBar.xml");
    {
        JButton b = new JButton(new ButtonTestAction("Open new frame", new jmri.util.swing.sdi.JmriJFrameInterface()));
        m.getUpperRight().add(b);
    }
    {
        JButton b = new JButton(new ButtonTestAction("Open in upper panel", new PanedInterface(m)));
        m.getLowerRight().add(b);
        b = new JButton(new jmri.jmrit.powerpanel.PowerPanelAction("power", new PanedInterface(m)));
        m.getLowerRight().add(b);
    }
    m.setVisible(true);
    JFrame f = jmri.util.JmriJFrame.getFrame("Test of Multi Pane Window function");
    Assert.assertTrue("found frame", f != null);
    f.dispose();
}
Also used : JFrame(javax.swing.JFrame) JButton(javax.swing.JButton) ButtonTestAction(jmri.util.swing.ButtonTestAction) Test(org.junit.Test)

Example 3 with ButtonTestAction

use of jmri.util.swing.ButtonTestAction in project JMRI by JMRI.

the class PackageTest method testAction.

public void testAction() {
    JmriJFrame f = new JmriJFrame("SDI test");
    JButton b = new JButton(new ButtonTestAction("new frame", new jmri.util.swing.sdi.JmriJFrameInterface()));
    f.add(b);
    f.pack();
    f.setVisible(true);
    //    }
    //  test order isn't guaranteed!
    //    public void testFrameCreation() {
    JFrame f2 = jmri.util.JmriJFrame.getFrame("SDI test");
    Assert.assertTrue("found frame", f2 != null);
    f2.dispose();
}
Also used : JmriJFrame(jmri.util.JmriJFrame) JmriJFrame(jmri.util.JmriJFrame) JFrame(javax.swing.JFrame) JButton(javax.swing.JButton) ButtonTestAction(jmri.util.swing.ButtonTestAction)

Aggregations

JButton (javax.swing.JButton)3 JFrame (javax.swing.JFrame)3 ButtonTestAction (jmri.util.swing.ButtonTestAction)3 JmriJFrame (jmri.util.JmriJFrame)2 Test (org.junit.Test)2