# mh06a/currencyexchange architecture

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

- Interactive diagram: https://gitdiagram.com/mh06a/currencyexchange
- Repository: https://github.com/mh06a/currencyexchange

## Overview

This is a Java Swing desktop currency converter with Arabic and English interfaces. Its main workflow starts at the login screen, where the user chooses a language, then selects currencies and enters an amount in the chosen converter. The interface creates conversion helpers, which parse the selections, calculate using hardcoded currency values, and set the displayed result. The README also describes GUI-based currency selection and manual rates. Source excerpts show the main calls; the value table is excerpted, so its full lookup behavior is not detailed here.

Main entry points: [`src/Arabic.java`](https://github.com/mh06a/currencyexchange/blob/master/src/Arabic.java) (Arabic Converter), [`src/EnglishPage.java`](https://github.com/mh06a/currencyexchange/blob/master/src/EnglishPage.java) (English Converter), [`src/LoginPage.java`](https://github.com/mh06a/currencyexchange/blob/master/src/LoginPage.java) (Language Selection), [`src/CalculateAmounts.java`](https://github.com/mh06a/currencyexchange/blob/master/src/CalculateAmounts.java) (Amount Calculation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application Entry"]
  node_main["Application Launcher<br/>[Main.java]"]
end

subgraph group_interfaces["Language Interfaces"]
  node_login["Language Selection<br/>[LoginPage.java]"]
  node_arabic["Arabic Converter<br/>[Arabic.java]"]
  node_english["English Converter<br/>[EnglishPage.java]"]
end

subgraph group_conversion["Conversion Logic"]
  node_selection["Currency Selection<br/>[ConvertItem.java]"]
  node_calculation["Amount Calculation"]
  node_rates[("Hardcoded Rates")]
  node_result["Result Display<br/>[SetAmounts.java]"]
end

node_user(("User"))

node_user -->|"launches"| node_main
node_main -->|"creates"| node_login
node_login -->|"opens English"| node_english
node_login -->|"opens Arabic"| node_arabic
node_user -->|"chooses language"| node_login
node_user -->|"enters amount"| node_arabic
node_user -->|"enters amount"| node_english
node_arabic -->|"reads selections"| node_selection
node_arabic -->|"calculates amount"| node_calculation
node_arabic -->|"sets result"| node_result
node_english -->|"reads selections"| node_selection
node_english -->|"calculates amount"| node_calculation
node_english -->|"sets result"| node_result
node_calculation -->|"looks up rate"| node_rates
node_result -->|"reads result"| node_calculation

click node_main "https://github.com/mh06a/currencyexchange/blob/master/src/Main.java"
click node_login "https://github.com/mh06a/currencyexchange/blob/master/src/LoginPage.java"
click node_arabic "https://github.com/mh06a/currencyexchange/blob/master/src/Arabic.java"
click node_english "https://github.com/mh06a/currencyexchange/blob/master/src/EnglishPage.java"
click node_selection "https://github.com/mh06a/currencyexchange/blob/master/src/ConvertItem.java"
click node_calculation "https://github.com/mh06a/currencyexchange/blob/master/src/CalculateAmounts.java"
click node_rates "https://github.com/mh06a/currencyexchange/blob/master/src/ConversionValues.java"
click node_result "https://github.com/mh06a/currencyexchange/blob/master/src/SetAmounts.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_user toneBlue
class node_login,node_arabic,node_english toneAmber
class node_selection,node_calculation,node_rates,node_result toneMint
```

## Components

### Application Entry

- [Application Launcher](https://github.com/mh06a/currencyexchange/blob/master/src/Main.java): `src/Main.java`

### Language Interfaces

- [Language Selection](https://github.com/mh06a/currencyexchange/blob/master/src/LoginPage.java): `src/LoginPage.java`
- [Arabic Converter](https://github.com/mh06a/currencyexchange/blob/master/src/Arabic.java): `src/Arabic.java`
- [English Converter](https://github.com/mh06a/currencyexchange/blob/master/src/EnglishPage.java): `src/EnglishPage.java`

### Conversion Logic

- [Currency Selection](https://github.com/mh06a/currencyexchange/blob/master/src/ConvertItem.java): `src/ConvertItem.java`
- [Amount Calculation](https://github.com/mh06a/currencyexchange/blob/master/src/CalculateAmounts.java): `src/CalculateAmounts.java`
- [Hardcoded Rates](https://github.com/mh06a/currencyexchange/blob/master/src/ConversionValues.java): `src/ConversionValues.java`
- [Result Display](https://github.com/mh06a/currencyexchange/blob/master/src/SetAmounts.java): `src/SetAmounts.java`

### Other components

- **User**

## Connections

- User → Application Launcher: launches (evidence: `README.md`)
- Application Launcher → Language Selection: creates (evidence: `src/Main.java`)
- Language Selection → English Converter: opens English (evidence: `src/LoginPage.java`)
- Language Selection → Arabic Converter: opens Arabic (evidence: `src/LoginPage.java`)
- User → Language Selection: chooses language (evidence: `README.md`)
- User → Arabic Converter: enters amount (evidence: `README.md`)
- User → English Converter: enters amount (evidence: `README.md`)
- Arabic Converter → Currency Selection: reads selections (evidence: `src/Arabic.java`)
- Arabic Converter → Amount Calculation: calculates amount (evidence: `src/Arabic.java`)
- Arabic Converter → Result Display: sets result (evidence: `src/Arabic.java`)
- English Converter → Currency Selection: reads selections (evidence: `src/EnglishPage.java`)
- English Converter → Amount Calculation: calculates amount (evidence: `src/EnglishPage.java`)
- English Converter → Result Display: sets result (evidence: `src/EnglishPage.java`)
- Amount Calculation → Hardcoded Rates: looks up rate (evidence: `src/CalculateAmounts.java`)
- Result Display → Amount Calculation: reads result (evidence: `src/SetAmounts.java`)
