SnapFX requires Java 21 (LTS). Download it from:
- Oracle JDK 21: https://www.oracle.com/java/technologies/downloads/#java21
- OpenJDK 21: https://adoptium.net/temurin/releases/?version=21
After installation:
- Set the
JAVA_HOMEenvironment variable:JAVA_HOME=C:\Program Files\Java\jdk-21 - Add
%JAVA_HOME%\binto your PATH
export JAVA_HOME=/path/to/jdk-21
export PATH=$JAVA_HOME/bin:$PATH# Windows
.\gradlew build
# Linux/Mac
./gradlew build# Windows
.\gradlew run
# Linux/Mac
./gradlew run# Windows
.\gradlew test
# Linux/Mac
./gradlew test- Open project:
File→Open→ select the SnapFX folder - Gradle sync: IntelliJ will automatically run
gradle build - Configure JDK:
File→Project Structure→Project→ set SDK to Java 21 - Run demo: Right-click
MainDemo.java→Run 'MainDemo.main()'
- Import project:
File→Import→Gradle→Existing Gradle Project - Configure JDK: Project →
Properties→Java Build Path→ Libraries → set JRE to Java 21 - Run demo: Right-click
MainDemo.java→Run As→Java Application
Required extensions:
- Extension Pack for Java
- Gradle for Java
After installation:
- Open the SnapFX folder
- VS Code will detect the Gradle project automatically
- Press
F5to debug or use the "Run" button
# Compile project
.\gradlew compileJava
# Run tests (headless)
.\gradlew test --tests "*.model.*"
# Build JAR
.\gradlew jar
# Build distribution
.\gradlew distZip
# Show all tasks
.\gradlew tasksJavaFX is downloaded automatically by the Gradle plugin. Run:
.\gradlew clean build --refresh-dependenciesSet the JAVA_HOME environment variable as described above.
For GUI tests with TestFX:
.\gradlew test -Dtestfx.robot=glass -Dtestfx.headless=trueIf gradlew.bat is missing:
gradle wrapper --gradle-version 9.0SnapFX/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/github/beowolve/snapfx/
│ │ │ ├── model/ # Data model
│ │ │ ├── view/ # View layer
│ │ │ ├── dnd/ # Drag & drop
│ │ │ ├── persistence/ # Serialization
│ │ │ ├── demo/ # Demo app
│ │ │ └── SnapFX.java # Main entry point
│ │ └── resources/
│ │ └── snapfx.css # Styling
│ └── test/
│ └── java/ # JUnit tests
├── build.gradle.kts # Build configuration
└── settings.gradle.kts
- Java 21 features: Records, pattern matching, text blocks
- SOLID principles: Strict separation of model/view
- JavaDoc: All public APIs documented
- Tests: Comprehensive JUnit 5 + TestFX tests
- Model first: Implement logic in the model layer
- Update view: Adapt
DockLayoutEngine - Write tests: Add tests
- Extend demo: Showcase the feature in
MainDemo
This project is licensed under the MIT License.
SnapFX is intended for personal and commercial use, including large applications.