This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Controller implements BidListener{ | |
//Bid emulator | |
private static BidEmulator bidEmulator; | |
@FXML | |
TextArea simulatorConsole; | |
@FXML | |
private void handleStartSimulationButtonClicked(ActionEvent ae){ | |
//Initialize bid emulator | |
bidEmulator = new BidEmulator(); | |
//Register this class as a listener | |
bidEmulator.addListener(this); | |
//start bidding process emulation | |
Timer timer = new Timer(); | |
timer.scheduleAtFixedRate(bidEmulator, 0, 100); | |
} | |
@Override | |
public void bidEvent(Bid bid) { | |
Platform.runLater(() -> simulatorConsole.setText(simulatorConsole.getText() +"Received a new bid!\n" )); | |
} | |
} |
No comments:
Post a Comment