# zev-g/jfxide architecture

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

- Interactive diagram: https://gitdiagram.com/zev-g/jfxide
- Repository: https://github.com/zev-g/jfxide

## Overview

##### Project Type and Purpose
- JFxIDE is a standalone desktop application (an IDE) written in Java.
- It provides a code‐editor (built on RichTextFX and JavaFX), syntax highlighting, intelligent autocomplete, tooltips, file‐tree navigation, an addon/plugin system, and customizable themes/settings stored in JSON (via GSON).

##### High‐Level Components
a. UI Layer (JavaFX)
- Main Application Window (Main.java, FakeMain.java)
- Editor Pane (RichTextFX integration under tmw.me.com.ide.codeEditor & draganddrop)
- File Tree View (tmw.me.com.ide.fileTreeView)
- Console/Command Panel (betterfx package)
- Panels & Popups (notifications, settings, tooltips, minimap)
b. Core Logic
- IDE Core & Plugin Manager (AddonBase, Ide.java, IdeSpecialParser)
- Language Subsystem
– Syntax Manager & SyntaxPiece factories
– Parser (language.interpretation.parse.Parser)
– Interpreter/Runtime (language.interpretation.run)
– Built-in language addons (JavaFXAddon, SkriptLanguage, etc.)
c. Data & Configuration
- Settings & Themes (JSON files managed by GSON under resources/ide/settings & resources/ide/styles)
- Language definitions and styles (resources/ide/editor/languages & styles)
d. Utility Libraries
- jfxhelper (CSS/Node utilities)
- javaPlayground (in-memory compile/evaluate engine)

##### Relationships and Data Flows
- User interacts with JavaFX UI → UI controllers forward events to:
- Editor component → passes text to SyntaxHighlighter → invokes SyntaxManager & Parser → updates editor styling
- Autocomplete engine (ExpressionVisual, ConsoleEvent) → displays suggestions
- FileTreeView → loads/saves files from local filesystem
- Console → sends commands to javaPlayground or language interpreter
- Plugin system (AddonBase) loads JSON addon descriptors → extends language features or UI elements
- Settings subsystem reads/writes JSON → propagates theme/style changes to UI

##### Key Architectural Patterns
- Modular monolith separated into UI, core logic, data/config, utilities.
- Plugin architecture: AddonBase + JSON‐driven discovery.
- MVC‐like for the editor (Model: document + syntax tree; View: RichTextFX pane; Controller: codeEditor classes).
- Factory pattern in syntaxPiece and highlighting.
- Observer/event schedulers for UI updates and concurrency.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        MainApp["Main Application Window"]:::ui
        FakeMain["FakeMain Entry"]:::ui
        EditorPane["Editor Pane"]:::ui
        FileTreeViewModule["File Tree View"]:::ui
        ConsoleModule["Console/Command Panel"]:::ui
        PanelsPopups["Panels & Popups"]:::ui
    end

    %% Core Logic
    subgraph "Core Logic"
        direction TB
        IDECore["IDE Core"]:::core
        PluginManager["Plugin Manager"]:::plugin
        SpecialParser["IdeSpecialParser"]:::core
    end

    %% Language Engine
    subgraph "Language Engine"
        direction TB
        SyntaxManager["Syntax Manager"]:::lang
        ParserModule["Parser"]:::lang
        Interpreter["Interpreter/Runtime"]:::lang
        LanguageAddons["Built-in Language Addons"]:::lang
    end

    %% Data & Config
    subgraph "Data & Configuration"
        direction TB
        SettingsThemes["Settings & Themes (JSON + GSON)"]:::data
        Resources["Resource Files (languages/styles/css)"]:::data
    end

    %% Utilities
    subgraph "Utilities"
        direction TB
        JfxHelper["jfxhelper"]:::util
        Tools["tools"]:::util
        JavaPlayground["javaPlayground"]:::util
    end

    %% Relationships
    MainApp -->|uses| EditorPane
    FakeMain -->|launches| MainApp
    EditorPane -->|syntax highlight flow| SyntaxManager
    SyntaxManager -->|parses code| ParserModule
    ParserModule -->|builds AST| Interpreter
    FileTreeViewModule -->|load/save| Resources
    ConsoleModule -->|executes commands| JavaPlayground
    ConsoleModule -->|interprets code| Interpreter
    PluginManager -->|extends| LanguageAddons
    PluginManager -->|injects UI| PanelsPopups
    IDECore -->|coordinates| PluginManager
    SettingsThemes -->|applies themes| MainApp
    SettingsThemes -->|provides styles| Resources

    %% Click Events
    click MainApp "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/Main.java"
    click FakeMain "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/FakeMain.java"
    click EditorPane "https://github.com/zev-g/jfxide/tree/master/src/main/java/tmw/me/com/ide/codeEditor"
    click EditorPane "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/draganddrop/CodeArea.java"
    click EditorPane "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/draganddrop/CodeLineVisual.java"
    click EditorPane "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/draganddrop/syntaxvisuals/ExpressionVisual.java"
    click FileTreeViewModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/fileTreeView/FileTreeView.java"
    click FileTreeViewModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/fileTreeView/BufferedImageTranscoder.java"
    click ConsoleModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/betterfx/Console.java"
    click ConsoleModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/betterfx/CommandConsole.java"
    click ConsoleModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/betterfx/ConsoleEvent.java"
    click ConsoleModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/betterfx/TextModifier.java"
    click PanelsPopups "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/notifications/Notification.java"
    click PanelsPopups "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/enclosedpopup/EnclosedPopup.java"
    click PanelsPopups "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/settings/SettingsView.java"
    click IDECore "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/Ide.java"
    click PluginManager "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/AddonBase.java"
    click SpecialParser "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/IdeSpecialParser.java"
    click SyntaxManager "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/language/syntax/SyntaxManager.java"
    click ParserModule "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/language/interpretation/parse/Parser.java"
    click Interpreter "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/language/interpretation/run/AddedListener.java"
    click LanguageAddons "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/language/syntax/addons/JavaFXAddon.java"
    click SettingsThemes "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/ide/settings/IdeSettings.java"
    click Resources "https://github.com/zev-g/jfxide/tree/master/src/main/resources/ide/styles/"
    click Resources "https://github.com/zev-g/jfxide/tree/master/src/main/resources/ide/editor/languages/"
    click Resources "https://github.com/zev-g/jfxide/tree/master/src/main/resources/ide/editor/styles/"
    click JfxHelper "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/jfxhelper/BindingUtils.java"
    click JfxHelper "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/jfxhelper/CssUtils.java"
    click Tools "https://github.com/zev-g/jfxide/tree/master/src/main/java/tmw/me/com/ide/tools/"
    click JavaPlayground "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/javaPlayground/JavaPlayground.java"
    click JavaPlayground "https://github.com/zev-g/jfxide/blob/master/src/main/java/tmw/me/com/javaPlayground/CompileString.java"

    %% Styles
    classDef ui fill:#8FBC8F,stroke:#2E8B57,stroke-width:1px
    classDef core fill:#ADD8E6,stroke:#1E90FF,stroke-width:1px
    classDef lang fill:#87CEFA,stroke:#4682B4,stroke-width:1px
    classDef plugin fill:#FFA500,stroke:#FF8C00,stroke-width:1px
    classDef data fill:#D3D3D3,stroke:#696969,stroke-width:1px
    classDef util fill:#F0E68C,stroke:#DAA520,stroke-width:1px
```
