---

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

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

## 1. Role

### UI.comboBox1()

This method builds and returns the first UI combo box used by the `UI` screen. Its business role is to initialize a selection control for currency codes, size it for consistent screen layout, and immediately start an asynchronous population workflow so the dropdown can be filled without blocking the user interface. The method follows a lightweight builder-and-delegation pattern: it creates the Swing component, applies presentation settings, and delegates data loading to `CurrencyCode`. In the larger system, it serves as a reusable screen construction helper for the currency conversion form, ensuring the dropdown exists early in the screen lifecycle and is ready for later selection-driven calculations. There are no business branches inside the method itself; its behavior is linear and always performs the same UI setup sequence.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["comboBox1()"])
    CREATE(["Create new JComboBox<String>"])
    SET_SIZE(["Set preferred size to 300x30"])
    START_WORKER(["new CurrencyCode(comboBox1).execute()"])
    END_NODE(["Return comboBox1 component"])
    START --> CREATE
    CREATE --> SET_SIZE
    SET_SIZE --> START_WORKER
    START_WORKER --> END_NODE
```

## 3. Parameter Analysis

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

This method has no parameters. It operates on the internal `comboBox1` instance field and uses the surrounding `UI` object state to construct and return the component.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CurrencyCode.execute()` | N/A | Currency code source from `CurrencyRateAPI` | Starts an asynchronous read-style retrieval of currency codes to populate the dropdown values after the component is created. |

`comboBox1()` itself does not directly access a database table. Its only downstream business call is the asynchronous worker launch, which eventually performs a read operation through `CurrencyRateAPI.getCurrencyCode()` inside the nested `CurrencyCode` class.

## 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 | Screen/UI constructor flow | `UI` screen assembly -> `panelFramePanel1.add(comboBox1())` -> `UI.comboBox1()` | `CurrencyCode.execute() [R] CurrencyRateAPI.getCurrencyCode()` |

The only direct caller found in the source is the `UI` screen assembly path that adds the component to the panel. The method then triggers the asynchronous currency-code loading worker, which is the terminal business action reachable from this method.

## 6. Per-Branch Detail Blocks

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

> Initializes the currency selection component for the UI screen.

| # | 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 / UI component | The first dropdown field on the screen, used for selecting a currency code. |
| `CurrencyCode` | Nested worker class | Asynchronous loader that fetches available currency codes and populates the dropdown. |
| `CurrencyRateAPI` | External service | API client that retrieves currency code data from an external source. |
| `JComboBox` | Technical component | Swing dropdown control that allows the user to choose one value from a list. |
| `SwingWorker` | Technical component | Background execution helper that keeps the UI responsive while data is being loaded. |
| `Dimension` | Technical object | Layout size descriptor used to fix the visual width and height of the dropdown. |
| currency code | Business term | Identifier representing a supported currency used in the exchange-rate selection flow. |
| UI | Layer | User interface layer that assembles and presents screen controls to the end user. |
