You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StartStopController.java 883B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package subscriber;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9. /**
  10. *
  11. * @author le
  12. */
  13. public class StartStopController implements ActionListener
  14. {
  15. private SubscriberView view;
  16. private Datenmodell3 model;
  17. public StartStopController(SubscriberView view, Datenmodell3 model)
  18. {
  19. this.view = view;
  20. this.model = model;
  21. }
  22. public void registerEvents()
  23. {
  24. view.getBtnStart().addActionListener(this);
  25. view.getBtnStop().addActionListener(this);
  26. }
  27. @Override
  28. public void actionPerformed(ActionEvent evt)
  29. {
  30. if (evt.getSource() == view.getBtnStart())
  31. {
  32. model.start();
  33. }
  34. else
  35. {
  36. model.stop();
  37. }
  38. }
  39. }