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

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.

Properties

Link copied to clipboard

Functions

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

This method will be called by the simulation once the whole simulation has finished, either because it reached its latest point or because the user stopped it. Thread safety note: no specific policy is defined for the control flow which will execute this method. A new thread could have been spawned or the same flow of the simulation may execute this method. This depends on the specific it.unibo.alchemist.core.Simulation implementation.

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

This method will be called by the simulation as soon as the initialization phase is completed. Thread safety note: no specific policy is defined for the control flow which will execute this method. A new thread could have been spawned or the same flow of the simulation may execute this method. This depends on the specific it.unibo.alchemist.core.Simulation implementation.

Link copied to clipboard
open override fun isRealTime(): Boolean
Link copied to clipboard
open override fun repaint()

Repaints the GUI.

Link copied to clipboard
open override fun setDrawLinks(b: Boolean)
Link copied to clipboard
open override fun setEffectStack(l: MutableList<Effect>)
Link copied to clipboard
open override fun setMarkCloserNode(mark: Boolean)

If set, the node closer to the mouse will be put in evidence.

Link copied to clipboard
open override fun setRealTime(rt: Boolean)

If enabled, the monitor tries to synchronize the simulation time with the real time, slowing down the simulator if needed. If the simulation is slower than the real time, then the display refreshes fast enough to keep the default frame rate.

Link copied to clipboard
open override fun setStep(step: Int)
Link copied to clipboard
open override fun stepDone(environment: Environment<T, P>, reaction: Actionable<T>?, time: Time, step: Long)

This method will be called by the simulation every time a simulation step is done. Thread safety note: no specific policy is defined for the control flow which will execute this method. A new thread could have been spawned or the same flow of the simulation may execute this method. This depends on the specific it.unibo.alchemist.core.Simulation implementation.