---
# (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 constructs the first currency selection control used by the currency converter screen. It creates a fresh `JComboBox`, configures its visual footprint to match the screen layout, and then delegates population of the dropdown values to the asynchronous `CurrencyCode` worker. In business terms, this is the “source currency” selector that allows the user to choose the currency code to convert from.

The method is a lightweight UI factory method rather than a calculation routine. Its role in the wider system is to prepare a reusable presentation component that is later consumed by the conversion action logic in the same screen. The design pattern here is a simple factory/delegation pattern: the method instantiates the component, applies UI constraints, and delegates data loading to a background worker so the screen can render without blocking. There are no conditional branches in this method; the behavior is linear and always produces the same type of component.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["comboBox1()"]
    CREATE["Instantiate JComboBox<String> as comboBox1"]
    SET_SIZE["Set preferred size to 300 x 30"]
    EXEC_WORKER["new CurrencyCode(comboBox1).execute()"]
    RETURN_NODE["Return comboBox1 component"]
    START --> CREATE
    CREATE --> SET_SIZE
    SET_SIZE --> EXEC_WORKER
    EXEC_WORKER --> RETURN_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method accepts no parameters. It uses the owning `UI` instance state only, creates the source-currency dropdown, and triggers asynchronous population of currency codes. |

Instance fields and external state read by the method:
- `comboBox1` instance field is assigned and returned.
- The method indirectly relies on `CurrencyCode` and, through that worker, `CurrencyRateAPI` to fetch available currency codes.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `UI.comboBox1` | UI | - | Calls `comboBox1` in `UI` |

Analyze all method calls within this method and classify each as a CRUD operation.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `CurrencyCode.execute` | `UI` | - | Starts the background worker that will populate the source currency dropdown with available currency codes. |

Notes:
- `new JComboBox<>()` is a UI construction operation, not a CRUD operation against persistent storage.
- `setPreferredSize(...)` is a presentation configuration step, not data CRUD.
- `CurrencyCode.execute()` is classified as a create-style orchestration call because it launches the worker that fills the control with data, but it does not directly access a business table in this method.

## 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: `comboBox1` [-]

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:KKSV0004 | `UI.panel()` -> `UI.comboBox1()` | `CurrencyCode.execute [C] -` |

## 6. Per-Branch Detail Blocks

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

> Creates the source currency selection control and prepares it for asynchronous population.

| # | Type | Code |
|---|------|------|
| 1 | SET | `comboBox1 = new JComboBox<>();` |
| 2 | EXEC | `comboBox1.setPreferredSize(new Dimension(300, 30));` |
| 3 | CALL | `new CurrencyCode(comboBox1).execute();` |
| 4 | RETURN | `return comboBox1;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox1` | Field | Source currency dropdown used to choose the currency being converted from. |
| `comboBox2` | Field | Target currency dropdown used to choose the currency being converted to. |
| Currency Code | Business term | ISO-style currency identifier shown in the dropdown, such as USD or JPY. |
| Currency Converter | Business term | Screen that converts an entered amount from one currency into another. |
| `CurrencyCode` | Class | Background worker that loads available currency codes into a combo box. |
| `CurrencyRateAPI` | Service/API | External rate service used elsewhere in the screen to obtain currency rates and codes. |
| `JComboBox` | UI component | Swing dropdown control that lets the user select one item from a list. |
| `Dimension(300, 30)` | UI setting | Fixed visual size used to align the dropdown with the screen layout. |
| `UI` | Class | Main application window for the currency converter screen. |
