Static
Readonly
LONG_Value of alpha for "long trails" effect.
Static
Readonly
SHORT_Value of alpha for "short trails" effect.
Static
makeMakes a DisplayAxes which shows the simRect of a SimView, adding it to the SimView; and makes a GenericObserver which resizes the axes whenever the SimView's simRect changes (for example because of pan-zoom controls).
the SimView to add axes to
Optional
bottomLeft_opt: booleantrue means to align axes at bottom left. We usually want this for the simulation view. For graphs we want the default which puts the axes thru the origin whenever possible.
the axes that were created
Static
makeMakes pop-up menu of choices for background color plus options for "trails" which turns on the global alpha transparency feature in LabCanvas. See LabCanvas.setAlpha and LabCanvas.setBackground.
the LabCanvas to provide choices for
Static
makeCreates a EasyScriptParser with additional commands 'reset' and 'step' for controlling the SimRunner
list of Subject's to gather Parameters from; note that the order here is significant; the Parameters are processed according to the order of the Subjects in this list.
those Subject's whose initial conditions
change depending on another configuration parameter. Generally this is the
VarsList of a simulation. These must also be included in subjects
.
the SimRunner to use for 'reset' and 'step' commands
the Terminal that executes scripts
the EasyScriptParser for controlling the SimRunner
Static
makeMakes controls for pan and zoom of a SimView. Use gray icons so that they are visible with black background or white background.
the SimView under control
whether the controls should appear over the parent element,
default is true
Optional
resetFunc: (() => void)optional function to execute when click on center button, it should reset the SimView to the original default location and scale; if undefined, then uses current SimView rectangle
the div containing the pan-zoom controls.
Static
makeMake rewind, pause/play, and step controls for SimRunner. Uses icons from the
images
directory with names rewind.png
, forward.png
, pause.png
, next.png
.
the SimRunner to make controls for
Optional
opt_overlay: booleanwhether the controls should appear over the parent_div, default is false.
a GroupControl containing all the controls that were made
Static
makeMakes a ParameterBoolean named SHOW_CLOCK
for a DisplayClock. The
ParameterBoolean causes the DisplayClock to be added to the targetView.
Makes a GenericObserver which observes the targetView and broadcasts the ParameterBoolean whenever the DisplayClock is added or removed from the targetView.
where to show the EnergyBarGraph
where to add the ParameterBoolean
the ParameterBoolean named SHOW_CLOCK
Static
makeMakes a ParameterBoolean named SHOW_ENERGY
for an EnergyBarGraph. The
ParameterBoolean causes the EnergyBarGraph to be added to the targetView.
Sets size of EnergyBarGraph based on the targetView size.
Makes a GenericObserver which observes the targetView and broadcasts the ParameterBoolean whenever the EnergyBarGraph is added or removed from the targetView.
where to show the EnergyBarGraph
where to add the ParameterBoolean
Optional
opt_name: stringname of parameter (optional)
Optional
opt_i18n_name: stringlocalized name of parameter (optional)
the ParameterBoolean named SHOW_ENERGY
Static
makeMakes a ParameterBoolean named PAN_ZOOM
which shows or hides the pan-zoom
controls.
the div containing the pan-zoom controls
where to add the ParameterBoolean
the ParmeterBoolean named PAN_ZOOM
Static
makeURLScriptCreates a 'share' button that allows the user to copy the URL for the current page including the script that will set all of the available Parameters. Presents the user with a prompt showing a text box with the URL + script.
Generated using TypeDoc
A collection of static functions for making controls, used in several applications. CommonControls is a 'static' class, meaning it is not instantiated, instead it only a convenient place to keep several common functions for constructing an application.