Set up eventbus system

This commit is contained in:
2021-02-19 22:11:33 +01:00
parent 132749eb34
commit fc055382d0
11 changed files with 184 additions and 60 deletions

View File

@@ -3,15 +3,27 @@ package app.controllers;
import java.net.URL;
import java.util.ResourceBundle;
import com.google.common.eventbus.EventBus;
import app.model.Model;
import javafx.fxml.Initializable;
public class MenubarController implements Initializable {
public class MenubarController implements Initializable, Controller {
// TODO: Add component references, and event handlers
private EventBus eventBus;
private Model model;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
// TODO: implement
}
@Override
public void setEventBus(EventBus eventBus) {
this.eventBus = eventBus;
this.eventBus.register(this);
}
/**
* Links the controller to the global model
* @param model The model to be linked
@@ -20,12 +32,5 @@ public class MenubarController implements Initializable {
this.model = model;
}
/**
* Initializes and customizes the properties of the javafx objects.
*/
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
// TODO: implement
}
}