Skip to content

Commit 3949cfd

Browse files
committed
docs: rewrite README with modular JavaFX guide and modern usage examples
- Overhauled README.md with a new structure, aligned with JPMS and JavaFX 19+ - Added detailed module usage instructions, Maven setup, and quick start guide - Documented map layers, events, and GeoJSON usage more clearly - Updated changelog for v1.9.5 build: migrate project to Java 17 with full JPMS support - Set compiler target to Java 17 in pom.xml - Updated all JavaFX dependencies to use ${javafx.version} property (19.0.2.1) - Added lombok annotation processor to support modular build - Updated maven-compiler-plugin with required --add-modules and --add-opens flags - Added maven-jar-plugin and maven-surefire-plugin configurations for module support - Removed use of internal JavaFX APIs (e.g., WebConsoleListener) for module compatibility
1 parent dd52890 commit 3949cfd

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

src/main/java/module-info.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module io.github.makbn.jlmap {
2+
// JavaFX modules
3+
requires javafx.controls;
4+
requires javafx.base;
5+
requires javafx.swing;
6+
requires javafx.web;
7+
requires javafx.graphics;
8+
9+
// JDK modules
10+
requires jdk.jsobject;
11+
12+
// Logging
13+
requires org.apache.logging.log4j;
14+
requires org.apache.logging.log4j.core;
15+
16+
// JSON processing
17+
requires com.google.gson;
18+
requires com.fasterxml.jackson.databind;
19+
20+
// Annotations
21+
requires static org.jetbrains.annotations;
22+
requires static lombok;
23+
24+
// Exports for public API
25+
exports io.github.makbn.jlmap;
26+
exports io.github.makbn.jlmap.layer;
27+
exports io.github.makbn.jlmap.layer.leaflet;
28+
exports io.github.makbn.jlmap.listener;
29+
exports io.github.makbn.jlmap.model;
30+
exports io.github.makbn.jlmap.exception;
31+
exports io.github.makbn.jlmap.geojson;
32+
33+
// Opens for reflection (if needed by frameworks)
34+
opens io.github.makbn.jlmap to javafx.graphics;
35+
opens io.github.makbn.jlmap.layer to javafx.graphics;
36+
opens io.github.makbn.jlmap.model to javafx.graphics;
37+
opens io.github.makbn.jlmap.geojson to javafx.graphics;
38+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package io.github.makbn.jlmap;
2+
3+
import io.github.makbn.jlmap.model.JLLatLng;
4+
import org.junit.jupiter.api.Test;
5+
import static org.junit.jupiter.api.Assertions.*;
6+
7+
/**
8+
* Test to verify that the Java Platform Module System is working correctly.
9+
*/
10+
public class ModuleSystemTest {
11+
12+
@Test
13+
public void testModuleSystemWorking() {
14+
// Test that we can create basic objects from the module
15+
JLLatLng latLng = JLLatLng.builder()
16+
.lat(51.044)
17+
.lng(114.07)
18+
.build();
19+
20+
assertNotNull(latLng);
21+
assertEquals(51.044, latLng.getLat());
22+
assertEquals(114.07, latLng.getLng());
23+
24+
// Test that we can access module properties
25+
assertNotNull(JLProperties.MapType.OSM_MAPNIK);
26+
assertNotNull(JLProperties.INIT_MIN_HEIGHT_STAGE);
27+
assertNotNull(JLProperties.INIT_MIN_WIDTH_STAGE);
28+
29+
System.out.println("✅ Module system is working correctly!");
30+
System.out.println("✅ Module: io.github.makbn.jlmap");
31+
System.out.println("✅ Java Version: " + System.getProperty("java.version"));
32+
System.out.println("✅ Module Path: " + System.getProperty("java.module.path"));
33+
}
34+
35+
@Test
36+
public void testModuleInfoAccessible() {
37+
// Test that module-info.java is properly processed
38+
Module module = JLMapView.class.getModule();
39+
assertNotNull(module);
40+
assertEquals("io.github.makbn.jlmap", module.getName());
41+
42+
System.out.println("✅ Module name: " + module.getName());
43+
System.out.println("✅ Module is named: " + module.isNamed());
44+
}
45+
}

0 commit comments

Comments
 (0)