ConfigurationEditorState

Host contract for the reusable configuration-editor panels (ParameterPanel, ControlOverridesPanel, RVOverridesPanel, and the composite ConfigurationEditorPanel).

The interface decouples those panels from any specific controller so they can be re-mounted in other GUI surfaces — the Scenario app's per-scenario editor window in particular, which hosts the same three panels against a per-scenario edit-buffer rather than a process-wide controller — and so future non-Swing hosts (web form, CLI editor) can drive the same state shape.

What the host owns

  • Snapshots captured at probe time (modelDefaults, controlsSnapshot, rvSnapshot) — the panels read these once for rendering placeholder text, column populations, and table rows. They do not change during the editor's lifetime.

  • Live state (runOverrides, controlOverrides, rvOverrides) — the panels both subscribe to these flows (to update their displays on external mutation) and push changes via the matching mutators below.

  • Validation bus + EDT-confined coroutine scope — for field-level error markers and panel-internal collectors.

What the panels do

  • Subscribe to the StateFlows for display sync.

  • Call the mutators when the user edits a field, toggles an override checkbox, or clicks Reset-all.

  • Decorate field/row appearance from validation findings via validationBus.

The panels never reach back to host concerns like Save, Run, window title, or dirty-tracking — those belong to the parent frame/controller and are above this interface.

Implementations

  • ksl.app.swing.single.SingleAppController — owns single-app state directly.

  • ksl.app.swing.scenario.ScenarioEditBuffer — adapts a ScenarioSpec-shaped buffer to this contract for the per-scenario editor window.

Properties

Link copied to clipboard
abstract val controlOverrides: StateFlow<ModelControlsExport>

Pending control overrides (all three families).

Link copied to clipboard

Probe-time controls snapshot; drives the rows of ControlOverridesPanel.

Link copied to clipboard
abstract val edtScope: CoroutineScope

EDT-confined scope for panel-internal collectors.

Link copied to clipboard

Probe-time author-curated catalog of nominated inputs and outputs, or null when the model supplied none. Optional metadata: editor panels may use it to label and feature the salient inputs/outputs, but must behave exactly as before when it is null. Defaults to null so hosts that do not supply a catalog need not override it.

Link copied to clipboard

Probe-time model defaults; drives placeholder text in ParameterPanel.

Link copied to clipboard
abstract val runOverrides: StateFlow<ExperimentRunOverrides>

Pending run-parameter overrides.

Link copied to clipboard
abstract val rvOverrides: StateFlow<List<RVParameterOverride>>

Pending RV-parameter overrides.

Link copied to clipboard

Probe-time RV snapshot; drives the rows of RVOverridesPanel.

Link copied to clipboard

Validation feedback bus; panels decorate field/row state from it.

Functions

Link copied to clipboard
abstract fun clearJsonOverride(keyName: String)
Link copied to clipboard
abstract fun clearNumericOverride(keyName: String)
Link copied to clipboard
abstract fun clearRVOverride(rvName: String, paramName: String)
Link copied to clipboard
abstract fun clearStringOverride(keyName: String)
Link copied to clipboard
abstract fun setJsonOverride(keyName: String, jsonValue: String)
Link copied to clipboard
abstract fun setNumericOverride(keyName: String, value: Double)
Link copied to clipboard
abstract fun setRVOverride(rvName: String, paramName: String, value: Double)
Link copied to clipboard
abstract fun setStringOverride(keyName: String, value: String)
Link copied to clipboard