}
public void init() {
setLayout(new GridBagLayout());
GridBagLineAdder adder = new GridBagLineAdder(this);
adder.setWeight(1.0f, 0.0f);
adder.setLength(6);
//1st column - 1st row
adder.setWeight(0.0, 0.0);
adder.add(new JLabel("Test suite:"));
adder.setWeight(1.0, 0.0);
adder.add(mTestSuiteLabel);
adder.setWeight(0.0, 0.0);
//2d column - 1st row
adder.add(new JLabel("Testbed config:"));
// set the combobox as read only (not possible to modify the testbed from GUI at this time
UIManager.put("ComboBox.disabledForeground", Color.BLACK);
mTestbedList.setEnabled(true);
adder.add(mTestbedList);
// add testbed mouse listener, for the "Edit File" action
TestbedMouseListener testbedMouseListener = new TestbedMouseListener();
java.awt.Component[] mTestbedListComponents = mTestbedList.getComponents();
for (int i = 0; i < mTestbedListComponents.length; i++) {
mTestbedListComponents[i].addMouseListener(testbedMouseListener);
}
// go to second row
adder.addSeparator();
//1st column - 2d row
adder.add(new JLabel("Test results directory:"));
adder.add(mTestResultsLabel);
//2d column - 2d row
m_ignoreControlScript.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
TestEngine.setIgnoreControlScript(ignoreControlScript());
setControlTestbedButtonsEnabled();
}
});
adder.add(m_ignoreControlScript);
JPanel sutPanel = new JPanel();
JLabel sutVersion = new JLabel("SUT version: ");
sutPanel.add(sutVersion);
m_SUTVersion.setHorizontalAlignment(JTextField.RIGHT);
m_SUTVersion.setPreferredSize(new Dimension(150, m_SUTVersion.getPreferredSize().height));
sutPanel.add(m_SUTVersion);
adder.add(sutPanel);
m_SUTVersion.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
TestBedConfiguration.setSUTVersion(m_SUTVersion.getText());
}
});
//create a 3d row
adder.addSeparator();
//1st column - 3d row
adder.add(new JLabel("Reporting Format:"));
adder.add(mTestReportingFormat);
//2d column - 3d row
// add a button to manually start the testbed
m_startTestbed.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
isStartingOrStoppingTestbed = true;
setControlTestbedButtonsEnabled();
parent.getTestCasePanel().showTestcaseResultsTab();
TestBedConfiguration.setSUTVersion(getSUTVersion());
new SUTStartStopThread("start").start();
}
});
m_startTestbed.setEnabled(false);
adder.add(m_startTestbed);
// add a button to manually stop the testbed
m_stopTestbed.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
isStartingOrStoppingTestbed = true;
setControlTestbedButtonsEnabled();
parent.getTestCasePanel().showTestcaseResultsTab();
TestBedConfiguration.setSUTVersion(getSUTVersion());
new SUTStartStopThread("stop").start();
}
});
m_stopTestbed.setEnabled(false);
adder.add(m_stopTestbed);
DefaultComboBoxModel model = (DefaultComboBoxModel) mTestbedList.getModel();
model.removeAllElements();
String testbedDir = testbedConfig.getFile().getParent();
File fTestbedDir = new File(testbedDir);