m_deleteBut.setEnabled(true);
}
Object test = m_testsToEditList.getSelectedValue();
if (test != null) {
CustomPeriodicTest t = (CustomPeriodicTest)test;
m_lowerBoundEditor.setTestToEdit(t);
m_upperBoundEditor.setTestToEdit(t);
if (t.getLabel() != null && t.getLabel().length() > 0) {
m_labelField.setText(t.getLabel());
} else {
m_labelField.setText("");
}
}
}
}
});
m_newBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CustomPeriodicTest newTest =
new CustomPeriodicTest(">*:*:*:*:*:*:*:*:*:* <*:*:*:*:*:*:*:*:*:*");
m_lowerBoundEditor.setTestToEdit(newTest);
m_upperBoundEditor.setTestToEdit(newTest);
testVec.addElement(newTest);
m_testsToEdit.add(newTest);
m_labelField.setText("");
m_testsToEditList.setSelectedIndex(m_testsToEdit.size() - 1);
}
});
m_deleteBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int selected = m_testsToEditList.getSelectedIndex();
if (selected >= 0) {
testVec.removeElementAt(selected);
m_testsToEdit.remove(selected);
}
}
});
m_lowerBoundEditor.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
/*m_testsToEditList.revalidate();
m_testsToEditList.invalidate(); */
m_testsToEditList.repaint();
if (m_lowerBoundEditor.getTestBeingEdited().getLowerTest().m_boundOperator ==
CustomPeriodicTest.Operator.EQUALS) {
m_upperBoundEditor.setEnabled(false);
} else {
m_upperBoundEditor.setEnabled(true);
}
}
});
m_upperBoundEditor.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
/*m_testsToEditList.revalidate();
m_testsToEditList.invalidate(); */
m_testsToEditList.repaint();
}
});
m_labelField.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
Object test = m_testsToEditList.getSelectedValue();
if (test != null) {
CustomPeriodicTest t = (CustomPeriodicTest)test;
t.setLabel(m_labelField.getText());
m_testsToEditList.repaint();
}
}
});
/*m_labelField.addFocusListener(new FocusAdapter() {