A complete Java 21 / JavaFX implementation of the Graph Digitizer tool - an interactive GUI application for extracting numeric data points from raster images of graphs.
Version: 1.2.0
License: Apache License 2.0
Author: Michael Ryan Hunsaker
Build Tool: Maven 3.8.0+
Java Version: Java 21+
A professional, production-ready Java Maven project with the following structure:
graph-digitizer-java/
├── pom.xml # Maven build configuration
├── README.md # User guide and quick start
├── DEVELOPER.md # Developer guide and architecture
├── CHANGELOG.md # Version history and roadmap
├── LICENSE # Apache 2.0 license
├── .gitignore # Git exclusion rules
│
└── src/
├── main/
│ ├── java/com/digitizer/
│ │ ├── core/ # Core business logic (GUI-free)
│ │ │ ├── Point.java # Immutable coordinate record
│ │ │ ├── Dataset.java # Dataset with points
│ │ │ ├── CalibrationState.java # Calibration data
│ │ │ ├── CoordinateTransformer.java # Linear/log transforms
│ │ │ ├── ColorUtils.java # Color operations
│ │ │ └── FileUtils.java # File utilities
│ │ │
│ │ ├── image/ # Image processing
│ │ │ ├── ImageLoader.java # PNG/JPEG loading
│ │ │ └── AutoTracer.java # Color-based auto-trace
│ │ │
│ │ ├── io/ # File import/export
│ │ │ ├── ProjectJson.java # JSON root model
│ │ │ ├── DatasetJson.java # JSON dataset model
│ │ │ ├── JsonExporter.java # JSON I/O
│ │ │ └── CsvExporter.java # CSV export
│ │ │
│ │ └── ui/ # JavaFX user interface
│ │ ├── GraphDigitizerApp.java # Application entry point
│ │ ├── MainWindow.java # Main window + orchestration
│ │ ├── CanvasPanel.java # Image canvas + drawing
│ │ ├── ControlPanel.java # Control widgets
│ │ └── StatusBar.java # Status display
│ │
│ └── resources/
│ ├── logback.xml # Logging configuration
│ ├── fxml/ # (for future FXML layouts)
│ └── css/ # (for future stylesheets)
│
└── test/
└── java/com/digitizer/
├── core/
│ ├── ColorUtilsTest.java
│ └── FileUtilsTest.java
└── io/
| File | Purpose |
|---|---|
pom.xml |
Maven build configuration with all dependencies and plugins |
README.md |
User-facing documentation with quick start and feature overview |
DEVELOPER.md |
Technical documentation for developers extending the project |
CHANGELOG.md |
Version history and future roadmap |
-
Image Loading - PNG and JPEG support
-
Calibration - Four-point click-to-calibrate with numeric axis ranges
-
Data Entry - Manual point placement and editing
-
Auto-trace - Color-matching based automatic curve extraction
-
Multiple Datasets - Support for up to 6 color-coded datasets
-
Coordinate Transforms - Linear and logarithmic (base-10) axis support
-
Export Formats:
-
JSON (full metadata and calibration)
-
CSV (wide format for spreadsheets)
-
-
Responsive UI - Modern JavaFX with toolbar, canvas, and control panels
-
Logging - SLF4J with Logback configuration
-
Unit Tests - Core utilities and algorithms tested
-
Snap X Values - Batch coordinate snapping to grid
-
Precision Zoom - Circular magnifier overlay
-
Undo/Redo - Command pattern implementation
-
Project Files - .gdz format with embedded images
-
Plugin System - Custom export format support
-
Keyboard Shortcuts - Customizable accelerators
-
Batch Processing - Command-line interface
-
More Image Formats - TIFF, PDF support
# Build
cd graph-digitizer-java
mvn clean package
# Run
mvn javafx:run
# Or run the JAR directly
java -jar target/graph-digitizer-1.2.0.jar
mvn test
mvn clean package
# Creates:
# - target/graph-digitizer-1.2.0.jar (runnable JAR)
# - target/graph-digitizer-1.2.0-shaded.jar (fat JAR with dependencies)
The project is organized into four distinct packages:
┌─────────────────────────────────────────┐
│ UI Package (JavaFX) │
│ ┌────────────────────────────────────┐ │
│ │ User Interface Components │ │
│ └────────────────────────────────────┘ │
└──────────────────┬──────────────────────┘
│ uses
┌──────────────────▼──────────────────────┐
│ Image Package │ IO Package │ Core Package│
├──────────────────────────────────────────┤
│ • ImageLoader │ • JsonExporter │ • Point│
│ • AutoTracer │ • CsvExporter │ Dataset│
│ │ │ • Calib│
└──────────────────────────────────────────┘
│ uses
┌──────────────▼──────────────┐
│ Java Standard Library │
│ + Third-party Libraries │
└─────────────────────────────┘
The core package contains zero GUI dependencies:
-
Testable without JavaFX startup overhead
-
Reusable in headless/CLI applications
-
Can be packaged as a library for other projects
Example: Testing coordinate transforms without GUI
CalibrationState calib = new CalibrationState();
calib.setDataXMin(0);
calib.setDataXMax(100);
// ... set other parameters ...
CoordinateTransformer transformer = new CoordinateTransformer(calib);
Point2D canvasCoord = transformer.dataToCanvas(50, 25);
// Test passes without starting JavaFX!Easy to add new export formats:
// Create in io package
public class SvgExporter {
public static void exportToSvg(String path, List<Dataset> datasets) {
// Implementation
}
}
// Wire up in MainWindow
private void handleSaveSvg() {
SvgExporter.exportToSvg(filePath, datasets);
}-
JavaFX 21.0.2 - Modern cross-platform GUI
-
GSON 2.10.1 - JSON serialization
-
Apache Commons CSV 1.10.0 - CSV I/O
-
SLF4J 2.0.9 - Logging API
-
Logback 1.4.11 - Logging implementation
-
JUnit 4 & 5 - Testing frameworks
All configured in pom.xml with correct versions.
- Java 21+ (comes with JavaFX via Maven)
Modern language features (records, pattern matching)
Stable LTS foundation
Excellent IDE support
Large ecosystem
Strong backward compatibility
Cross-platform (Windows/macOS/Linux)
Part of OpenJDK
Native look-and-feel
CSS styling support
Excellent 2D rendering
Industry-standard for Java
Easy dependency management
Large plugin ecosystem
Works with CI/CD
Simple configuration
Testable without GUI frameworks
Reusable as library
Parallel development
Easier to maintain
Future CLI/headless usage
{
"title": "My Plot",
"xlabel": "Time (seconds)",
"ylabel": "Signal Amplitude",
"x_min": 0.0,
"x_max": 100.0,
"y_min": -1.0,
"y_max": 1.0,
"x_log": false,
"y_log": false,
"datasets": [
{
"name": "Dataset 1",
"color": "#0072B2",
"points": [[0.0, 0.1], [1.0, 0.15], ...]
}
]
}
x,Dataset_1,Dataset_2
0.0,0.1,-0.05
1.0,0.15,0.2
2.5,,0.15
# 1. Clone and navigate
git clone <repo>
cd graph-digitizer-java
# 2. Build and test
mvn clean package
mvn test
# 3. Run during development
mvn javafx:run
# 4. Build documentation
mvn javadoc:javadoc
-
Plan - Understand which package(s) it belongs in
-
Code - Write the implementation
-
Test - Add unit tests in
src/test/java -
Document - Add Javadoc comments
-
Build - Run
mvn clean packageto verify -
Commit - Use clear, descriptive commit messages
mvn test # All tests
mvn test -Dtest=FileUtilsTest # Specific test
mvn test -Dtest=*Utils*Test # Pattern matching
-
Create
MyFormatExporter.javaincom.digitizer.io -
Implement static export methods
-
Write unit tests in
src/test/java/com/digitizer/io/MyFormatExporterTest.java -
Wire up UI button in
MainWindow.handleSaveMyFormat()
-
Create class in
com.digitizer.core -
Avoid GUI dependencies
-
Write unit tests that run without JavaFX
-
Document with Javadoc
-
Edit components in
com.digitizer.ui -
Add new panels as subclasses of Region/VBox
-
Wire up in
MainWindow.initialize() -
Update
DEVELOPER.mdwith new UI patterns
ui/
├── uses → core/
├── uses → image/
├── uses → io/
└── uses → JavaFX
image/
├── uses → core/
└── uses → Java stdlib
io/
├── uses → core/
├── uses → GSON
└── uses → Apache Commons CSV
core/
└── uses → JavaFX (Color only)
└── (Can be made 100% standalone if needed)
Rule: Lower packages never depend on higher packages.
| Operation | Time Complexity | Notes |
|---|---|---|
| Load image | O(image_size) | Depends on file I/O and image size |
| Canvas redraw | O(points) | Draws each point once |
| Auto-trace | O(w × h) | w=width, h=height of search area |
| Coordinate transform | O(1) | Per point, constant time |
| CSV export | O(n_points × n_datasets) | Wide format assembly |
-
File I/O: No arbitrary command execution, only reads/writes files
-
JSON Parsing: Uses GSON which is memory-safe
-
No Network: Application is entirely offline
-
Temporary Files: Uses
File.createTempFile()which is secure
| Aspect | Status |
|---|---|
| Windows | Tested and working |
| macOS | Should work (Java 21 + JavaFX) |
| Linux | Should work (Java 21 + JavaFX) |
| Java 21+ | Required |
| Image Formats | PNG, JPEG |
| Export Formats | JSON, CSV |
| Feature | Julia | Java |
|---|---|---|
| Image Loading | ImageIO | JavaFX Image |
| GUI Framework | GTK | JavaFX |
| Build System | Julia Pkg | Maven |
| Logging | println | SLF4J + Logback |
| JSON | JSON.jl | GSON |
| CSV | CSV.jl | Apache Commons CSV |
| Coordinate Transforms | Same | 100% identical |
| Color Matching | Same | 100% identical |
| File Formats | Same | 100% compatible |
-
Build:
mvn clean package -
Run:
java -jar target/graph-digitizer-1.2.0.jar -
Load image → Calibrate → Edit points → Export
-
See
README.mdfor detailed usage guide
-
Read
DEVELOPER.mdfor architecture overview -
Explore the code structure starting with
corepackage -
Look at unit tests as usage examples
-
Run
mvn javadoc:javadocto generate API docs -
Check
CHANGELOG.mdfor planned features
-
Fork the repository
-
Create a feature branch
-
Write tests for new features
-
Ensure
mvn testpasses -
Submit a pull request
-
Documentation: See
README.mdandDEVELOPER.md -
Build Issues: Check Maven dependencies with
mvn dependency:tree-- JavaFX Help: Gluon JavaFX -- Maven Help: Maven -- Java 21 Docs: Java 21 docs
Apache License 2.0 - See LICENSE file for details.
Created: November 2025
Version: 1.2.0
Status: Production Ready
This is a complete, working Java application ready for compilation, testing, extension, and deployment.