Record of moving JMVS from the legacy Java3D application to a modern, cross-platform viewer. Detailed rationale lives in the to-be ADRs and to-be arc42; the as-is system is described in arc42/legacy/ and adr/legacy/. This document is the index and status record; the modernisation is complete. Future features are planned in roadmap.md.
| Phase | Scope | Status |
|---|---|---|
| 0 | Documentation: this plan, AGENTS.md, to-be ADRs and arc42 |
Done |
| 1 | Build foundation: Gradle 9 multi-module, toolchains, legacy module, CI | Done |
| 2 | Core: domain model, mmCIF reading, bonding, tests | Done |
| 3 | Scene: renderer-neutral scene model and display modes | Done |
| 4 | Renderer: libGDX rendering, camera, picking | Done |
| 5 | Application: launcher, UI, async loading, quality validation | Done |
| 6 | Packaging and cutover: installers, legacy archived | Done |
JMVS (~4k LOC) is a 1999/2003 Java3D viewer revived in 2022. The legacy risks and technical debt show it is pinned to JDK ≤ 11 by unmaintained Java3D 1.x and vendored macOS-only JOGL jars, carries vendored Sun-licensed sources, slows down beyond ~1000 atoms, terminates via System.exit, depends on the working directory, and is almost untested.
| Topic | Decision | ADR |
|---|---|---|
| Java | Java 25 LTS via Gradle toolchains; Gradle 9 wrapper; version catalog | 0001 |
| Build structure | Multi-module Gradle build with enforced dependency direction | 0002 |
| Migration | Strangler: legacy app kept as legacy-app on a JDK 11 toolchain until parity, then archived as a standalone build |
0003 |
| Rendering | libGDX (LWJGL3 backend) replaces Java3D/JOGL | 0004 |
| UI | libGDX Scene2D UI + native file dialog | 0005 |
| Extensibility | Renderer-neutral scene model; display-mode and colour-scheme SPI with built-in registry; no external jar loading | 0006 |
| Performance | Instanced rendering; recolour without geometry rebuild | 0007 |
| mmCIF | rcsb ciftools-java, gzip support |
0008 |
| Bonding | Spatial-grid search with RasMol rules | 0009 |
| Dependencies | Maven Central only; remove vendored jars and Sun sources | 0010 |
| Errors/logging | Typed exceptions, System.Logger, no System.exit in library code |
0011 |
| Testing | Golden files, RasMol parity, GPU-free scene tests | 0012 |
| CI/packaging | GitHub Actions matrix; jpackage installers per OS | 0013 |
| Interaction | Orbit camera; CPU ray picking | 0014 |
| Configuration | Classpath .properties, parsed once into typed config |
0015 |
settings.gradle.kts
gradle/libs.versions.toml
jmvs-core/ model, chemistry (elements, RasMol bonding), io (ciftools adapter, gzip); no UI/GL deps
jmvs-scene/ renderer-neutral scene data, DisplayMode/ColourScheme SPI, built-in modes and schemes
jmvs-render-gdx/ libGDX renderer: instanced spheres/cylinders, ribbon meshes, lighting, camera, picking
jmvs-app/ LWJGL3 launcher, Scene2D UI, file dialog, async loading, packaging
legacy-app/ original app/ as-is on a JDK 11 toolchain; since cutover a standalone build (own settings), not a module
Dependencies point one way: jmvs-app → jmvs-render-gdx → jmvs-scene → jmvs-core. Only jmvs-render-gdx and jmvs-app may depend on libGDX. See 05 Building block view.
References are to the legacy risks and technical debt.
| Item | Resolution | Phase |
|---|---|---|
| R1 Java3D / JDK ≤ 11 lock | libGDX renderer; Java 25 | 1, 4 |
| R2 macOS-only natives | LWJGL natives from Maven Central; CI on macOS, Linux, Windows | 1, 4 |
| R3 Binary jars in git | Maven Central only; the jars remain only in the archived, standalone legacy-app |
6 |
| R4 Sun-copyright sources | Not ported; remain only in the archived legacy-app |
6 |
| R5 Performance ceiling | Spatial-grid bonding, instancing, no per-atom logging, incremental recolouring | 2, 4 |
R6 System.exit in library code |
Typed exceptions surfaced in the UI | 2, 5 |
| R7 Relative shader paths | All resources loaded from the classpath | 4 |
| R8 Minimal tests | Golden-file, parity and scene tests in CI | 1–3 |
| D1 O(n²) bonding with logging | Spatial grid, no per-bond output | 2 |
| D2 Secondary structure matched by seq id across all chains | Lookup keyed by (model, chain, seq id) | 2 |
| D3 Model lookup by list index | Models keyed by model number | 2 |
| D4 Wrong bounds/centroid | Correct min/max initialisation and centroid | 2 |
| D5 Negative extent passed to centring | Camera framed from the bounding sphere | 4 |
| D6 Fragile parser | ciftools-java |
2 |
| D7 Dead/unfinished features | Turns parsed and coloured; balls-and-sticks enabled; defaults honoured; picking implemented; unused paint() dropped |
2–5 |
| D8 Pre-Java-8 style | Records, sealed types, pattern matching, immutable collections | 2–5 |
| D9 Config parsed per atom | Typed config parsed once | 3 |
| D10 Duplicate colour logic, unstable chain colours | Shared ColourScheme implementations; deterministic palette |
3 |
| D11 Static mutable singletons | Injected ElementTable, no static state |
2 |
| D12 Unused Guava, unused/unattributed shaders | Removed; new shaders written in-repo | 1, 4, 6 |
| D13 Duplicated/unreadable samples | One copy per file; .gz readable |
2, 6 |
| D14 Deprecated dialog API, hard-coded reader | Native dialog; reader selected by file extension | 2, 5 |
AGENTS.md, to-be ADRs, to-be arc42, Superseded by pointers on the affected legacy ADRs, updated docs/README.md.gradle/libs.versions.toml, foojay toolchain resolver.app/ to legacy-app/ on a JDK 11 toolchain; it must still build and run on macOS.jmvs-core, jmvs-scene, jmvs-render-gdx, jmvs-app modules on JDK 25../gradlew work when the local JDK is newer than 25 (e.g. 27): check Gradle’s supported runtime and, if needed, pin the daemon JVM with gradle/gradle-daemon-jvm.properties../gradlew build passes locally and in CI; ./gradlew :legacy-app:run still works on macOS.legacy-java3d; Gradle 9.9.2 runs directly on JDK 27, so no daemon pin was needed; dependency checksums in gradle/verification-metadata.xml.jmvs-core)ElementTable from elements.properties, model number and chain-aware residue lookup, correct bounds, turns.MoleculeReader SPI with a ciftools-java implementation (_atom_site, _struct_conf, _struct_sheet_range), .cif.gz support, typed exceptions.data/*.cif, bond parity against the legacy implementation, load-time test for 1zpd.1zpd reads and bonds in ~0.1–0.2 s. None of the samples contains turns; a synthetic file covers them.jmvs-scene)DisplayMode and ColourScheme SPI, registry configured from properties, deterministic chain palette.jmvs-render-gdx)1usc correctly on macOS.jmvs-app)--screenshot and --benchmark options support manual checks. CI builds and tests on Windows and Linux; the installers render 1crn there with Mesa software OpenGL.legacy-app/, dedupe sample data, refresh the README comparison screenshots in docs/images/ (legacy ones are in docs/images/legacy/), update root README.md, AGENTS.md, arc42 risks, and mark ADR 0003 complete../gradlew :jmvs-app:jpackage builds a 48 MB .dmg; release.yml packages on all three OSes on v* tags, installs WiX 5 on Windows, and smoke-tests each installer (dry runs on pull requests). Release v2.0.0 has installers for macOS, Windows and Linux.legacy-app/, the owner kept it for posterity as a standalone build (./gradlew -p legacy-app run), outside the root build and CI (ADR 0003). Its vendored jars and Sun sources stay with it.GRADLE_USER_HOME.-XstartOnFirstThread and a launcher restart (ADR 0004).ciftools-java 9.0.0 works on Java 25.