floodsim.view.component
Members list
Type members
Classlikes
A UI component to select a CellType using clickable icons.
A UI component to select a CellType using clickable icons.
- Displays all available floodsim.model.cell.CellType values in a 2x2 grid with their icons.
- Uses a red border to highlight the currently selected cell type.
- Notifies registered listeners when the selection changes.
- Relies on an in-scope floodsim.view.util.resource.ImageCache to obtain icons.
Attributes
- Supertypes
Displays the current flooded area percentage as a centered label.
Displays the current flooded area percentage as a centered label.
Attributes
- Supertypes
Vertical control panel for simulation actions and status. Provides:
Vertical control panel for simulation actions and status. Provides:
- Buttons to generate a random map, start/pause/stop the simulation, and generate a report.
- A SimulationTimer and a FloodPercentageDisplay to show runtime info.
- A SpeedToggleButton to cycle simulation speed.
- A WeatherToggleButton to show/hide weather overlay.
Attributes
- Supertypes
Displays the simulation elapsed time in mm:ss format.
Displays the simulation elapsed time in mm:ss format.
Attributes
- Supertypes
Button that cycles through predefined simulation speeds with each click.
Button that cycles through predefined simulation speeds with each click.
- The button label is updated to reflect the current speed.
- Registered listeners are notified on every change. Usage:
- Call onSpeedChange to subscribe.
- Retrieve the Swing component via component.
Attributes
- Supertypes
A labeled slider with tick spacing. Tick spacing:
A labeled slider with tick spacing. Tick spacing:
- Major tick spacing is computed from the range size to keep labels readable.
- Minor tick spacing is
major/5(may be zero for small ranges). API: - value to read the current slider value.
- onValueChanged to register a handler fired when the user releases the knob or stops adjusting.
Value parameters
- initial
-
initial slider value
- labelText
-
label shown above the slider
- max
-
slider maximum value
- min
-
slider minimum value
Attributes
- Supertypes
Small facade over Swing components to provide a typed component accessor and helper builders with a consistent application theme.
Small facade over Swing components to provide a typed component accessor and helper builders with a consistent application theme.
Type parameters
- A
-
concrete Swing type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class CellTypeSelectorclass FloodPercentageDisplayclass SimulationControlsclass SimulationTimerclass SpeedToggleButtonclass StyledSliderclass ViewGridclass ViewGridCellclass WeatherToggleButtonclass ParametersPanelclass SimulationPanelclass WelcomePanelShow all
Factory methods for styled Swing components.
Factory methods for styled Swing components.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
UIComponent.type
Interactive grid view composed of ViewGridCell panels. Features:
Interactive grid view composed of ViewGridCell panels. Features:
- Displays a square grid of size
gridSize x gridSize. - Supports click-and-drag painting to set the current floodsim.model.cell.CellType on cells.
- Delegates cell updates to an optional floodsim.controller.SimulationListener.
- Can overlay weather imagery and arbitrary color overlays per cell. Image resources:
- Requires given floodsim.view.util.resource.ImageCache instances for floodsim.model.cell.CellType and floodsim.model.weather.Weather. Coordinates:
- When notifying the listener, the position is provided as
Coordinate(col, row).
Attributes
- Supertypes
A single grid cell view that renders:
A single grid cell view that renders:
- a base tile image for the current floodsim.model.cell.CellType,
- an optional semi-transparent color overlay,
- an optional weather overlay image,
- an optional text label with a dark backdrop for readability.
Value parameters
- cellCol
-
the column index of this cell
- cellRow
-
the row index of this cell
Attributes
- Supertypes
A styled toggle button to show/hide weather overlays or information.
A styled toggle button to show/hide weather overlays or information.
Attributes
- Supertypes