Search in sources :

Example 1 with AbstractMonPaneScaffold

use of jmri.jmrix.AbstractMonPaneScaffold in project JMRI by JMRI.

the class EcosMonPaneTest method checkAutoScrollCheckBox.

// Test checking the AutoScroll checkbox.
// for some reason the EcosMonPane has the checkbox value reversed on
// startup compared to other AbstractMonPane derivatives.
@Override
@Test
public void checkAutoScrollCheckBox() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    AbstractMonPaneScaffold s = new AbstractMonPaneScaffold(pane);
    // for Jemmy to work, we need the pane inside of a frame
    JmriJFrame f = new JmriJFrame();
    try {
        pane.initComponents();
    } catch (Exception ex) {
        Assert.fail("Could not load pane: " + ex);
    }
    f.add(pane);
    // set title if available
    if (pane.getTitle() != null) {
        f.setTitle(pane.getTitle());
    }
    f.pack();
    f.setVisible(true);
    Assert.assertTrue(s.getAutoScrollCheckBoxValue());
    s.checkAutoScrollCheckBox();
    Assert.assertFalse(s.getAutoScrollCheckBoxValue());
    f.setVisible(false);
    f.dispose();
}
Also used : JmriJFrame(jmri.util.JmriJFrame) AbstractMonPaneScaffold(jmri.jmrix.AbstractMonPaneScaffold) Test(org.junit.Test)

Example 2 with AbstractMonPaneScaffold

use of jmri.jmrix.AbstractMonPaneScaffold in project JMRI by JMRI.

the class MrcMonPanelTest method checkAutoScrollCheckBox.

// Test checking the AutoScroll checkbox.
// for some reason the MrcMonPanel has the checkbox value reversed on
// startup compared to other AbstractMonPane derivatives.
@Override
@Test
public void checkAutoScrollCheckBox() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    AbstractMonPaneScaffold s = new AbstractMonPaneScaffold(pane);
    JmriJFrame f = new JmriJFrame();
    try {
        pane.initComponents();
    } catch (Exception ex) {
        Assert.fail("Could not load pane: " + ex);
    }
    f.add(pane);
    // set title if available
    if (pane.getTitle() != null) {
        f.setTitle(pane.getTitle());
    }
    f.pack();
    f.setVisible(true);
    Assert.assertTrue(s.getAutoScrollCheckBoxValue());
    s.checkAutoScrollCheckBox();
    Assert.assertFalse(s.getAutoScrollCheckBoxValue());
    f.setVisible(false);
    f.dispose();
}
Also used : JmriJFrame(jmri.util.JmriJFrame) AbstractMonPaneScaffold(jmri.jmrix.AbstractMonPaneScaffold) Test(org.junit.Test)

Example 3 with AbstractMonPaneScaffold

use of jmri.jmrix.AbstractMonPaneScaffold in project JMRI by JMRI.

the class LocoMonPaneTest method checkAutoScrollCheckBox.

// Test checking the AutoScroll checkbox.
// for some reason the LocoMonPane has the checkbox value reversed on
// startup compared to other AbstractMonPane derivatives.
@Override
@Test
public void checkAutoScrollCheckBox() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    AbstractMonPaneScaffold s = new AbstractMonPaneScaffold(pane);
    // for Jemmy to work, we need the pane inside of a frame
    JmriJFrame f = new JmriJFrame();
    try {
        pane.initComponents();
    } catch (Exception ex) {
        Assert.fail("Could not load pane: " + ex);
    }
    f.add(pane);
    // set title if available
    if (pane.getTitle() != null) {
        f.setTitle(pane.getTitle());
    }
    f.pack();
    f.setVisible(true);
    Assert.assertTrue(s.getAutoScrollCheckBoxValue());
    s.checkAutoScrollCheckBox();
    Assert.assertFalse(s.getAutoScrollCheckBoxValue());
    f.setVisible(false);
    f.dispose();
}
Also used : JmriJFrame(jmri.util.JmriJFrame) AbstractMonPaneScaffold(jmri.jmrix.AbstractMonPaneScaffold) Test(org.junit.Test)

Example 4 with AbstractMonPaneScaffold

use of jmri.jmrix.AbstractMonPaneScaffold in project JMRI by JMRI.

the class NceMonPanelTest method checkAutoScrollCheckBox.

// Test checking the AutoScroll checkbox.
// for some reason the EcosMonPane has the checkbox value reversed on
// startup compared to other AbstractMonPane derivatives.
@Override
@Test
public void checkAutoScrollCheckBox() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    AbstractMonPaneScaffold s = new AbstractMonPaneScaffold(pane);
    // for Jemmy to work, we need the pane inside of a frame
    JmriJFrame f = new JmriJFrame();
    try {
        pane.initComponents();
    } catch (Exception ex) {
        Assert.fail("Could not load pane: " + ex);
    }
    f.add(pane);
    // set title if available
    if (pane.getTitle() != null) {
        f.setTitle(pane.getTitle());
    }
    f.pack();
    f.setVisible(true);
    Assert.assertTrue(s.getAutoScrollCheckBoxValue());
    s.checkAutoScrollCheckBox();
    Assert.assertFalse(s.getAutoScrollCheckBoxValue());
    f.setVisible(false);
    f.dispose();
}
Also used : JmriJFrame(jmri.util.JmriJFrame) AbstractMonPaneScaffold(jmri.jmrix.AbstractMonPaneScaffold) Test(org.junit.Test)

Aggregations

AbstractMonPaneScaffold (jmri.jmrix.AbstractMonPaneScaffold)4 JmriJFrame (jmri.util.JmriJFrame)4 Test (org.junit.Test)4