Skip to content

Desktop

org.blockchainbench.desktop executes org.blockchainbench.core via a JavaFX UI. It lets a user create and start a custom simulation on the Configuration view and inspect the results on the Results view. The component is packaged as an Eclipse application: the bundle contributes an application through plugin.xml, and that application boots JavaFX.

flowchart LR
  subgraph Configuration
    gen[General configuration]
    sim[Simulation configuration]
    Conf[Configuration]
    impR[Import results]
  end
  subgraph Results
    viewR[View results]
    expo[Export results]
  end
  gen --> Conf
  sim --> Conf
  Conf --> run[Run simulation]
  impR --> Results
  run --> Results

A more detailed description of the different views can be found on Desktop views.

The code is organized into separate packages according to their responsibilities:

org.blockchainbench.desktop/src
├── controller/
│ ├── config/ ConfigController, ModelEditorController, SimulationConfigDialogController
│ ├── general/ ErrorDialogController, LogViewerController
│ ├── results/ ResultsController, RunDetailsController, ParetoViewController
│ └── SimulationController
│
├── service/
│ ├── filter/ filter criteria and the filterable parameter registry for the run details
│ ├── validation/ input validation and formatting
│ └── SimulationService, AverageMetricsIndex, ParetoScoresIndex
│
└── ui/
├── charts/
├── fields/
├── resultPresenter/
├── SceneManager.java
└── ...

To start the application from Eclipse, run the org.blockchainbench.desktop component as an Eclipse Application as described in Build and run. This starts the startup chain, which crosses three layers before any window appears.

sequenceDiagram
  autonumber
  participant PDE as Eclipse application
  participant L as Launcher
  participant App as BlockchainApp
  participant SM as SceneManager
  PDE->>L: start() via plugin.xml
  L->>App: BlockchainApp.main()
  App->>App: Application.launch()
  App->>SM: init(stage)
  App->>SM: showConfig()

Launcher implements the Equinox IApplication contract and simply calls BlockchainApp.main. BlockchainApp is the JavaFX Application; its start hands the primary stage to SceneManager and opens the first screen, the configuration view.

The desktop programs against IBlockchainBench. A run is started by collecting the selected SimulationConfig list and the BaseConfig, then calling bench.submit(...) and navigating to the running-simulation view with the returned id.

SimulationController then observes progress by polling. Its init(id, bench) starts a one-second JavaFX Timeline; each tick reads bench.getSimulation(id), updates the progress bar and status labels from the run counts, and — once the group reaches FINISHED, ERROR or CANCELLED — stops the timer and navigates to the results view. Because the poll runs on the JavaFX application thread, no cross-thread marshalling is needed for these reads.

sequenceDiagram
  autonumber
  participant C as ConfigController
  participant B as IBlockchainBench
  participant S as SimulationController
  C->>B: submit(configs, baseConfig, mode)
  B-->>C: simulationId
  C->>S: SceneManager.showSimulation(id, bench)
  loop every second
    S->>B: getSimulation(id)
    B-->>S: SimulationInfo (status, run counts)
  end
  S->>S: on FINISHED, ERROR or CANCELLED, show results

SimulationService is a singleton that holds the currently selected list of SimulationConfig between screens.

The ui package provides small reusable helpers used mainly by the configuration screen: SpinnerFactory (typed integer and double spinners), TooltipFactory (labelled tooltips), UIFieldRegistry (binding UI fields to model fields), and Validation (input validation). FieldMetadata describes a configuration field for those helpers.

SimulationRunner and the desktop’s own SimulationApplication are headless paths that submit a default run without any UI; they are convenience and test entry points rather than part of the interactive flow. The interactive application always starts through Launcher and BlockchainApp.