Skip to content

Desktop views

A scene consists of a main .fxml file located in src/views/ and a corresponding controller class located in org.blockchainbench.desktop.controller. The FXML file can be opened and configured in SceneBuilder; it defines the layout of the scene. The controller defines the handlers for the buttons and the dynamic rendering of the items located on the scene. Additionally, a scene can open multiple dialogs.

There are three main views:

ViewControllerPurpose
config.fxmlConfigControllerLets the user edit configurations and start a simulation based on them, or import results to jump to the results view immediately.
simulation.fxmlSimulationControllerShows the live progress of a running group and routes to the results view on completion.
result.fxmlResultsControllerPresents the collected results of a finished group.

They are complemented by dialogs and detail windows:

ViewControllerOpened from
simulation_config_dialog.fxmlSimulationConfigDialogControllerConfiguration: Add / Edit a single row
model_editor.fxmlModelEditorControllerConfiguration: New… / Edit… next to the blockchain model
run_details.fxmlRunDetailsControllerResults: Show Details
pareto_view.fxmlParetoViewControllerRun details: the Pareto analysis panel
error_dialog.fxmlErrorDialogControllerEvery scene, whenever an error occurs

SceneManager handles the navigation between scenes by loading the next scene with the given data. It keeps the primary Stage and exposes one method per screen: showConfig, showSimulation, showResults, and so on.

stateDiagram-v2
  direction LR

  [*] --> Config
  Config --> Sim : run simulation
  Config --> Results : import results
  Sim --> Results : sim finished
  Sim --> Config : cancelled
  Results --> Config : new simulation

The configuration view: base configuration on the left, the simulation configuration table on the right, with the five areas described below marked 1 to 5

  1. General configuration — the BaseConfig shared by all runs of the group: simulation type (Monte-Carlo or single), mode (NORMAL or ATTACK), the blockchain model, the number of Monte-Carlo rounds, the maximum blockchain length, and the four evaluation thresholds. New, Load JSON and Save JSON manage the base configuration as a file.
  2. Simulation configurations — one SimulationConfig per row, loaded from and saved to CSV. Each row becomes one run.
  3. Blockchain model — the path to the model the runs are simulated against. Browse picks an existing model, New… and Edit… open the model editor.
  4. Edit opens a dialog that allows editing a single row; Add and Delete manage rows.
  5. Import Results lets the user choose a .json result file and opens the results view directly. Run Simulation starts a simulation with the configured configurations.

The Tutorial button in the bottom-left corner starts a guided walkthrough of the view; the same button exists on the results view, the run details and the edit dialog.

stateDiagram-v2
    direction LR
    bmd: opens model_editor.fxml
    sd : opens simulation_config_dialog.fxml
    [*] --> Configuration
    state Configuration{
        direction TB
        [*] --> editing
        editing --> BlockchainModel : 3. New / Edit
        editing --> Simulation : 4. Edit
        editing --> editing : edit values
        Simulation --> editing : close / save
        BlockchainModel --> editing : close / save
        state BlockchainModel{
            bmd
        }
        state Simulation{
            sd
        }
    }
    editing --> Simulating : Run Simulation
    Configuration --> Results : Import Results

    state Simulating {
        Running
        Running : Simulation is running
    }

    Simulating --> Results

    state Results {
        ShowResults
        ShowResults : Show results
    }

The model editor walks the blockchain system model as a tree — the BlockchainSystem, the P2P network, the node component repository, node allocation, geographical regions, link allocation and transactions — and edits the selected element’s properties in place. New Child and Delete change the tree, Save writes the model back to its folder.

The model editor: the model tree on the left, the property form of the selected BlockchainSystemSpecification on the right

The dialog edits one row of the simulation configuration table, grouped into network (config id, Hnode, Hlink), consensus (block interval, hashrate concentration, validators) and attack (attackers, inbound and outbound connections, maximum block size) parameters.

The simulation configuration dialog with its Network, Consensus and Attack sections

This view shows the progress of the current runs: the run counter, the group status, a progress bar and the live console output of the simulator. Cancel lets the current run finish, marks the remaining queued runs as cancelled and then opens the results view for the runs that did complete.

The running-simulation view: 2 of 33 runs finished, status RUNNING, progress bar and the simulator log

The results view lists the runs of the finished group. Green runs completed successfully, grey runs were cancelled and red runs failed; a banner at the top summarises the outcome, and clicking a failed run shows the reason. Show Details opens the run details, Export Results (as JSON) writes the group to disk, and New Simulation returns to the configuration view.

The results view: a green banner "All 33 runs completed successfully" above a grid of green run chips

Show Details opens run_details.fxml, which displays a detailed view of the run results: a header with simulation time and memory, a run selector with the filter sidebar, the tabs (Overview, General results, Base config, Input parameters, Attack, Averages, Rounds), a chart of the selected metric across all runs of the group, and the Pareto analysis cube on the right.

The run details window: metric table and per-metric bar chart on the left, the rotatable Pareto cube on the right

How the points in the cube are computed is described in How the Pareto calculation works.

error_dialog.fxml can be displayed from every scene and is called if an error occurs.