Skip to content

Commit

Permalink
Merge branch 'master' into feat/inherent-controller-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStegii committed Mar 24, 2024
2 parents a61651c + f29f65b commit 4a0715c
Show file tree
Hide file tree
Showing 52 changed files with 563 additions and 307 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/gradle-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Gradle Dependency Submission

on:
push:
paths:
- '**/*.gradle'
- '.github/workflows/dependencies.yaml'

permissions:
contents: write

jobs:
dependency-submission:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ☕ fulibFx
# ☕ fulibFx
[![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/javadoc.svg?style=for-the-badge&color=green)](https://javadoc.io/doc/org.fulib/fulibFx) ![Java 17/21](https://img.shields.io/github/actions/workflow/status/fujaba/fulibFx/java-ci-cd.yaml?style=for-the-badge&logo=github&color=green) [![GH Pages](https://img.shields.io/badge/GH_Pages-Click_here-green?style=for-the-badge&logo=github)](https://fujaba.github.io/fulibFx)

fulibFx is a versatile framework for JavaFX applications that is specifically designed for MVC pattern projects.
It provides a simple way to create and manage controllers, views, routes, subcomponents, modals, and more.
Expand Down Expand Up @@ -125,7 +126,7 @@ When developing an application, it is often necessary to reload the application
a way to [refresh a controller](docs/features/3-history.md) without having to reload the whole application.
This can be done by calling the `refresh` method

<img width="640" height="360" src="docs/assets/hot-reload.gif">
<img width="640" height="360" src="docs/assets/hot-reload.gif" alt="GIF showing the hot reload feature">

### 🧷 Utilities

Expand Down
10 changes: 3 additions & 7 deletions annotation-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ repositories {

// Project dependencies
dependencies {
// https://mvnrepository.com/artifact/com.google.auto.service/auto-service-annotations
implementation group: 'com.google.auto.service', name: 'auto-service-annotations', version: '1.1.1'
implementation group: 'com.google.auto.service', name: 'auto-service-annotations', version: autoServiceVersion
annotationProcessor group: 'com.google.auto.service', name: 'auto-service', version: autoServiceVersion

// https://mvnrepository.com/artifact/com.google.auto.service/auto-service
annotationProcessor group: 'com.google.auto.service', name: 'auto-service', version: '1.1.1'

// Framework
implementation project(":framework")
implementation project(':framework')
}

// ------------------- Build -------------------
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ allprojects {
'java.awt.headless': 'true',
'testfx.robot': 'glass',
'testfx.headless': 'true',
'headless.geometry': '1920x1080-32',
'glass.platform': 'Monocle',
'monocle.platform': 'Headless',
'prism.order': 'sw',
Expand Down
4 changes: 2 additions & 2 deletions docs/controller/1-controllers.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Controller
# Controller [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/controller/Controller.html)

Controllers are the backbone of your application. To set up a controller, create a class where the controller logic will
be defined and annotate it with `@Controller`.
Expand All @@ -11,7 +11,7 @@ public class TodoController {
}
```

### Events
### Events [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/event/package-summary.html)

Within your controller class, you have the ability to define methods that are automatically triggered when the
controller is initialized, rendered or destroyed. These methods should be annotated with either `@onInit`, `@onRender`
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/10-key-events.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Keyboard Listener
# Keyboard Listener [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/event/onKey.html)

The framework provides an easy way of registering keybinds for a controller. By using the `@onKey` annotation, you can
define methods that will be called when a key is pressed.
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/2-components.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Components
# Components [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/controller/Component.html)

Components are a special type of controller that can be used to create reusable components. Components have to extend
from a JavaFX Parent (or any class extending from Parent) and have to be annotated with `@Component`.
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/4-parameters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Parameters
# Parameters [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/param/package-summary.html)

To pass parameters to a controller, an additional argument can be provided to the show method, consisting of a map of
strings and objects. The strings specify the argument's name and the objects are the value of the argument. For example,
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/5-internationalization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Internationalization
# Internationalization [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/controller/Resource.html)

In order to use resource bundles in your controller's FXML file, you have to provide an instance of the resource bundle to the
framework. This can be done by creating a field containing your instance (e.g. with Dagger) and annotating it with `@Resource`.
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/6-titles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Titles
# Titles [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/controller/Title.html)

The title of a controller or component can be set by annotating The class with `@Title`.
The annotation takes an argument specifying the title of the controller or component.
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/7-routing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Routing
# Routing [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/Route.html)

Routes are the main way to navigate between views. To set up routes to different views, you have to create a class where the
routes will be defined.
Expand Down
2 changes: 1 addition & 1 deletion docs/controller/8-subcomponents.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Subcomponents
# Subcomponents [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/annotation/controller/SubComponent.html)

Components can be used inside other controllers to reduce the complexity of a single controller by moving some features
into subcomponents (also called subcomponents).
Expand Down
2 changes: 1 addition & 1 deletion docs/features/1-subscriber.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Subscriber
# Subscriber [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/controller/Subscriber.html)

By creating a new `Subscriber` instance (or by using dependency injection to provide one) and using its utility methods,
you can easily manage subscriptions without having to worry about disposing them one by one. Using `subscriber.dispose()`
Expand Down
2 changes: 1 addition & 1 deletion docs/features/2-for.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# For-Loops
# For-Loops [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/constructs/FxFor.html)

For-Loops can be used to easily display a node/subcomponent for all items in a list. Whenever an item is added to or
removed from the list, the list of nodes updates accordingly.
Expand Down
2 changes: 1 addition & 1 deletion docs/features/4-modals.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modals
# Modals [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/controller/Modals.html)

Modals are a special type of window that can be used to display a controller on top of another controller. Modals
can be used to display popup windows, dialogs, etc.
Expand Down
2 changes: 1 addition & 1 deletion docs/features/5-node-duplicator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Node duplication
# Node duplication [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/duplicate/Duplicators.html)

As JavaFX by itself doesn't support the duplication of nodes, the framework implements its own duplication logic in the
form of `Duplicator`s. The framework includes duplicators for most of the
Expand Down
12 changes: 6 additions & 6 deletions docs/features/6-data-structures.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Other Data structures
The framework provides a few data structures that can be used to simplify the creation of JavaFX applications.

### Duplicator
### Duplicator [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/duplicate/Duplicators.html)
A `Duplicator` is a functional interface that takes an object and returns a duplicate of the object. It can be used to
create copies of Objects such as JavaFX nodes. The framework used Duplicators for the For-Loops.
For more information, see the section about [Node duplication](5-node-duplicator.md).

### Subscriber
### Subscriber [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/controller/Subscriber.html)
The `Subscriber` is a utility class that can be used to manage subscriptions. It can be used to subscribe to observables
without having to worry about disposing them one by one. For more information, see the section about [subscriptions](1-subscriber.md).

### RefreshableDisposable
### RefreshableDisposable [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/data/disposable/RefreshableDisposable.html)
The `RefreshableDisposable` is an interface defining disposables that can be refreshed. Refreshing a disposable will
make it usable again, after it has been disposed. An example for this is the `RefreshableCompositeDisposable`.

### ItemListDisposable
### ItemListDisposable [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/data/disposable/ItemListDisposable.html)
The `ItemListDisposable` will run an action for all added items upon disposal. This can be used to clean up items in a list
with a certain action in a single disposable.

Expand All @@ -24,14 +24,14 @@ disposable.add("Hello");
disposable.dispose(); // Will print "Hello", "World" and "!" to the console (LIFO order)
```

### TraversableQueue
### TraversableQueue [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/doc/org.fulib/fulibFx/latest/org/fulib/fx/data/TraversableQueue.html)
A `TraversableQueue` is a queue that saves the latest n entries made to it. Like a normal queue, it can be used to store items in a FIFO order.
When the queue is full, the oldest item will be removed. However, it also provides methods to traverse the queue,
meaning you can go back and forth between items in the queue. When you go back in the queue and add a new item, all
items after the current item will be removed. This can be compared to the history of a browser and is used for the
history of routes.

### Either
### Either [![Javadocs](https://javadoc.io/badge2/org.fulib/fulibFx/Javadocs.svg?color=green)](https://javadoc.io/static/org.fulib/fulibFx/0.1.1/org/fulib/fx/data/Either.html)
The `Either` class combines two optionals into a single object. It used to represent a value with two possible types.
The framework uses it for the history, where the `Either` can be either a controller or a route. It has some methods
for checking which type it is and for getting the value correct value.
Expand Down
46 changes: 13 additions & 33 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ plugins {
id "java"
id 'maven-publish'
id 'signing'
// https://plugins.gradle.org/plugin/org.openjfx.javafxplugin
id "org.openjfx.javafxplugin" version "0.1.0"
id "org.openjfx.javafxplugin" version "$javaFxPluginVersion"
}

group = projectGroup
Expand All @@ -22,51 +21,32 @@ repositories {

// JavaFX dependencies
javafx {
version = '21.0.2'
version = javaFxVersion
modules = ['javafx.controls', 'javafx.graphics', 'javafx.fxml', 'javafx.media']
}

// Project dependencies
dependencies {
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation group: 'org.jetbrains', name: 'annotations', version: '24.1.0'
implementation group: 'org.jetbrains', name: 'annotations', version: jetbrainsAnnotationsVersion
implementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: rxJavaVersion

// https://mvnrepository.com/artifact/com.google.dagger/dagger
implementation group: 'com.google.dagger', name: 'dagger', version: '2.51'

// https://mvnrepository.com/artifact/com.google.dagger/dagger-compiler
annotationProcessor group: 'com.google.dagger', name: 'dagger-compiler', version: '2.51'

// https://mvnrepository.com/artifact/io.reactivex.rxjava3/rxjava
implementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.1.8'
implementation group: 'com.google.dagger', name: 'dagger', version: daggerVersion
annotationProcessor group: 'com.google.dagger', name: 'dagger-compiler', version: daggerVersion
}

// ------------------- Tests -------------------

// Test dependencies
dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.1'

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.1'

// https://mvnrepository.com/artifact/org.testfx/testfx-junit5
testImplementation group: 'org.testfx', name: 'testfx-junit5', version: '4.0.17'

// https://mvnrepository.com/artifact/org.hamcrest/hamcrest
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'

// https://mvnrepository.com/artifact/org.testfx/openjfx-monocle
testImplementation group: 'org.testfx', name: 'openjfx-monocle', version: '17.0.10'

// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.11.0'

// https://mvnrepository.com/artifact/com.google.dagger/dagger-compiler
testAnnotationProcessor group: 'com.google.dagger', name: 'dagger-compiler', version: '2.51'
testImplementation group: 'org.testfx', name: 'testfx-junit5', version: testFxVersion
testImplementation group: 'org.testfx', name: 'openjfx-monocle', version: monocleVersion
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: mockitoVersion
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: hamcrestVersion

testAnnotationProcessor group: 'com.google.dagger', name: 'dagger-compiler', version: daggerVersion
}

test {
Expand Down
Loading

0 comments on commit 4a0715c

Please sign in to comment.