# hugoquinn2/fxpopup architecture

> Architecture diagram of the GitHub repository hugoquinn2/fxpopup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hugoquinn2/fxpopup
- Repository: https://github.com/hugoquinn2/fxpopup

## Overview

##### Main Components

a) Core Components Layer:
- FxPopup Controller (central component)
- Message System
- Form System
- Theme Management

b) Configuration Layer:
- FxPopupConfig
- StyleConfig
- FieldData

c) Service Layer:
- OpenStreetMapService
- SVGLoader
- ThemeDetector

##### Component Relationships

**┌─────────────────────────────────────── UI Layer ───────────────────────────────────────┐**

- ┌─── Message UI ───┐    ┌─── Form UI ───┐                                           │
- Popup Views   │    │  - Auto Forms │                                           │
- FXML Layout   │    │  - Validation │                                           │
- ┘    └───────────────┘                                           │

- Core Controller Layer ─────────────────────────────────────┤

- ┌─── FxPopup ────┐     ┌─── Message System ───┐    ┌─── Form System ────┐          │
- MessageField      │    │  - FxPopupForm     │          │
- Main Control  │◄───►│  - MessageForm      │    │  - Form Generation │          │
- Center      │     │  - Message Handling  │    │  - Validation     │          │
- ┘     └───────────────────┘    └──────────────────┘          │

- Service Layer ──────────────────────────────────────────┤

- ┌─── Theme Service ──┐   ┌─── SVG Service ───┐    ┌─── Map Service ────┐           │
- Style Loading   │   │  - SVG Processing │    │    Integration     │           │
- ┘   └─────────────────┘    └──────────────────┘           │

- Configuration Layer ───────────────────────────────────────┤

- ┌─── Config Objects ─┐   ┌─── Constants ────┐                                       │
- FxPopupConfig   │   │  - FieldType     │                                       │
- StyleConfig     │   │  - MessageType   │                                       │
- FieldData       │   │  - Theme         │                                       │
- ┘   └────────────────┘                                       │

- ┘

##### Important Elements to Highlight

- Bidirectional flow between FxPopup and Message/Form systems
- Theme application flow from Theme Service to UI components
- Configuration injection paths

b) External Dependencies:
- JavaFX framework integration
- FXML resource loading
- CSS theme files

##### Notes for Implementation Details

- How the library integrates with host applications
- Where custom implementations can be plugged in
- Points where theme customization is possible
- Error handling flow

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#e1f5fe,stroke:#01579b
    classDef core fill:#e8f5e9,stroke:#1b5e20
    classDef service fill:#fff3e0,stroke:#e65100
    classDef config fill:#f5f5f5,stroke:#212121

    %% UI Layer
    subgraph UI
        MessageUI["Message UI<br/>- Popup Views<br/>- FXML Layout"]:::ui
        FormUI["Form UI<br/>- Auto Forms<br/>- Validation"]:::ui
    end

    %% Core Controller Layer
    subgraph Core
        FxPopup["FxPopup Controller<br/>Main Control Center"]:::core
        MessageSystem["Message System<br/>- MessageField<br/>- MessageForm<br/>- Message Handling"]:::core
        FormSystem["Form System<br/>- FxPopupForm<br/>- Form Generation<br/>- Validation"]:::core
    end

    %% Service Layer
    subgraph Services
        ThemeService["Theme Service<br/>- Theme Detection<br/>- Style Loading"]:::service
        SVGService["SVG Service<br/>- Icon Loading<br/>- SVG Processing"]:::service
        MapService["Map Service<br/>- OpenStreetMap<br/>Integration"]:::service
    end

    %% Configuration Layer
    subgraph Config
        ConfigObjects["Config Objects<br/>- FxPopupConfig<br/>- StyleConfig<br/>- FieldData"]:::config
        Constants["Constants<br/>- FieldType<br/>- MessageType<br/>- Theme"]:::config
    end

    %% Relationships
    FxPopup <--> MessageSystem
    FxPopup <--> FormSystem
    MessageSystem --> MessageUI
    FormSystem --> FormUI
    ThemeService --> MessageUI
    ThemeService --> FormUI
    ConfigObjects --> FxPopup
    Constants --> MessageSystem
    Constants --> FormSystem
    SVGService --> MessageUI
    MapService --> FormUI

    %% Click Events
    click FxPopup "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/java/io/github/hugoquinn2/fxpopup/controller/FxPopup.java"
    click MessageSystem "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/java/io/github/hugoquinn2/fxpopup/controller/MessageForm.java"
    click FormSystem "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/java/io/github/hugoquinn2/fxpopup/controller/FxPopupForm.java"
    click ThemeService "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/java/io/github/hugoquinn2/fxpopup/service/ThemeDetector.java"
    click SVGService "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/java/io/github/hugoquinn2/fxpopup/service/SVGLoader.java"
    click MapService "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/java/io/github/hugoquinn2/fxpopup/service/OpenStreetMapService.java"
    click ConfigObjects "https://github.com/HugoQuinn2/fxpopup/tree/master/src/main/java/io/github/hugoquinn2/fxpopup/config"
    click Constants "https://github.com/HugoQuinn2/fxpopup/tree/master/src/main/java/io/github/hugoquinn2/fxpopup/constants"
    click MessageUI "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/resources/layout/MessageForm.fxml"
    click FormUI "https://github.com/HugoQuinn2/fxpopup/blob/master/src/main/resources/layout/popupSimple.fxml"

    %% Legend
    subgraph Legend
        L1["UI Component"]:::ui
        L2["Core Component"]:::core
        L3["Service Component"]:::service
        L4["Config Component"]:::config
    end
```
