transformed Plugin class to Interface with default methods
This commit is contained in:
@@ -11,14 +11,14 @@ import ch.psi.utils.swing.SwingUtils;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TestPlugin extends Plugin{
|
||||
public class TestPlugin implements Plugin{
|
||||
MainPanel panel;
|
||||
@Override
|
||||
protected void onStart() {
|
||||
public void onStart() {
|
||||
panel = new MainPanel(){
|
||||
protected void run(String name){
|
||||
try {
|
||||
TestPlugin.this.run(name);
|
||||
TestPlugin.this.runAsync(name);
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(panel, ex);
|
||||
}
|
||||
@@ -29,16 +29,16 @@ public class TestPlugin extends Plugin{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
public void onStop() {
|
||||
|
||||
}
|
||||
|
||||
protected void onStateChange(State state, State former){
|
||||
public void onStateChange(State state, State former){
|
||||
panel.setState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitialize(int runCount){
|
||||
public void onInitialize(int runCount){
|
||||
panel.setDevice(getDevice("motor"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user