SwingGUI

Deprecated

The Swing UI must be replaced by a web UI

Creates a Swing-based graphical interface for the provided environment. The actual implementation of the main display is chosen based on the type of environment.

Parameters

environment

the simulation environment for this GUI (property)

graphicsFile

optional effects file to load (may be null)

closeOperation

the JFrame close operation constant

failOnHeadless

if true, throw when running in headless mode; otherwise only warn

main

the main display component backing this monitor (property)

Type Parameters

T

the concentration type used by the environment

P

the concrete Position2D type used by the environment

Constructors

Link copied to clipboard
constructor(environment: Environment<T, P>, graphicsFile: File?, failOnHeadless: Boolean = false, closeOperation: Int = JFrame.EXIT_ON_CLOSE)

Builds a single-use graphical interface.

constructor(environment: Environment<T, P>, graphics: String? = null, failOnHeadless: Boolean = false, closeOperation: Int = JFrame.EXIT_ON_CLOSE)

Builds a single-use graphical interface from an effects file path.

Properties

Link copied to clipboard
Link copied to clipboard
open override var isRealTime: Boolean
Link copied to clipboard
open override var step: Int

Functions

Link copied to clipboard
open override fun finished(environment: Environment<T, P>, time: Time, step: Long)

Called once the whole simulation has finished, either because it reached its latest point or because the user stopped it, with the environment, the final time, and the last step.

Link copied to clipboard
open override fun getStep(): Int
Link copied to clipboard
open override fun initialized(environment: Environment<T, P>)

Called as soon as the initialization phase of environment is completed.

Link copied to clipboard
open override fun isRealTime(): Boolean
Link copied to clipboard
open override fun repaint()
Link copied to clipboard
open override fun setDrawLinks(b: Boolean)
Link copied to clipboard
open override fun setEffectStack(l: List<Effect?>?)
Link copied to clipboard
open override fun setMarkCloserNode(mark: Boolean)
Link copied to clipboard
open override fun setRealTime(rt: Boolean)
Link copied to clipboard
open override fun setStep(step: Int)
Link copied to clipboard
open override fun stepDone(environment: Environment<T, P>, reaction: Reaction<T>?, time: Time, step: Long)

Called every time a simulation step is done, with the environment, the last executed reaction (if any), the current time, and the current step.