# pandolarek/orbitfx architecture

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

- Interactive diagram: https://gitdiagram.com/pandolarek/orbitfx
- Repository: https://github.com/pandolarek/orbitfx

## Overview

OrbitFX is a JavaFX 2D gravity simulator. The documented workflow is to launch into a paused system, initialize it, select and edit a body while paused, then run or pause the simulation while observing its motion. Major capabilities include fixed-timestep Euler physics, adjustable time scaling, and momentum-conserving inelastic collisions. The available source excerpt covers only the module declaration; class responsibilities and wiring are therefore inferred from names and documented behavior, and uncertain connections are shown as unverified.

Main entry points: [`src/main/java/org/example/orbitfx/UIManager.java`](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/UIManager.java) (UI manager), [`src/main/java/org/example/orbitfx/Game.java`](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Game.java) (Simulation loop), [`src/main/java/org/example/orbitfx/Main.java`](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Main.java) (Application entry), [`src/main/resources/org/example/orbitfx/hello-view.fxml`](https://github.com/pandolarek/orbitfx/blob/master/src/main/resources/org/example/orbitfx/hello-view.fxml) (JavaFX view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Application entry<br/>[Main.java]"]
  node_view["JavaFX view<br/>[hello-view.fxml]"]
end

subgraph group_simulation["Simulation"]
  node_game["Simulation loop<br/>[Game.java]"]
  node_planet["Celestial bodies<br/>[Planet.java]"]
end

subgraph group_interaction["User interaction"]
  node_ui["UI manager<br/>[UIManager.java]"]
  node_camera["Camera focus<br/>[Camera.java]"]
end

node_user(("User"))

node_user -->|"launches"| node_main
node_user -->|"controls"| node_ui
node_ui -.->|"updates"| node_view
node_ui -.->|"controls"| node_game
node_ui -.->|"focuses"| node_camera
node_game -.->|"simulates"| node_planet

click node_main "https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Main.java"
click node_view "https://github.com/pandolarek/orbitfx/blob/master/src/main/resources/org/example/orbitfx/hello-view.fxml"
click node_ui "https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/UIManager.java"
click node_camera "https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Camera.java"
click node_game "https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Game.java"
click node_planet "https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Planet.java"

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_main,node_view,node_user toneBlue
class node_game,node_planet toneAmber
class node_ui,node_camera toneMint
```

## Components

### Application

- [Application entry](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Main.java): `src/main/java/org/example/orbitfx/Main.java`
- [JavaFX view](https://github.com/pandolarek/orbitfx/blob/master/src/main/resources/org/example/orbitfx/hello-view.fxml): `src/main/resources/org/example/orbitfx/hello-view.fxml`

### Simulation

- [Simulation loop](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Game.java): `src/main/java/org/example/orbitfx/Game.java`
- [Celestial bodies](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Planet.java): `src/main/java/org/example/orbitfx/Planet.java`

### User interaction

- [UI manager](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/UIManager.java): `src/main/java/org/example/orbitfx/UIManager.java`
- [Camera focus](https://github.com/pandolarek/orbitfx/blob/master/src/main/java/org/example/orbitfx/Camera.java): `src/main/java/org/example/orbitfx/Camera.java`

### Other components

- **User**

## Connections

- User → Application entry: launches (evidence: `README.md`)
- User → UI manager: controls (evidence: `README.md`)
- UI manager → JavaFX view: updates
- UI manager → Simulation loop: controls
- UI manager → Camera focus: focuses
- Simulation loop → Celestial bodies: simulates
