Generators implementiert
This commit is contained in:
1 parent
d8454b90de
commit
6ae236facd
10 files changed
+402
-114
No files matched your search
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
|
||||
package bandit.Schnittstelle;
|
||||
|
||||
import bandit.Model.Zahlengenerator;
|
||||
import bandit.View.ZahlenView;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.logging.Logger;
|
||||
import bandit.util.OhmLogger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author le
|
||||
*/
|
||||
public class StartStopController implements ActionListener
|
||||
{
|
||||
private static Logger lg = OhmLogger.getLogger();
|
||||
private ZahlenView view;
|
||||
private Zahlengenerator model;
|
||||
|
||||
public StartStopController(ZahlenView view, Zahlengenerator model)
|
||||
{
|
||||
this.view = view;
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public void registerEvents()
|
||||
{
|
||||
view.getBtnStart().addActionListener(this);
|
||||
view.getBtnStop().addActionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent evt)
|
||||
{
|
||||
if (evt.getSource() == view.getBtnStart())
|
||||
{
|
||||
lg.info("Start");
|
||||
model.start();
|
||||
}
|
||||
else
|
||||
{
|
||||
lg.info("Stop");
|
||||
model.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user