Skip to content

Commit

Permalink
Fix for issue #158
Browse files Browse the repository at this point in the history
  • Loading branch information
HanSolo committed Oct 28, 2024
1 parent fed256d commit 2371ae0
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 40 deletions.
74 changes: 42 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,51 @@
* limitations under the License.
*/

import java.text.SimpleDateFormat
import groovy.json.JsonOutput
import groovy.json.JsonSlurper

import java.text.SimpleDateFormat

buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.google.gradle:osdetector-gradle-plugin:1.7.3'
classpath 'org.javamodularity:moduleplugin:1.8.15'
}
}

plugins {
id 'idea'
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'maven-publish'
id 'com.google.osdetector' version '1.7.3'
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'org.beryx.jlink' version '3.0.1'
id 'net.nemerosa.versioning' version '3.1.0'
id 'org.beryx.jlink' version '3.0.1'
}

apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'maven-publish'

description = 'TilesFX is a JavaFX library containing tiles for dashboards'
normalization {
runtimeClasspath {
ignore('/META-INF/MANIFEST.MF')
}
}

repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}

Date buildTimeAndDate = new Date()
ext {
Expand All @@ -51,10 +76,6 @@ ext {
gpgpassphrase = System.getenv("PASSPHRASE")
}

repositories {
mavenCentral()
}

dependencies {
api "eu.hansolo.fx:countries:21.0.17"
implementation "org.openjfx:javafx-base:${javafxVersion}:${platform}"
Expand All @@ -65,25 +86,22 @@ dependencies {
implementation "org.openjfx:javafx-media:${javafxVersion}:${platform}"
}

application {
mainClass = "eu.hansolo.tilesfx.DemoLauncher"
mainModule = moduleName
}
application.mainModule = 'eu.hansolo.tilesfx'
mainClassName = 'eu.hansolo.tilesfx.DemoLauncher'
description = 'TilesFX is a JavaFX library containing tiles for dashboards'

java {
// Set to false per https://github.com/java9-modularity/gradle-modules-plugin
modularity.inferModulePath.set(false)
}

jar {

from {
//duplicatesStrategy = DuplicatesStrategy.EXCLUDE
//configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}

manifest {
attributes(
'Built-By' : System.properties['user.name'],
Expand All @@ -97,28 +115,20 @@ jar {
'Implementation-Version': project.version,
'Bundle-Name' : project.name,
'Bundle-License' : 'https://www.apache.org/licenses/LICENSE-2.0;description=Apache License Version 2.0;link=https://spdx.org/licenses/Apache-2.0.html',
'Bundle-Description' : project.description,
'Bundle-Description' : description,
'Bundle-Version' : project.version,
'Bundle-SymbolicName' : 'eu.hansolo.tilesfx',
'Export-Package' : 'eu.hansolo.tilesfx, eu.hansolo.tilesfx.chart, eu.hansolo.tilesfx.colors, eu.hansolo.tilesfx.events, eu.hansolo.tilesfx.fonts, eu.hansolo.tilesfx.icons, eu.hansolo.tilesfx.skins,eu.hansolo.tilesfx.tools',
'Class-Path' : "${project.name}-${project.version}.jar",
'Main-Class' : application.mainClass
'Class-Path' : '${project.name}-${project.version}.jar',
'Main-Class' : 'eu.hansolo.tilesfx.DemoLauncher'
)
}
}


if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}


// start demo from gradle
task Demo(type: JavaExec) {
mainClass = 'eu.hansolo.tilesfx.DemoLauncher'
mainClass = "eu.hansolo.tilesfx.DemoLauncher"
classpath = sourceSets.main.runtimeClasspath
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/eu/hansolo/tilesfx/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ public class Demo extends Application {
.skinType(SkinType.GAUGE)
.prefSize(TILE_WIDTH, TILE_HEIGHT)
.title("Gauge Tile")
.sections(SectionBuilder.create().start(0).stop(20).color(Dark.GREEN).build(),
SectionBuilder.create().start(80).stop(100).color(Dark.RED).build())
.sectionsVisible(true)
.unit("V")
.threshold(75)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

public class CalendarTileSkin extends TileSkin {
private static final DateTimeFormatter DAY_FORMATTER = DateTimeFormatter.ofPattern("EEEE");
private static final DateTimeFormatter MONTH_YEAR_FORMATTER = DateTimeFormatter.ofPattern("MMMM YYYY");
private static final DateTimeFormatter MONTH_YEAR_FORMATTER = DateTimeFormatter.ofPattern("MMMM yyyy");
private Border weekBorder;
private Text titleText;
private Text text;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/hansolo/tilesfx/skins/ClockTileSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ClockTileSkin(final Tile TILE) {
timeListener = o -> updateTime(tile.getTime());

timeFormatter = DateTimeFormatter.ofPattern("HH:mm", tile.getLocale());
dateFormatter = DateTimeFormatter.ofPattern("dd MMM YYYY", tile.getLocale());
dateFormatter = DateTimeFormatter.ofPattern("dd MMM yyyy", tile.getLocale());
dayOfWeekFormatter = DateTimeFormatter.ofPattern("EEEE", tile.getLocale());

titleText = new Text("");
Expand Down Expand Up @@ -190,7 +190,7 @@ public void updateTime(final ZonedDateTime TIME) {
titleText.setText(tile.getTitle());
text.setText(tile.getText());
timeFormatter = DateTimeFormatter.ofPattern("HH:mm", tile.getLocale());
dateFormatter = DateTimeFormatter.ofPattern("dd MMM YYYY", tile.getLocale());
dateFormatter = DateTimeFormatter.ofPattern("dd MMM yyyy", tile.getLocale());
dayOfWeekFormatter = DateTimeFormatter.ofPattern("EEEE", tile.getLocale());

ZonedDateTime time = tile.getTime();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/eu/hansolo/tilesfx/skins/DateTileSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class DateTileSkin extends TileSkin {
private static final DateTimeFormatter DAY_FORMATTER = DateTimeFormatter.ofPattern("EEEE");
private static final DateTimeFormatter MONTH_YEAR_FORMATTER = DateTimeFormatter.ofPattern("MMMM YYYY");
private static final DateTimeFormatter MONTH_YEAR_FORMATTER = DateTimeFormatter.ofPattern("MMMM yyyy");
private Text titleText;
private Text text;
private Label description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class TimelineTileSkin extends TileSkin {
private static final DateTimeFormatter HOUR_FORMATTER = DateTimeFormatter.ofPattern("HH:mm");
private static final DateTimeFormatter MINUTE_FORMATTER = DateTimeFormatter.ofPattern("HH:mm");
private static final DateTimeFormatter SECOND_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
private DateTimeFormatter DTF = DateTimeFormatter.ofPattern("dd.YY HH:mm");
private DateTimeFormatter DTF = DateTimeFormatter.ofPattern("dd.yy HH:mm");
private DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm");
private Text titleText;
private Text valueText;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/eu/hansolo/tilesfx/tools/Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,11 @@ public static final void fitNodeWidth(final Node NODE, final double MAX_WIDTH) {

public static final DateTimeFormatter getDateFormat(final Locale LOCALE) {
if (Locale.US == LOCALE) {
return DateTimeFormatter.ofPattern("MM/dd/YYYY");
return DateTimeFormatter.ofPattern("MM/dd/yyyy");
} else if (Locale.CHINA == LOCALE) {
return DateTimeFormatter.ofPattern("YYYY.MM.dd");
return DateTimeFormatter.ofPattern("yyyy.MM.dd");
} else {
return DateTimeFormatter.ofPattern("dd.MM.getY()YYY");
return DateTimeFormatter.ofPattern("dd.MM.yyyy");
}
}
public static final DateTimeFormatter getLocalizedDateFormat(final Locale LOCALE) {
Expand Down

0 comments on commit 2371ae0

Please sign in to comment.