search

Class myphysicslab.lab.controls.CheckBoxControlBase

Provided By
All Implemented Interfaces
All Known Direct Subclasses

Creates a checkbox user interface control which executes a specified function. You specify the functions for getting and setting the target boolean value which this control is tracking.

Because this is an Observer, you can connect it to a Subject; when the Subject broadcasts events, this checkbox will ensure that it reflects the current target boolean value.

This is the base class for myphysicslab.lab.controls.CheckBoxControl which which connects to a myphysicslab.lab.util.ParameterBoolean.

new CheckBoxControlBase( label, getter, setter, checkBox )

Parameters
labelstring

the name shown in a label next to the checkbox

getterfunction(): boolean

function that returns the current target state

setterfunction(boolean): ?

function to change the target state

checkBox(HTMLInputElement|undefined)

the checkbox to use; if not provided, then a checkbox is created.

Instance Methods