Created
October 24, 2014 15:51
-
-
Save cfierbin/f0102ce5e555cc3f349b to your computer and use it in GitHub Desktop.
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" )); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment