Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bgw-gui] Migrate Backend from JavaFX to JCEF with Kotlin/JS #410

Open
wants to merge 222 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
f7631ca
Refactored JavaFX dependencies to be only in builder package.
abouzerda Aug 22, 2023
9361346
Streamlined codebase.
abouzerda Aug 22, 2023
5efb769
Refactored gradle module to jvmMain.
abouzerda Aug 22, 2023
965fd09
Removed Tests.
abouzerda Aug 22, 2023
44a071d
Implemented proof of concept using JavaFX WebView.
abouzerda Aug 22, 2023
4e03ff8
Global CSS Style resets.
abouzerda Aug 22, 2023
ad3f127
Added CameraPane component stub.
abouzerda Aug 23, 2023
ec5e3ac
Refactored project structure.
abouzerda Aug 23, 2023
16bc464
Changed react components package to elements.
abouzerda Aug 23, 2023
d4fdc6a
Added prop data.
abouzerda Aug 23, 2023
ffae495
Added PropData for elements
smilefx Aug 23, 2023
682cb0a
Added first Label and Visual components
smilefx Aug 23, 2023
bc271cd
Switch from data attributes to classNames
smilefx Aug 23, 2023
e680d39
Initial scene paint.
abouzerda Aug 23, 2023
21e3acc
Adjusted ImageVisual
smilefx Aug 23, 2023
0e18bd2
Moved bgw components, animations, core, dialog, event, exception, io,…
abouzerda Aug 23, 2023
a6003a2
Fixed SerializationTest.
abouzerda Aug 23, 2023
c7eb789
App now builds an entire scene
smilefx Aug 23, 2023
d929d55
Changed to BGW Element Tags
smilefx Aug 23, 2023
5cc1de2
Renamed BGW Elements
smilefx Aug 23, 2023
74fefc4
Added Pane
smilefx Aug 23, 2023
aad7284
Added complete JSON Serialization for all components.
abouzerda Aug 23, 2023
f02d722
Added HexagonView
smilefx Aug 23, 2023
fb5fee1
Added HexagonGrid and replaced all standard elements
smilefx Aug 23, 2023
7907fff
Working draft of imageVisual
smilefx Aug 24, 2023
98f4d88
Event binding.
abouzerda Aug 24, 2023
91a36e5
JCEF Integration.
abouzerda Aug 24, 2023
9d7eb02
Merge branch 'two-way-binding' into event-two-way-binding
smilefx Aug 24, 2023
149a112
Implemented CameraPane
smilefx Aug 25, 2023
983f1cb
Removed unnecessary prints
smilefx Aug 25, 2023
0e3491e
Added CompoundVisuals and filled ComponentMapper
smilefx Aug 26, 2023
07da288
Added TextVisual
smilefx Aug 26, 2023
f3d8729
Added Style experiments (incl. BorderRadius)
smilefx Aug 26, 2023
30b0a0f
Refactored.
abouzerda Aug 25, 2023
597601b
Added WebViewType flag in constants.
abouzerda Aug 25, 2023
4700a04
Implemented event dispatching for JCEF.
abouzerda Aug 26, 2023
b063e7f
Implemented event dispatching for JCEF.
abouzerda Aug 26, 2023
5de37a6
Added Filter and Flip experiments to Visuals
smilefx Aug 26, 2023
de2d050
Merge branch 'event-two-way-binding' of https://github.com/abouzerda/…
smilefx Aug 26, 2023
c1a18bb
Added example for Visual styles, filters and flipping
smilefx Aug 26, 2023
50bbbe8
Added "bgwLoaded" as internal LoadEvent.
abouzerda Aug 26, 2023
fc5d4a9
Added local imageVisual support.
abouzerda Aug 26, 2023
e959482
Added all BGW to React bindings.
abouzerda Aug 27, 2023
8cf353a
Added React mouse event -> BGW binding
abouzerda Aug 27, 2023
a34c96f
Added Area and TokenView
smilefx Aug 27, 2023
ba18955
Merge branch 'event-two-way-binding' of https://github.com/abouzerda/…
smilefx Aug 27, 2023
392f18a
Added LinearLayout and Alignment
smilefx Aug 27, 2023
5985c6b
Added TextField
smilefx Aug 27, 2023
791786a
Added ComboBox
smilefx Aug 27, 2023
92f8d7a
Added GridPane component.
abouzerda Aug 27, 2023
0c5d34a
Added Alignment for GridPaneElements.
abouzerda Aug 27, 2023
7a8d647
Fixed FontSize of Buttons
smilefx Aug 27, 2023
6c89337
Added component level updating instead of updating the whole scene.
abouzerda Aug 27, 2023
6b95d4f
Made updateScene internal again.
abouzerda Aug 27, 2023
ee76819
Added Updating Hooks
smilefx Aug 27, 2023
0587856
Added state for UIComponents and LayoutViews.
abouzerda Aug 27, 2023
17c9f25
Added Handlers for Visuals
smilefx Aug 27, 2023
eb7ec64
Added Visual data handlers.
abouzerda Aug 27, 2023
0a93089
Added handler invoke for VisualData.
abouzerda Aug 27, 2023
7333934
Added Font Loading
smilefx Aug 28, 2023
19fac01
Adjust REM Units to be responsive for width > height
smilefx Aug 28, 2023
67c6adb
Fixed opacities
smilefx Aug 28, 2023
a5534c5
Fixed Visual updates.
abouzerda Aug 28, 2023
ece2b9d
Added Font to GridGameScene.
abouzerda Aug 28, 2023
324cccd
Correctly positioned HexagonViews in HexagonGrid
smilefx Aug 28, 2023
c699f4a
Changed HexagonView to smaller Float value
smilefx Aug 28, 2023
af3a7b9
Reset NodeBuilder for Button
smilefx Aug 28, 2023
1f17d0f
Added periodic GUI updates.
abouzerda Aug 28, 2023
5835eb6
Removed useState from components.
abouzerda Aug 28, 2023
65212c4
Added icon and clearedEventListeners before Scene build.
abouzerda Aug 28, 2023
0718773
Changed to Int for positions and sizes
smilefx Aug 29, 2023
d9324f5
Added clickhandlers
smilefx Aug 29, 2023
6d5a20e
Exponential Zoom
smilefx Sep 1, 2023
c1034ab
Updated Camera Pane state from React to BGW.
abouzerda Sep 1, 2023
36521b2
Mapping right click of components to MouseEvent.
abouzerda Sep 1, 2023
9cc4df5
Implemented run on gui thread.
abouzerda Sep 1, 2023
4f7591a
Improved CameraPane
smilefx Oct 6, 2023
5507a72
CameraPane Zoom now works exponentially
smilefx Oct 7, 2023
ae05b75
Fixed ComboBox Format function
smilefx Oct 7, 2023
b00fc13
Added test menu scene with opacity and blur radius.
abouzerda Oct 7, 2023
8c01ea3
Added support for menuScenes.
abouzerda Oct 7, 2023
18deea5
Added Animator.
abouzerda Oct 7, 2023
0e96bdd
Added AnimationData ComponentAnimationData and FadeAnimationData
abouzerda Oct 7, 2023
4880b31
Added remaining animations.
abouzerda Oct 7, 2023
422f22a
Implemented FadeAnimation as Animation Proof-of-concept
smilefx Oct 7, 2023
abe2d2a
Added MoveAnimation Proof-of-Concept
smilefx Oct 7, 2023
e643d22
Added FadeAnimation to MenuScene
smilefx Oct 8, 2023
34d6cc9
Refactored common package
smilefx Oct 8, 2023
01cc485
Refactored animations to use mapper
smilefx Oct 8, 2023
205cf80
Added sample Drag&Drop Scene
abouzerda Oct 12, 2023
514322e
Added FlipAnimation
smilefx Oct 12, 2023
28f8014
Merge branch 'event-two-way-binding' of https://github.com/abouzerda/…
smilefx Oct 12, 2023
c0eea65
Added Parallel and Sequential Animations
smilefx Oct 14, 2023
0105d25
Added CheckBox and ProgressBar
smilefx Oct 17, 2023
4da0385
Added RandomizeAnimation
smilefx Nov 7, 2023
190bdd7
Added DiceView & DiceAnimation
smilefx Nov 7, 2023
ff081ec
DialogHandler Polyfill
smilefx Nov 7, 2023
7c5be30
Added DialogTests
smilefx Nov 7, 2023
7932947
Calling back to BGW for drag and drop gesture.
abouzerda Oct 13, 2023
143a9ae
Added Animation on Finished call.
abouzerda Nov 7, 2023
e4f5e1b
Added DiceView & DiceAnimation
smilefx Nov 7, 2023
f213e3c
Added callback to dice animations
abouzerda Nov 7, 2023
7409552
Fixed animation id json serialization.
abouzerda Nov 7, 2023
94e3a57
Added Dialogs and Error Handler
smilefx Nov 8, 2023
fb4c58f
Added CardView, CardStack and offset for visuals
smilefx Nov 27, 2023
304274b
Fixed SequentialAnimation not having a transition property
smilefx Mar 8, 2024
8937065
Added dynamic sizing for all scene ratios
smilefx Mar 8, 2024
42e1921
Updated dependencies to newer pre-release versions
smilefx Jun 20, 2024
d3d69f1
Changed JVM Toolchain Version
smilefx Jun 21, 2024
f875ca6
[bgw-gui] Commented PropData.kt
abouzerda Jun 21, 2024
31f6a21
[bgw-gui] Added previous BuildSrc and gradle module structure back.
abouzerda Jun 21, 2024
1f02d56
Merge branch 'new-backend' into main-github
abouzerda Jun 27, 2024
5e54e72
Refactored pseudo javafx style attributes internal usage to actual bg…
abouzerda Jun 27, 2024
a4f4c0c
Refactored java awt color usage to bgw color.
abouzerda Jun 27, 2024
8a78217
Removed obsolete JavaFX builder component ZoomableScrollPane
abouzerda Jun 27, 2024
dd10d46
Removed integration SerializationTest.kt from common package to avoid…
abouzerda Jun 27, 2024
6033021
Re-added BidirectionalMap tests.
abouzerda Jun 27, 2024
a76218a
Added BufferedImage constructor to ImageVisual.
abouzerda Jul 18, 2024
2ea66d5
Removed logging, defaulted to JCEF and chose available port
smilefx Jul 24, 2024
18900a0
Added more component attributes
smilefx Aug 2, 2024
7741afe
Fixed inheritance
smilefx Aug 2, 2024
cb55b6d
Added layoutFromCenter and indeterminate
smilefx Aug 6, 2024
3df5a2f
Added ColorPicker, PasswordField and TextArea
smilefx Aug 8, 2024
87055e9
Added ToggleGroup, ToggleButton and RadioButton
smilefx Aug 8, 2024
577b088
Added TableView and ListView
smilefx Aug 9, 2024
c38ad6a
Merge branch 'kotlin-2.0.0' into website
smilefx Aug 9, 2024
fca8e8d
Merge remote-tracking branch 'origin/kotlin-2.0.0' into new_backend
smilefx Aug 9, 2024
b09b212
Fixed gradle build problems
smilefx Aug 9, 2024
ba79705
Fixed CardStack positioning
smilefx Aug 9, 2024
be5ce9f
Removed Todos and added fallback port
smilefx Aug 9, 2024
885a38d
Updated spotless for examples
smilefx Aug 14, 2024
3922de7
Updated alignments
smilefx Aug 14, 2024
9f35222
Merge branch 'new_backend' of https://github.com/tudo-aqua/bgw into n…
smilefx Aug 14, 2024
096d094
Fixed issues preventing `buildSrc` from running correctly and resolve…
abouzerda Aug 14, 2024
cf58f40
Fixed CameraPane interactivity
smilefx Aug 19, 2024
5724826
Added optional use of Sockets
smilefx Aug 29, 2024
2407b00
Fixed text sizes causing weird behavior
smilefx Aug 29, 2024
369514a
Fixed spacing of linear layouts
smilefx Oct 18, 2024
2953708
Fixed versioning
smilefx Oct 31, 2024
efb18d1
Removed yarn.lock from repo
smilefx Oct 31, 2024
aad1f80
Added jvm variant import for project gradle dependencies to bgw-gui
abouzerda Oct 31, 2024
45bf15e
spotless applied on build.gradle.kts files.
abouzerda Oct 31, 2024
5ea4b76
Updated no-socket usages
smilefx Nov 4, 2024
a2574c4
Added kdoc configuration also to multiplatform convention.
abouzerda Nov 5, 2024
bf787ae
Minor fixes
smilefx Nov 5, 2024
c78a179
Removing processes after run cancellation
smilefx Nov 6, 2024
b6f5ecd
Added new drag'n drop implementation
smilefx Nov 12, 2024
d4c354c
Disabled JCEF logs
smilefx Nov 13, 2024
81740e0
Fixed killing jcef processes
smilefx Nov 13, 2024
b8bedbf
Fixed dropAcceptor
smilefx Nov 14, 2024
8376c1e
Handled yarn.lock mismatch
smilefx Nov 15, 2024
3492976
Added pointer cursor to draggable components
smilefx Nov 15, 2024
2417e5d
Fixed placeholder colors
smilefx Nov 20, 2024
8f3f53e
Added additional mouse events
smilefx Nov 20, 2024
e0e8808
Proof-of-concept adding droppable to all components
smilefx Nov 22, 2024
af0ccdd
Added dropAcceptor to all available ComponentViews
smilefx Nov 25, 2024
ad6c80f
Added missing drag-drop-events
smilefx Nov 26, 2024
e28be96
Merge branch 'new_backend' of https://github.com/tudo-aqua/bgw into n…
smilefx Nov 26, 2024
ae0f51e
Added multiple events
smilefx Nov 26, 2024
73c55db
Added scene event listeners
smilefx Nov 26, 2024
ebf4cb2
Added HexOrientation
smilefx Nov 26, 2024
63a36bf
Bumped version of JCEF
smilefx Nov 27, 2024
6af1f34
Changed download handler to display custom message without red error …
smilefx Nov 27, 2024
dffc299
Made functions, classes and objects internal
smilefx Nov 28, 2024
e7a1c8a
Version bump to kotlinx.serialization
smilefx Nov 28, 2024
4de855a
Added additional styling for visuals
smilefx Nov 30, 2024
96947c3
Fixed font loading
smilefx Nov 30, 2024
46bbb7f
Slight changes to documentation
smilefx Nov 30, 2024
4177fef
Added fix for pane not expanding
smilefx Nov 30, 2024
40850f0
Fixed DnD into camera pane components
smilefx Dec 3, 2024
b476bc5
Fixed missing parent hierarchy for CameraPane
smilefx Dec 4, 2024
cd290f8
Minor additions to DnD
smilefx Dec 4, 2024
f98de05
Fixed dragged components becoming invisible
smilefx Dec 4, 2024
5a80e69
Moved runtime installation to build folder
smilefx Dec 4, 2024
30d543d
Added fallback for Font Color
smilefx Dec 4, 2024
6779991
Added snapshot version logging
smilefx Dec 4, 2024
f8c3b46
Made internals internal
smilefx Dec 6, 2024
09fbc1e
Changed to use local install directory
smilefx Dec 10, 2024
4157383
Changed install path on macOS and added fallback for Linux
smilefx Dec 10, 2024
c167736
Streamlined install directory
smilefx Dec 10, 2024
3a73bcb
Changed to use cacheDir
smilefx Dec 10, 2024
62f8ab3
More internals....
smilefx Dec 13, 2024
ab973c4
Removed ambiguity from ColorVisual constructors
smilefx Dec 19, 2024
ab0b9d5
Added missing CameraPane features
smilefx Dec 30, 2024
acc4a98
Massive refactor of commonMain to better match jvmMain
smilefx Jan 5, 2025
14f976f
Correctly documented Animations
smilefx Jan 5, 2025
da4502c
Correctly documented Containers
smilefx Jan 5, 2025
10a91cb
Changed default behavior of CameraPane
smilefx Jan 6, 2025
4fa904c
Added alternative CameraPane behavior without limiting bounds
smilefx Jan 6, 2025
15b2606
Made properties internal to avoid confusion
smilefx Jan 6, 2025
364f605
Added event listeners matching internal properties
smilefx Jan 7, 2025
8d49ddf
Refactored iterables in Containers
smilefx Jan 7, 2025
87bad1e
Configured spotless
smilefx Jan 7, 2025
5ab77bd
Correctly documented GameComponentViews
smilefx Jan 7, 2025
b65cc00
Fixes for scenes not showing
smilefx Jan 7, 2025
72deaa0
Correctly documented LayoutViews
smilefx Jan 7, 2025
064a1ee
Removed ß from KeyCodes
smilefx Jan 7, 2025
c96d621
Added tasks for generating samples in docs
smilefx Jan 9, 2025
982b72b
Changed the hexagon size to be adjustable
smilefx Jan 10, 2025
07ffced
Fixed ComponentAnimations
smilefx Jan 10, 2025
1fe417b
Added animation example test
smilefx Jan 13, 2025
540e00b
Replaced onScroll event with onWheel
smilefx Jan 14, 2025
2af7e1d
Fixed bgw-examples not compiling with new backend
smilefx Jan 16, 2025
0ec285b
Added FileDialog
smilefx Jan 19, 2025
f170021
Added different message handling
smilefx Jan 20, 2025
1f1542f
Removed logs
smilefx Jan 20, 2025
12d48bb
Fixed ActionProps not being consistent
smilefx Jan 21, 2025
10acf6f
Added dialog tests
smilefx Jan 21, 2025
42a4236
Added missing listeners to dropAcceptor
smilefx Jan 23, 2025
6bdb21e
Scroll and EventHandler fixes
smilefx Jan 26, 2025
edb0319
Small changes to fix ui refreshes that go missing
smilefx Jan 28, 2025
0d5d431
Replaced version 1.0 to 0.10
smilefx Jan 30, 2025
555d231
Some version annotations
smilefx Jan 30, 2025
84f6f1a
Added DragEndEvent
smilefx Jan 31, 2025
7d7c9a8
Changed to a single drop target based on zIndex approach
smilefx Jan 31, 2025
a3a4f32
Smaller fixes to layouts
smilefx Feb 1, 2025
4daaa3c
Added more fixes to UIComponents
smilefx Feb 1, 2025
96edb2b
Readded ability to drag-and-drop Containers based on Docs
smilefx Feb 2, 2025
de504fe
Added standalone listening for isDraggable
smilefx Feb 2, 2025
a4ff681
Multiple fixes regarding satchels
smilefx Feb 2, 2025
01f7ab2
Fixed compilation errors
smilefx Feb 5, 2025
9f10a77
[bgw-docs] Add docs for new JCEF Backend (#413)
smilefx Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
- name: Generate Page
uses: gradle/gradle-build-action@v2
with:
arguments: :bgw-docs:jekyllBuild
arguments: :bgw-docs:docsBuild

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: bgw-docs/build/jekyll
single-commit: true
folder: bgw-docs/website/dist
single-commit: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ modules.xml
hs_err_pid*

### Kotlin ###
.kotlin/
# Compiled class file

# Log file
Expand Down Expand Up @@ -219,9 +220,14 @@ $RECYCLE.BIN/
webpack.generated.js
generated-flow-imports.js
/.run/
/bgw-gui/jcef-bundle/

# Yekyll generated assets
_site/

# Ruby Gemfile lock
Gemfile.lock

bgw-gui/src/jsMain/kotlin/tools/aqua/bgw/Config.kt
bgw-gui/src/jvmMain/kotlin/tools/aqua/bgw/application/Config.kt
/kotlin-js-store/
103 changes: 97 additions & 6 deletions bgw-docs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024 The BoardGameWork Authors
* Copyright 2025 The BoardGameWork Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,10 +15,101 @@
* limitations under the License.
*/

plugins { id("tools.aqua.bgw.jekyll-conventions") }
import com.github.gradle.node.yarn.task.YarnTask
import io.ktor.http.*

dependencies {
includedKDoc(project(":bgw-gui", "kdoc"))
includedKDoc(project(":bgw-net:bgw-net-client", "kdoc"))
includedKDoc(project(":bgw-net:bgw-net-common", "kdoc"))
/*
* Copyright 2025 The BoardGameWork Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("tools.aqua.bgw.base-conventions")
id("com.github.node-gradle.node") version "7.1.0"
}

node {
version.set("20.17.0")
download.set(true)
nodeProjectDir.set(projectDir.resolve("website"))
}

tasks.register<GradleBuild>("docsBuild") {
group = "documentation"
tasks =
listOf(
":bgw-docs:website:buildAndCopyRuntimeTask",
":bgw-docs:parser:buildAndCopySamplesTask",
":bgw-docs:parser:buildAndCopyDokkaJson",
"yarnPreDeploy")
}

tasks.register("yarnInstall", YarnTask::class) {
group = "yarn"
args.set(listOf("install"))
}

tasks.register("yarnPreDeploy", YarnTask::class) {
dependsOn("yarnInstall")
group = "yarn"
args.set(listOf("predeploy"))
}

tasks.register("docsServe", YarnTask::class) {
dependsOn("docsBuild", "yarnInstall")
this.group = "documentation"
args.set(listOf("run", "dev"))
}

val wrappersVersion = "-pre.831"
val USE_SOCKET_DEFAULT = true
val GENERATE_SAMPLES_DEFAULT = false

fun buildPropertyFile() {
val propertyFile = "Config.kt"
rootDir.resolve("bgw-gui/src/jsMain/kotlin/tools/aqua/bgw/${propertyFile}").apply {
println("Generate properties into $absolutePath")
parentFile.mkdirs()
writeText(generateProperties())
}

rootDir.resolve("bgw-gui/src/jvmMain/kotlin/tools/aqua/bgw/application/${propertyFile}").apply {
println("Generate properties into $absolutePath")
parentFile.mkdirs()
writeText(generateProperties("application"))
}

val useSockets = project.findProperty("useSockets")?.toString()?.toBoolean() ?: USE_SOCKET_DEFAULT
val generateSamples =
project.findProperty("generateSamples")?.toString()?.toBoolean() ?: GENERATE_SAMPLES_DEFAULT

println("useSockets: $useSockets")
println("generateSamples: $generateSamples")
}

fun generateProperties(suffix: String = ""): String {
val useSockets = project.findProperty("useSockets")?.toString()?.toBoolean() ?: USE_SOCKET_DEFAULT
val generateSamples =
project.findProperty("generateSamples")?.toString()?.toBoolean() ?: GENERATE_SAMPLES_DEFAULT
return """
package tools.aqua.bgw${if (suffix.isNotEmpty()) ".$suffix" else ""}

internal object Config {
val USE_SOCKETS = $useSockets
val GENERATE_SAMPLES = $generateSamples
val BGW_VERSION = "${rootProject.version}"
}
""".trimIndent()
}
3 changes: 3 additions & 0 deletions bgw-docs/parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/example/
/output/
Loading
Loading