2007-12-23 19:28:04 +00:00
|
|
|
|
|
|
|
package net.sourceforge.tuned.ui;
|
|
|
|
|
|
|
|
|
|
|
|
import java.beans.PropertyChangeEvent;
|
|
|
|
import java.beans.PropertyChangeListener;
|
|
|
|
|
2008-06-21 19:24:18 +00:00
|
|
|
import javax.swing.SwingWorker.StateValue;
|
2007-12-23 19:28:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
public abstract class SwingWorkerPropertyChangeAdapter implements PropertyChangeListener {
|
|
|
|
|
|
|
|
public void propertyChange(PropertyChangeEvent evt) {
|
|
|
|
if (evt.getPropertyName().equals("progress"))
|
|
|
|
progress(evt);
|
2008-06-21 19:24:18 +00:00
|
|
|
else if (evt.getPropertyName().equals("state"))
|
|
|
|
state(evt);
|
2007-12-23 19:28:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-06-21 19:24:18 +00:00
|
|
|
public void state(PropertyChangeEvent evt) {
|
|
|
|
switch ((StateValue) evt.getNewValue()) {
|
|
|
|
case STARTED:
|
|
|
|
started(evt);
|
|
|
|
break;
|
|
|
|
case DONE:
|
|
|
|
done(evt);
|
|
|
|
break;
|
|
|
|
}
|
2007-12-23 19:28:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-06-21 19:24:18 +00:00
|
|
|
public void progress(PropertyChangeEvent evt) {
|
2007-12-23 19:28:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-06-21 19:24:18 +00:00
|
|
|
public void started(PropertyChangeEvent evt) {
|
2007-12-23 19:28:04 +00:00
|
|
|
}
|
2008-06-21 19:24:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
public void done(PropertyChangeEvent evt) {
|
|
|
|
}
|
|
|
|
|
2007-12-23 19:28:04 +00:00
|
|
|
}
|