---

# (DD05) Business Logic — UI.comboBox1() [7 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.github.blaxk3.ui.UI` |
| Layer | UI / Presentation Component |
| Module | `ui` (Package: `com.github.blaxk3.ui`) |

## 1. Role

### UI.comboBox1()

This method builds and returns the first currency-selection combo box used by the UI screen. Its business role is to prepare a reusable presentation component with a fixed visual size and then populate it asynchronously with currency codes so the screen can offer a selectable list of currencies. The method applies a simple factory-style construction pattern: it instantiates the Swing component, configures its display dimensions, and delegates data loading to the nested `CurrencyCode` worker. In the larger system, it acts as a shared screen-building utility rather than a business rule engine, because its responsibility is limited to UI composition and deferred list population. There are no conditional branches in this method; it always creates the same component, applies the same size, and triggers the same asynchronous loading path.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["comboBox1()"])
    CREATE["Create JComboBox instance"]
    SIZE["Set preferred size to 300x30"]
    ASYNC["Instantiate CurrencyCode with combo box"]
    EXEC["CurrencyCode.execute()"]
    RETURN["Return comboBox1 component"]

    START --> CREATE
    CREATE --> SIZE
    SIZE --> ASYNC
    ASYNC --> EXEC
    EXEC --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | - |

**External state read by this method:** the instance field `comboBox1` is assigned and returned. The method also relies on the nested `CurrencyCode` worker to populate the combo box asynchronously after the method returns.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CurrencyRateAPI.getCurrencyCode()` | `-` | Currency code source exposed by the API | Reads the available currency codes used to populate the combo box options |

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: -

Trace who calls this method and what this method ultimately calls.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:UI | `UI.panelFramePanel1.add(comboBox1())` -> `UI.comboBox1()` | `CurrencyRateAPI.getCurrencyCode() [R] Currency code source` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SEQUENCE] `(method entry)` (L95)

> Builds the combo box component and starts asynchronous currency-code loading.

| # | Type | Code |
|---|------|------|
| 1 | SET | `comboBox1 = new JComboBox<>();` |

**Block 2** — [SEQUENCE] `(component sizing)` (L96)

> Applies the fixed presentation size required by the UI layout.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `comboBox1.setPreferredSize(new Dimension(300, 30));` |

**Block 3** — [SEQUENCE] `(async population start)` (L97)

> Creates the background worker that retrieves currency codes for the drop-down list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `new CurrencyCode(comboBox1).execute();` |

**Block 4** — [SEQUENCE] `(return component)` (L99)

> Returns the initialized combo box to the caller so the UI can render it immediately.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return comboBox1;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox1` | UI field | First currency selection drop-down on the screen |
| `JComboBox` | Technical term | Swing drop-down component used to present selectable values |
| `CurrencyCode` | Technical term | Background worker that loads currency codes asynchronously |
| `CurrencyRateAPI` | Service/API | External service used to retrieve available currency codes |
| `execute()` | Technical term | Starts the SwingWorker background task |
| `setPreferredSize` | Technical term | UI sizing method used to control component layout |
| `Dimension(300, 30)` | Technical term | Fixed width and height for the combo box display area |
| `Currency code` | Business term | ISO-style code representing a tradable currency used in the UI selection list |
