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

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

## 1. Role

### UI.comboBox1()

This method initializes the first currency selection control in the UI and returns it as a Swing `Component`. Business-wise, it is responsible for preparing the source-currency dropdown that users use before executing a conversion. The method creates a new empty combo box, applies a fixed presentation size, and then delegates population of the control to `CurrencyCode.execute()`, which suggests a loading/routing pattern rather than inline data assembly.

Within the larger screen flow, this method acts as a reusable UI factory routine for the converter screen. It does not perform conversion logic itself; instead, it prepares the input control that downstream actions, such as the convert and swap buttons, depend on. The method has no conditional branches, loops, or alternate business paths; its behavior is linear and deterministic.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["comboBox1()"])
    N1["Create new JComboBox<String> instance"]
    N2["Set preferred size to 300 x 30"]
    N3["Instantiate CurrencyCode with comboBox1 reference"]
    N4["Execute CurrencyCode loader to populate currency options"]
    END_NODE(["Return comboBox1 component"])

    START --> N1
    N1 --> N2
    N2 --> N3
    N3 --> N4
    N4 --> END_NODE
```

## 3. Parameter Analysis

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

External state read by the method:
- Instance field `comboBox1` is assigned and then returned.
- No other instance fields are read.
- The method delegates population work to `CurrencyCode(comboBox1).execute()`.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `execute` | N/A | N/A | Triggers asynchronous population of the currency-code dropdown. This is a read-oriented UI loading step rather than a database write. |

Notes:
- The method directly calls `new CurrencyCode(comboBox1).execute()`.
- No explicit database table, entity class, or SC/CBS code is visible in the source for this method.
- The call is classified as read-oriented because it appears to load selectable currency values into the UI.

## 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: -

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `UI.panel()` | `UI.panel()` -> `UI.comboBox1()` | `execute [R] N/A` |

## 6. Per-Branch Detail Blocks

**Block 1** — Sequential initialization (L95)

> Creates the first currency dropdown and stores it in the instance field used by the rest of the screen.

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

**Block 2** — Sequential UI sizing and loading (L96-L97)

> Applies the visual size and then triggers asynchronous population of currency options.

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

**Block 3** — Return value (L99)

> Returns the prepared component to the caller for insertion into the screen layout.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox1` | Field / UI control | The source-currency selection dropdown shown on the converter screen. |
| `CurrencyCode` | Class | UI loading helper used to populate currency choices into a combo box. |
| `execute()` | Method | Asynchronous trigger used to run the loading task that fills the combo box with data. |
| `Component` | Technical term | Swing base type returned so the dropdown can be embedded in the panel layout. |
| `UI` | Class | Main currency converter screen class that assembles and wires the user interface. |
| `JComboBox` | Technical term | Swing dropdown control used for currency selection. |
| `Dimension` | Technical term | UI sizing object that defines the preferred control width and height. |
| `Currency` | Business term | A monetary unit such as USD, JPY, or EUR used for conversion selection. |

