Skip to content

Commit e507037

Browse files
committed
Merge branch 'dev' into alpha
2 parents 12e0259 + 3ad54dd commit e507037

5 files changed

Lines changed: 76 additions & 70 deletions

File tree

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy
2+
on: [push]
3+
4+
jobs:
5+
deploy:
6+
name: Deploy
7+
runs-on: ubuntu-latest
8+
# Only run one job a time to avoid conflicts
9+
concurrency: ci-${{ github.ref }}
10+
# This permission may be required to grant access for the Action to push tags
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Increment version
18+
id: increment-version
19+
uses: RichardInnocent/semantic-versioning-git@v0.0.1
20+
21+
# Everything below here shows how you might use the results of the action...
22+
23+
- name: Print if version changed
24+
if: steps.increment-version.outputs.previous-version != steps.increment-version.outputs.new-version
25+
run: echo "The new version is now $new_version"
26+
env:
27+
new_version: ${{ steps.increment-version.outputs.new-version }}
28+
29+
# See more
30+
# https://github.com/marketplace/actions/semantic-versioning-git

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
# DashboardFx
22

3-
[![News](https://img.shields.io/badge/News-2-brightgreen.svg?style=for-the-badge)](NEWSLETTER.md)
3+
[![News](https://img.shields.io/badge/Newsletter-brightgreen.svg?style=for-the-badge)](NEWSLETTER.md)
44
[![License](https://img.shields.io/github/license/gleidsonmt/DashboardFx.svg?style=for-the-badge)](https://github.com/gleidsonmt/DashboardFX/blob/alpha/LICENSE.txt)
5-
6-
[//]: # (![Version](https://img.shields.io/badge/Version-0.3.22-green.svg?style=for-the-badge))
7-
[//]: # ([![Release](https://img.shields.io/badge/Release-v2.2.25-green.svg?style=for-the-badge)](https://github.com/gleidsonmt/GNDecorator/releases/tag/2.1.25))
8-
[//]: # (![Build](https://img.shields.io/badge/Build-2.2.24+258-gold.svg?style=for-the-badge))
5+
![Build](https://img.shields.io/github/v/tag/gleidsonmt/DashboardFx.svg?color=gray&label=Version&style=for-the-badge)
96

107

118

129
<p style="text-align: center">
13-
<img src="./screen.png" alt="dashboard_screenshot"/>
10+
<img src="./screenshots/dash-2.png" alt="dashboard_screenshot"/>
1411
</p>
1512

1613
<!-- TOC -->

build.gradle

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import groovy.lang.GroovyClassLoader
2-
31
plugins {
42
id 'java'
53
id 'application'
@@ -8,31 +6,14 @@ plugins {
86
id 'org.beryx.jlink' version '2.25.0'
97
}
108

11-
Properties props = new Properties()
12-
File file = new File('./app.properties')
13-
props.load(file.newDataInputStream())
14-
println(props.getProperty("app.version.build"))
15-
169
group 'io.github.gleidsonmt'
17-
// 1 lancamento completo
18-
// 2 merge on dev
19-
// 3 artifact build
20-
// 4 build locally
21-
22-
// version 1.2.3.4
23-
version + props.get("app.version.major") + props.get("app.version.minor") + props.get("app.version.artifact") + props.get("app.version.build")
2410

2511
repositories {
2612
mavenCentral()
2713
}
2814

29-
3015
ext {
3116
junitVersion = '5.10.2'
32-
props.setProperty "app.version.build", (props.getProperty("app.version.build") as int + 1).toString();
33-
props.store(file.newWriter(), null)
34-
props.load(file.newDataInputStream())
35-
println "Storing Properties."
3617
}
3718

3819
tasks.withType(JavaCompile).configureEach {
@@ -45,7 +26,6 @@ application {
4526
}
4627

4728
subprojects {
48-
// Thanks GOD!
4929
tasks.configureEach { task ->
5030
if (task.name.contains("run")) {
5131
task.enabled = false
@@ -61,18 +41,14 @@ javafx {
6141

6242
dependencies {
6343
implementation files('vendor/colors-1.0.jar');
64-
// runtimeOnly files("vendor/scenicview.jar")
65-
6644
implementation 'org.jetbrains:annotations:24.0.1'
67-
// implementation group: 'org.yaml', name: 'snakeyaml', version: '2.2'
6845

6946
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
7047
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
7148

7249
implementation project(":blockcode")
7350
implementation project(":glad")
7451
implementation project(":presentation")
75-
7652
}
7753

7854
distTar {
@@ -94,7 +70,7 @@ jlink {
9470
launcher {
9571
name = 'DashboardFx'
9672
}
97-
forceMerge("org.scenicview")
73+
// forceMerge("org.scenicview")
9874

9975
jpackage {
10076

src/main/java/io/github/gleidsonmt/dashboardfx/App.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ public class App extends Application {
2020
public void start(Stage stage) throws Exception {
2121
Root root = new Root(new Main());
2222
Scene scene = new Scene(root, 1200,800);
23+
2324
stage.setScene(scene);
2425
stage.setMinWidth(400);
2526
stage.setMinHeight(600);
2627
stage.setMaximized(true);
28+
2729
ThemeProvider.install(scene, Font.POPPINS, Font.INSTAGRAM);
2830
ThemeProvider.install(scene, Css.DEFAULT, Css.BUTTON,
2931
Css.SHAPES, Css.CONTEXT_MENU,
@@ -42,9 +44,7 @@ public void start(Stage stage) throws Exception {
4244
stage.getIcons().add(Assets.getImage("logo_128.png"));
4345
stage.show();
4446

45-
// LibrariesTools.listenCss(stage.getScene());
46-
LibrariesTools.showScenicView(stage.getScene());
47-
LibrariesTools.listenCss(stage.getScene());
47+
LibrariesTools.addTools(stage.getScene());
4848

4949
}
5050
}

src/main/java/io/github/gleidsonmt/dashboardfx/LibrariesTools.java

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package io.github.gleidsonmt.dashboardfx;
22

3-
import javafx.application.Platform;
43
import javafx.scene.Scene;
4+
import javafx.scene.control.Label;
5+
import javafx.scene.layout.StackPane;
6+
import javafx.stage.Stage;
57

68
import java.io.File;
79
import java.lang.reflect.InvocationTargetException;
@@ -11,55 +13,56 @@
1113

1214

1315
/**
16+
* Used only in runtime as tool to help development.
17+
*
1418
* @author Gleidson Neves da Silveira | gleidisonmt@gmail.com
1519
* Create on 27/08/2025
1620
*/
17-
public class LibrariesTools {
21+
public final class LibrariesTools {
1822

19-
public static void showScenicView(Scene scene) {
20-
if (scene == null) return;
23+
private static Class<?> loadClassJar(String jarDirectory, String fullClass) {
24+
Class<?> cls = null;
2125
try {
22-
// ... inside a method or class
23-
File jarFile = new File("./vendor/scenicview.jar");
24-
URL[] urls = { jarFile.toURI().toURL() };
26+
File jarFile = new File(jarDirectory);
27+
if (!jarFile.exists()) return null;
28+
URL[] urls = {jarFile.toURI().toURL()};
2529
URLClassLoader classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader());
26-
String className = "org.scenicview.ScenicView"; // Fully qualified class name
30+
Thread.currentThread().setContextClassLoader(classLoader);
31+
cls = Class.forName(fullClass, true, classLoader);
32+
} catch (MalformedURLException | ClassNotFoundException _) {
2733

28-
Platform.runLater(() -> {
29-
ClassLoader originalCtx = Thread.currentThread().getContextClassLoader();
30-
Thread.currentThread().setContextClassLoader(classLoader);
31-
try {
32-
Class<?> cls = Class.forName(className, true, classLoader);
33-
cls.getMethod("show", Scene.class).invoke(null, scene);
34-
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException |
35-
ClassNotFoundException e) {
36-
throw new RuntimeException(e);
37-
} finally {
38-
Thread.currentThread().setContextClassLoader(originalCtx);
39-
}
40-
});
41-
System.out.println("[ScenicView] Aberto com sucesso.");
42-
} catch (MalformedURLException e) {
43-
throw new RuntimeException(e);
4434
}
35+
return cls;
36+
}
37+
38+
public static void addTools(Scene scene) {
39+
showScenicView(scene);
40+
listenCss(scene);
4541
}
4642

47-
public static void listenCss(Scene scene) {
43+
private static void showScenicView(Scene scene) throws RuntimeException {
4844
if (scene == null) return;
45+
ClassLoader originalCtx = Thread.currentThread().getContextClassLoader();
46+
Class<?> clazz = loadClassJar("./vendor/scenicview.jar", "org.scenicview.ScenicView");
47+
if (clazz == null) return;
48+
4949
try {
50+
clazz.getMethod("show", Scene.class).invoke(null, scene);
51+
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException _) {
5052

51-
// ... inside a method or class
52-
File jarFile = new File("./vendor/cssfx-11.5.1.jar");
53-
URL[] urls = {jarFile.toURI().toURL()};
54-
URLClassLoader classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader());
55-
String className = "fr.brouillard.oss.cssfx.CSSFX"; // Fully qualified class name
56-
Class<?> cls = Class.forName(className, true, classLoader);
53+
} finally {
54+
Thread.currentThread().setContextClassLoader(originalCtx);
55+
}
56+
}
57+
58+
private static void listenCss(Scene scene) {
59+
if (scene == null) return;
60+
Class<?> clazz = loadClassJar("./vendor/cssfx-11.5.1.jar", "fr.brouillard.oss.cssfx.CSSFX");
61+
if (clazz == null) return;
62+
try {
63+
clazz.getMethod("start", Scene.class).invoke(null, scene);
64+
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException _) {
5765

58-
cls.getMethod("start", Scene.class).invoke(null, scene);
59-
} catch (ReflectiveOperationException e) {
60-
System.out.println("[ScenicView] Error on invoking ScenicView.show(Scene): " + e.getMessage());
61-
} catch (MalformedURLException e) {
62-
throw new RuntimeException(e);
6366
}
6467
}
6568

0 commit comments

Comments
 (0)