diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 0000000..039ddbf
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,57 @@
+# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+name: Maven
+
+on:
+ workflow_dispatch:
+
+
+jobs:
+ build-ubuntu:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 23
+ uses: actions/setup-java@v4
+ with:
+ java-version: '23'
+ distribution: 'temurin'
+ cache: maven
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
+ - name: Update dependency graph
+ uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
+
+ - name: Run J-Link
+ run: javafx:jlink -f pom.xml
+
+ build-windows:
+ runs-on: windows
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 23
+ uses: actions/setup-java@v4
+ with:
+ java-version: '23'
+ distribution: 'temurin'
+ cache: maven
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
+ - name: Update dependency graph
+ uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
+
+ - name: Run J-Link
+ run: mvn javafx:jlink -f pom.xml
diff --git a/README.md b/README.md
index 397b277..317e3cc 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,13 @@
-# Make your own app! - [appName]
+# Make your own app! - Yet Another Collaborative Whiteboard App
## What is it ?
-@torineos and @akomry's submission to `Make your own app!` game jam.
-Probably a networking or multimedia app or something.
+@akomry's submission to `Make your own app!` game jam.
+
+Basically, this is an online drawing app. It only has the most basic tools for now, pen and eraser with custom color, but I hope to be able to add more.
## Dependencies
-You need at least **[Java 23](https://adoptium.net/temurin/releases/?version=23)** up and running.
+Probably **[Java 23](https://adoptium.net/temurin/releases/?version=23)** up and running.
## Installation guide
@@ -16,14 +17,20 @@ install a packaged zipped file. Then execute `[extract dir]/bin/app`.
## -Roadmap-
- [x] Brainstorming
-- [ ] Find a name
-- [ ] List issues
-
+- [x] Find a name
+- [x] List issues
+- [x] Experiment with javafx Canvas
+- [x] Implement Canvas creation
+- [x] Implement TCP/IP server/client
+- [x] Implement event callback
+- [x] Implement brush, its size and color
+- [x] Implement eraser
+- [ ] Implement zoom control (WIP, sketchy zoom)
+- [ ] Implement layering system
## License
TBD
## Contributors
-* @torineos
* @akomry
\ No newline at end of file
diff --git a/graphical-app/pom.xml b/graphical-app/pom.xml
index a1db254..6c8253f 100644
--- a/graphical-app/pom.xml
+++ b/graphical-app/pom.xml
@@ -9,20 +9,22 @@
1.0-SNAPSHOT
graphical-app
+
UTF-8
-5.10.0
+ 5.10.0
+
org.openjfx
javafx-controls
- 17.0.6
+ 24
org.openjfx
javafx-fxml
- 17.0.6
+ 24
@@ -36,14 +38,30 @@
junit-jupiter-engine
${junit.version}
test
-
+
+
+ org.controlsfx
+ controlsfx
+ 11.2.2
+
+
+ net.synedra
+ validatorfx
+ 0.5.1
+
+
+ org.json
+ json
+ 20240303
+
+
org.apache.maven.plugins
maven-compiler-plugin
- 3.11.0
+ 3.14.0
23
23
@@ -55,10 +73,9 @@
0.0.8
-
default-cli
- fr.emiko.graphicalapp/fr.emiko.graphicalapp.HelloApplication
+ fr.emiko.graphicalapp/fr.emiko.graphicalapp.DrawApplication
app
app
app
diff --git a/graphical-app/src/main/java/fr/emiko/graphicalapp/DrawApplication.java b/graphical-app/src/main/java/fr/emiko/graphicalapp/DrawApplication.java
new file mode 100644
index 0000000..81eb4dc
--- /dev/null
+++ b/graphical-app/src/main/java/fr/emiko/graphicalapp/DrawApplication.java
@@ -0,0 +1,27 @@
+package fr.emiko.graphicalapp;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.stage.Stage;
+
+import javax.imageio.ImageIO;
+import java.io.IOException;
+import java.util.Objects;
+
+public class DrawApplication extends Application {
+ @Override
+ public void start(Stage stage) throws IOException {
+ FXMLLoader fxmlLoader = new FXMLLoader(DrawApplication.class.getResource("draw-view.fxml"));
+ Scene scene = new Scene(fxmlLoader.load(), 1280, 720);
+ stage.setTitle("Yet Another Collaborative Drawing App");
+ stage.getIcons().add(new Image(Objects.requireNonNull(getClass().getResourceAsStream("icon.png"))));
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public static void main(String[] args) {
+ launch();
+ }
+}
\ No newline at end of file
diff --git a/graphical-app/src/main/java/fr/emiko/graphicalapp/DrawController.java b/graphical-app/src/main/java/fr/emiko/graphicalapp/DrawController.java
new file mode 100644
index 0000000..96d5477
--- /dev/null
+++ b/graphical-app/src/main/java/fr/emiko/graphicalapp/DrawController.java
@@ -0,0 +1,491 @@
+package fr.emiko.graphicalapp;
+
+import fr.emiko.graphicsElement.Line;
+import fr.emiko.graphicsElement.layerListViewCell;
+import fr.emiko.net.DrawClient;
+import fr.emiko.net.DrawServer;
+import fr.emiko.net.Event;
+import fr.emiko.net.User;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.fxml.FXMLLoader;
+import javafx.fxml.Initializable;
+import javafx.scene.Scene;
+import javafx.scene.canvas.Canvas;
+import javafx.scene.control.*;
+import javafx.scene.canvas.GraphicsContext;
+import javafx.scene.effect.BoxBlur;
+import javafx.scene.input.*;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.Priority;
+import javafx.scene.paint.Color;
+import fr.emiko.graphicsElement.Stroke;
+import javafx.scene.transform.Scale;
+import javafx.stage.Modality;
+import javafx.stage.Stage;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class DrawController implements Initializable {
+ private final Pattern hostPortPattern = Pattern.compile("^([-.a-zA-Z0-9]+)(?::([0-9]{1,5}))?$");
+ public Canvas drawingCanvas;
+ public MenuItem saveButton;
+ public MenuItem loadButton;
+ public MenuItem newCanvasButton;
+ public Slider brushSizeSlider;
+ public ScrollPane scrollPane;
+ public Label brushSizeLabel;
+ public Pane pane;
+ public MenuItem hostButton;
+ public MenuItem joinButton;
+ public MenuItem disconnectButton;
+ public SplitPane mainPane;
+ public MenuItem stopHostButton;
+ public ColorPicker colorPicker;
+ public ListView