use of jmri.util.JmriJFrame in project JMRI by JMRI.
the class AbstractMonPaneTestBase method checkOnTopCheckBox.
// Test checking the Always On Top checkbox.
@Test
public void checkOnTopCheckBox() {
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);
s.checkOnTopCheckBox();
Assert.assertTrue(s.getOnTopCheckBoxValue());
f.dispose();
}
use of jmri.util.JmriJFrame in project JMRI by JMRI.
the class AbstractMonPaneTestBase method checkTimeStampCheckBox.
// Test checking the Time Stamp checkbox.
@Test
public void checkTimeStampCheckBox() {
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);
s.checkTimeStampCheckBox();
Assert.assertTrue(s.getTimeStampCheckBoxValue());
f.dispose();
}
use of jmri.util.JmriJFrame in project JMRI by JMRI.
the class AffineEntryPanelTest method testListener.
@Test
public void testListener() {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
JmriJFrame f = new JmriJFrame();
AffineEntryPanel p = new AffineEntryPanel();
f.add(p);
f.pack();
f.setTitle("Test RPS Listener");
f.setVisible(true);
java.beans.PropertyChangeListener l = new java.beans.PropertyChangeListener() {
@Override
public void propertyChange(java.beans.PropertyChangeEvent e) {
if (e.getPropertyName().equals("value")) {
System.out.println("See " + e.getPropertyName() + " as " + e.getNewValue());
}
}
};
p.addPropertyChangeListener(l);
JFrame f2 = jmri.util.JmriJFrame.getFrame("Test RPS Listener");
Assert.assertNotNull("found frame", f2);
f2.dispose();
}
use of jmri.util.JmriJFrame 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();
}
use of jmri.util.JmriJFrame in project JMRI by JMRI.
the class LocoStatsFrameTest method getFrame.
LocoStatsPanel getFrame(String title, int offset) throws Exception {
JmriJFrame f = new JmriJFrame();
LocoStatsPanel p = new LocoStatsPanel() {
@Override
public void requestUpdate() {
// replace actual transmit
updateRequestPending = true;
}
};
p.initComponents();
f.getContentPane().add(p);
f.setTitle(title);
f.setLocation(0, offset);
f.pack();
f.setVisible(true);
return p;
}
Aggregations