use of junit.extensions.jfcunit.finder.JLabelFinder in project JMRI by JMRI.
the class PositionableLabelTest method getColor.
int getColor(String name) {
flushAWT();
// Find window by name
JmriJFrame frame = JmriJFrame.getFrame(name);
Assert.assertNotNull("frame: " + name, frame);
// find label within that
JLabelFinder finder = new JLabelFinder("....");
// FIXME: finder.findAll returns an untyped list, so we have issues with casting
@SuppressWarnings("rawtypes") java.util.List list = finder.findAll(frame);
Assert.assertNotNull("list: " + name, list);
Assert.assertTrue("length: " + name + ": " + list.size(), list.size() > 0);
JComponent component = (JComponent) list.get(0);
int[] content = getDisplayedContent(component, component.getSize(), new Point(0, 0));
int color = content[0];
// Unless in demo mode, close table window
if (System.getProperty("jmri.demo", "false").equals("false")) {
frame.setVisible(false);
}
return color;
}
Aggregations