// System.err.println("wasModified");
if (evt.getSource() instanceof PropertyEditor) {
PropertyEditor editor = (PropertyEditor) evt.getSource();
for (int i = 0 ; i < m_Editors.length; i++) {
if (m_Editors[i] == editor) {
PropertyDescriptor property = m_Properties[i];
Object value = editor.getValue();
m_Values[i] = value;
Method setter = property.getWriteMethod();
try {
Object args[] = { value };
args[0] = value;
setter.invoke(m_Target, args);
} catch (InvocationTargetException ex) {
if (ex.getTargetException()
instanceof PropertyVetoException) {
String message = "WARNING: Vetoed; reason is: "
+ ex.getTargetException().getMessage();
System.err.println(message);
Component jf;
if(evt.getSource() instanceof JPanel)
jf = ((JPanel)evt.getSource()).getParent();
else
jf = new JFrame();
JOptionPane.showMessageDialog(jf, message,
"error",
JOptionPane.WARNING_MESSAGE);
if(jf instanceof JFrame)
((JFrame)jf).dispose();
} else {
System.err.println(ex.getTargetException().getClass().getName()+
" while updating "+ property.getName() +": "+
ex.getTargetException().getMessage());
Component jf;
if(evt.getSource() instanceof JPanel)
jf = ((JPanel)evt.getSource()).getParent();
else
jf = new JFrame();
JOptionPane.showMessageDialog(jf,
ex.getTargetException().getClass().getName()+
" while updating "+ property.getName()+
":\n"+
ex.getTargetException().getMessage(),
"error",
JOptionPane.WARNING_MESSAGE);
if(jf instanceof JFrame)
((JFrame)jf).dispose();
}
} catch (Exception ex) {
System.err.println("Unexpected exception while updating "
+ property.getName());
}
if (m_Views[i] != null && m_Views[i] instanceof PropertyPanel) {
//System.err.println("Trying to repaint the property canvas");
m_Views[i].repaint();
revalidate();