Add EventBus dependency

This commit is contained in:
Oystein Kristoffer Tveit 2021-02-19 16:56:30 +01:00
parent 9cdf806271
commit 0f1bcd3739
3 changed files with 19 additions and 1 deletions

View File

@ -34,3 +34,4 @@ Probably tastes better than any Apple editor and NetBeans combined.
- [FXMisc/RichTextFX](https://github.com/FXMisc/RichTextFX) -> Library for handling rich text and line numbers - [FXMisc/RichTextFX](https://github.com/FXMisc/RichTextFX) -> Library for handling rich text and line numbers
- [richtextfx-demos](https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md) -> Examples and demos of how to use RichTextFX, including [Java Keywords Demo](https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java) - [richtextfx-demos](https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md) -> Examples and demos of how to use RichTextFX, including [Java Keywords Demo](https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java)
- [Pixabay/311788](https://pixabay.com/vectors/bananas-fruits-pair-yellow-bananas-311788/) -> Banana logo - [Pixabay/311788](https://pixabay.com/vectors/bananas-fruits-pair-yellow-bananas-311788/) -> Banana logo
- [Guava Event Bus](https://github.com/google/guava/wiki/EventBusExplained) -> Library for handling communication between controllers

View File

@ -35,6 +35,14 @@
<version>0.10.5</version> <version>0.10.5</version>
</dependency> </dependency>
<!-- Guava Eventbus -->
<dependency>
<groupId>org.sonatype.nexus</groupId>
<artifactId>google-guava-eventbus</artifactId>
<version>3.2.0-01</version>
</dependency>
<!-- JUnit 5 --> <!-- JUnit 5 -->
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>

View File

@ -1,6 +1,9 @@
package app; package app;
import java.io.IOException; import java.io.IOException;
import com.google.common.eventbus.EventBus;
import javafx.application.Application; import javafx.application.Application;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
@ -10,6 +13,8 @@ import javafx.stage.Stage;
public class Main extends Application { public class Main extends Application {
EventBus eventBus;
/** /**
* Boilerplate function to launch the application * Boilerplate function to launch the application
*/ */
@ -40,4 +45,8 @@ public class Main extends Application {
window.setScene(scene); window.setScene(scene);
window.show(); window.show();
} }
public EventBus getEventBus() {
return this.eventBus;
}
} }