Skip to content

Commit e23dbf1

Browse files
author
Carl Dea
committed
WIP-fix the openstreet map api and refactored timezone code
1 parent 84f4672 commit e23dbf1

File tree

12 files changed

+786
-213
lines changed

12 files changed

+786
-213
lines changed

.bach/src/run/bach

Submodule bach added at 16afe6c
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2024 Christian Stein
3+
* Licensed under the Universal Permissive License v 1.0 -> https://opensource.org/license/upl
4+
*/
5+
6+
class Hi {
7+
public static void main(String... args) {
8+
String name = args.length == 0 ? System.getProperty("user.name") : String.join(" ", args);
9+
System.out.printf("Hi %s!%n", name);
10+
}
11+
}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".bach/src/run/bach"]
2+
path = .bach/src/run/bach
3+
url = https://github.com/sormuras/run.bach

bach

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.bach/src/run/bach/Main.java

pom.xml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
<version>1.0-SNAPSHOT</version>
77
<properties>
88
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9-
<maven.compiler.release>16</maven.compiler.release>
10-
<javafx.version>16</javafx.version>
9+
<maven.compiler.release>21</maven.compiler.release>
10+
<javafx.version>23</javafx.version>
1111
</properties>
1212
<dependencies>
1313
<!-- Uncomment out the following if you have downloaded JavaFX separately from GluonHQ -->
14-
<!-- <dependency>-->
15-
<!-- <groupId>org.openjfx</groupId>-->
16-
<!-- <artifactId>javafx-controls</artifactId>-->
17-
<!-- <version>${javafx.version}</version>-->
18-
<!-- </dependency>-->
19-
<!-- <dependency>-->
20-
<!-- <groupId>org.openjfx</groupId>-->
21-
<!-- <artifactId>javafx-web</artifactId>-->
22-
<!-- <version>${javafx.version}</version>-->
23-
<!-- </dependency>-->
24-
<!-- <dependency>-->
25-
<!-- <groupId>org.openjfx</groupId>-->
26-
<!-- <artifactId>javafx-fxml</artifactId>-->
27-
<!-- <version>${javafx.version}</version>-->
28-
<!-- </dependency>-->
14+
<dependency>
15+
<groupId>org.openjfx</groupId>
16+
<artifactId>javafx-controls</artifactId>
17+
<version>${javafx.version}</version>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.openjfx</groupId>
21+
<artifactId>javafx-web</artifactId>
22+
<version>${javafx.version}</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.openjfx</groupId>
26+
<artifactId>javafx-fxml</artifactId>
27+
<version>${javafx.version}</version>
28+
</dependency>
2929
<dependency>
3030
<groupId>com.fasterxml.jackson.core</groupId>
3131
<artifactId>jackson-core</artifactId>
@@ -60,9 +60,8 @@
6060
<plugin>
6161
<groupId>org.openjfx</groupId>
6262
<artifactId>javafx-maven-plugin</artifactId>
63-
<version>0.0.5</version>
63+
<version>0.0.8</version>
6464
<configuration>
65-
<release>${maven.compiler.release}</release>
6665
<jlinkImageName>worldclock</jlinkImageName>
6766
<launcher>launcher</launcher>
6867
<mainClass>worldclock/com.carlfx.worldclock.App</mainClass>

src/main/java/com/carlfx/worldclock/App.java

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
package com.carlfx.worldclock;
2020

2121
import javafx.animation.Interpolator;
22+
import javafx.animation.KeyFrame;
23+
import javafx.animation.KeyValue;
24+
import javafx.animation.Timeline;
2225
import javafx.animation.TranslateTransition;
2326
import javafx.application.Application;
2427
import javafx.application.Platform;
@@ -106,9 +109,8 @@ public void start(Stage stage) throws IOException {
106109

107110
// load the config form
108111
Pane centerPane = new Pane();
109-
110112
FXMLLoader configLocationLoader = new FXMLLoader(App.class.getResource("config-locations.fxml"));
111-
Parent configPane = configLocationLoader.load();
113+
Pane configPane = configLocationLoader.load();
112114
ConfigLocationsController configController = configLocationLoader.getController();
113115

114116
// locations is a singleton from the config controller.
@@ -146,12 +148,13 @@ public void start(Stage stage) throws IOException {
146148
clockList.getChildren()
147149
.addAll(locations.stream()
148150
.map( location -> createOneClock(webEngine, location)) /* Create clock from FXML */
149-
.collect(Collectors.toList()));
151+
.toList());
150152

151153
scrollPane.getStyleClass().add("clock-background");
152154

153155
// Animate toggle between Config view vs World Clock List view
154156
windowContainer.addEventHandler(CONFIG_SHOWING, event -> {
157+
// Location list will slide out of view.
155158
TranslateTransition moveList = new TranslateTransition();
156159
moveList.setNode(scrollPane);
157160
moveList.setDuration(Duration.millis(400));
@@ -166,10 +169,9 @@ public void start(Stage stage) throws IOException {
166169
moveList.setToX(0);
167170
}
168171

172+
// Config Pane slide in view
169173
TranslateTransition moveConfig = new TranslateTransition();
170-
171174
moveConfig.setNode(configPane);
172-
173175
moveConfig.setDuration(Duration.millis(400));
174176
if (!windowController.isConfigShowing()) {
175177
scrollPane.toFront();
@@ -183,10 +185,35 @@ public void start(Stage stage) throws IOException {
183185
moveConfig.setFromX(-scrollPane.getWidth() + scrollPane.getPadding().getLeft() + scrollPane.getPadding().getRight());
184186
moveConfig.setToX(0);
185187
}
188+
// also move bottom portion to size.
189+
// Create a Timeline for the animation
190+
// Timeline moveBottomTimeline = new Timeline();
191+
//
192+
// if (!windowController.isConfigShowing()) {
193+
// // Create a KeyValue to set the height to the initial value
194+
// KeyFrame startFrame = new KeyFrame(Duration.ZERO, new KeyValue(centerPane.maxWidthProperty(), scrollPane.getHeight()));
195+
//
196+
// // Create a KeyValue to set the height to the final value
197+
// KeyFrame endFrame = new KeyFrame(Duration.millis(400), new KeyValue(centerPane.maxWidthProperty(), configPane.heightProperty().get()));
198+
//
199+
// // Add a KeyFrame to the timeline, linking the KeyValue with the duration
200+
// moveBottomTimeline.getKeyFrames().addAll(startFrame, endFrame);
201+
// } else {
202+
// // Create a KeyValue to set the height to the initial value
203+
// KeyFrame startFrame = new KeyFrame(Duration.ZERO, new KeyValue(centerPane.maxWidthProperty(), configPane.heightProperty().get()));
204+
//
205+
// // Create a KeyValue to set the height to the final value
206+
// KeyFrame endFrame = new KeyFrame(Duration.millis(400), new KeyValue(centerPane.maxWidthProperty(), scrollPane.getHeight()));
207+
//
208+
// // Add a KeyFrame to the timeline, linking the KeyValue with the duration
209+
// moveBottomTimeline.getKeyFrames().addAll(startFrame, endFrame);
210+
// }
211+
186212
// System.out.println("clock list width " + clockList.getWidth());
187213
// System.out.println("config pane width " + configPane.getBoundsInParent().getWidth());
188214
// System.out.println("window bar width " + windowBar.getBoundsInParent().getWidth());
189215
// System.out.println(" image width " + mapImage.getBoundsInParent().getWidth());
216+
// moveBottomTimeline.playFromStart();
190217
moveConfig.playFromStart();
191218
moveList.playFromStart();
192219
});

0 commit comments

Comments
 (0)