# davo75/jconverter architecture

> Architecture diagram of the GitHub repository davo75/jconverter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/davo75/jconverter
- Repository: https://github.com/davo75/jconverter

## Overview

#### Purpose and Runtime
JConverter is a Java desktop application for converting imperial and metric measurements. It is structured as an MVC-style Swing project, built with Ant/NetBeans metadata under `ConverterMVC_v4/build.xml` and `ConverterMVC_v4/nbproject/`.

#### Application Entry Point
`ConverterMVC_v4/src/myconverter/JConverter.java` is the likely bootstrap class. It initializes the conversion application and connects the model, controller, and primary UI rather than exposing an HTTP/API entry point.

#### Conversion Domain Model
`ConverterMVC_v4/src/myconverter/JConverterModel.java` owns the measurement-conversion logic and associated state. This is the core domain boundary: UI code should provide selected units and values, while the model returns converted values rather than embedding conversion rules in Swing event handlers.

#### Primary Converter Interface
`ConverterMVC_v4/src/myconverter/JConverterView.java` and `ConverterMVC_v4/src/myconverter/JConverterView.form` define the main Swing conversion window. The `.form` file indicates NetBeans GUI-builder ownership of layout, while the Java class provides the runtime view behavior and widget access.

#### Control and Event Flow
`ConverterMVC_v4/src/myconverter/JConverterController.java` mediates between the main view and model. User actions in `JConverterView` flow to the controller; the controller validates or interprets UI inputs, invokes `JConverterModel`, and updates displayed conversion results. This is the principal control boundary between presentation and conversion behavior.

#### Importer UI Boundary
`ConverterMVC_v4/src/myconverter/JImporterView.java` and `ConverterMVC_v4/src/myconverter/JImporterView.form` provide a separate Swing screen/dialog for importing data or inputs. Its presence suggests a secondary user workflow distinct from direct one-value conversion; integration with the controller/model should remain explicit rather than allowing the importer to bypass domain logic.

#### Build and Delivery
The project is an Ant-built Java application with a manifest at `ConverterMVC_v4/manifest.mf`. Generated classes and build outputs reside under `ConverterMVC_v4/build/`; authoritative source is under `ConverterMVC_v4/src/myconverter/`. No external service, database, browser runtime, or server infrastructure is represented in the repository.

Main entry points: [`ConverterMVC_v4/src/myconverter/JConverterController.java`](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterController.java) (JConverterController), [`ConverterMVC_v4/src/myconverter/JConverter.java`](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverter.java) (JConverter), [`ConverterMVC_v4/src/myconverter/JConverterView.java`](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterView.java) (JConverterView), [`ConverterMVC_v4/src/myconverter/JConverterModel.java`](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterModel.java) (JConverterModel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Swing desktop app"]
  node_entry{{"JConverter<br/>application bootstrap<br/>[JConverter.java]"}}
  node_main_view["JConverterView<br/>Swing main window"]
  node_main_form["JConverterView.form<br/>NetBeans form layout"]
  node_importer_view["JImporterView<br/>Swing importer UI<br/>[JImporterView.java]"]
  node_importer_form["JImporterView.form<br/>NetBeans form layout<br/>[JImporterView.form]"]
end

subgraph group_mvc["MVC conversion core"]
  node_controller["JConverterController<br/>MVC controller"]
  node_model{{"JConverterModel<br/>conversion domain model"}}
end

subgraph group_build["Build &amp; packaging"]
  node_ant_build["Ant build<br/>build definition<br/>[build.xml]"]
  node_netbeans["NetBeans metadata<br/>IDE project metadata"]
  node_manifest["Application manifest<br/>package manifest<br/>[manifest.mf]"]
  node_build_output["Build output<br/>generated classes and artifacts"]
end

node_entry -->|"creates"| node_main_view
node_entry -->|"wires"| node_controller
node_entry -->|"initializes"| node_model
node_main_form -.->|"defines layout"| node_main_view
node_importer_form -.->|"defines layout"| node_importer_view
node_main_view -->|"user actions"| node_controller
node_importer_view -->|"import actions"| node_controller
node_controller -->|"conversion requests"| node_model
node_model -->|"converted values"| node_controller
node_controller -->|"display updates"| node_main_view
node_ant_build -->|"compiles and packages"| node_build_output
node_netbeans -.->|"project integration"| node_ant_build
node_manifest -.->|"package metadata"| node_ant_build
node_build_output -.->|"contains application classes"| node_entry

click node_entry "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverter.java"
click node_main_view "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterView.java"
click node_main_form "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterView.form"
click node_importer_view "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JImporterView.java"
click node_importer_form "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JImporterView.form"
click node_controller "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterController.java"
click node_model "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterModel.java"
click node_ant_build "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/build.xml"
click node_manifest "https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/manifest.mf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_main_view,node_main_form,node_importer_view,node_importer_form toneBlue
class node_controller,node_model toneAmber
class node_ant_build,node_netbeans,node_manifest,node_build_output toneMint
```

## Components

### Swing desktop app

- [JConverter](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverter.java): application bootstrap · Initializes and wires the MVC application. · `ConverterMVC_v4/src/myconverter/JConverter.java`
- [JConverterView](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterView.java): Swing main window · Collects conversion inputs and displays results. · `ConverterMVC_v4/src/myconverter/JConverterView.java`
- [JConverterView.form](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterView.form): NetBeans form layout · GUI-builder layout for the main window. · `ConverterMVC_v4/src/myconverter/JConverterView.form`
- [JImporterView](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JImporterView.java): Swing importer UI · Separate workflow for importing inputs or data. · `ConverterMVC_v4/src/myconverter/JImporterView.java`
- [JImporterView.form](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JImporterView.form): NetBeans form layout · GUI-builder layout for the importer UI. · `ConverterMVC_v4/src/myconverter/JImporterView.form`

### MVC conversion core

- [JConverterController](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterController.java): MVC controller · Interprets UI actions and updates views from model results. · `ConverterMVC_v4/src/myconverter/JConverterController.java`
- [JConverterModel](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/src/myconverter/JConverterModel.java): conversion domain model · Owns conversion rules and conversion state. · `ConverterMVC_v4/src/myconverter/JConverterModel.java`

### Build & packaging

- [Ant build](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/build.xml): build definition · Compiles and packages the desktop application. · `ConverterMVC_v4/build.xml`
- **NetBeans metadata**: IDE project metadata
- [Application manifest](https://github.com/davo75/jconverter/blob/master/ConverterMVC_v4/manifest.mf): package manifest · `ConverterMVC_v4/manifest.mf`
- **Build output**: generated classes and artifacts · Generated output; source remains authoritative.

## Connections

- JConverter → JConverterView: creates
- JConverter → JConverterController: wires
- JConverter → JConverterModel: initializes
- JConverterView.form → JConverterView: defines layout
- JImporterView.form → JImporterView: defines layout
- JConverterView → JConverterController: user actions
- JImporterView → JConverterController: import actions
- JConverterController → JConverterModel: conversion requests
- JConverterModel → JConverterController: converted values
- JConverterController → JConverterView: display updates
- Ant build → Build output: compiles and packages
- NetBeans metadata → Ant build: project integration
- Application manifest → Ant build: package metadata
- Build output → JConverter: contains application classes
