the Subject whose value this ParameterString represents
the language-independent name of this Parameter; the English name can be passed in here because it will be run thru Util.toName.
the localized name of this Parameter
A function with no arguments that returns the value of this Parameter
A function with one argument that sets the value of this Parameter
Optional
opt_choices: string[]the translated localized strings corresponding to the values (optional)
Optional
opt_values: string[]the language-independent strings that the parameter can be set to (optional) When specified, only these values are allowed.
Private
choices_the translated localized strings corresponding to the values
Private
maxmaximum length of string
Private
suggestedsuggested length of string for making a control
Private
values_the language-independent strings that the parameter can be set to
Returns the localized strings corresponding to the possible values from getValues. See Internationalization.
the localized strings corresponding to the possible values
Returns the maximum length of the string. setValue will throw an Error if trying to set a string longer than this.
the maximum length of the string
Name of this SubjectEvent, either the language-independent name for scripting purposes or the localized name for display to user.
The language-independent name should be the
same as the English version but capitalized and with spaces and dashes replaced by
underscore, see Util.toName and nameEquals
.
Optional
opt_localized: booleantrue
means return the localized version of the name;
default is false
which means return the language independent name.
name of this object
Returns the set of values corresponding to getChoices that this Parameter can be set to.
set of values that this Parameter can be set to, in string form.
Returns whether the value is being automatically computed; setting the value of this Parameter has no effect.
Examples of automatically computed Parameters: the variables that give the current energy of a simulation. Another example is when the size of a graph's SimView is under control of an AutoScale.
whether the value is being automatically computed
Whether this SubjectEvent has the given name, adjusting for the transformation to a language-independent form of the name, as is done by Util.toName.
the English or language-independent version of the name
whether this SubjectEvent has the given name (adjusted to language-independent form)
Sets the choices and values associated with this Parameter. See Internationalization.
localized strings giving name of each choice
the values corresponding to each choice
Optional
opt_broadcast: booleanwhether to broadcast this change to the Subject's Observers, default is true
if values
is of different length than choices
Sets whether the value is being automatically computed. See isComputed.
whether the value is being automatically computed.
Sets a function which transforms the input string passed to setValue. For example, a function to transform strings to uppercase.
function to be used to transform input passed to setValue
or null
for no transformation
this ParameterString for chaining setters
Sets the maximum length of the string. setValue will throw an Error if trying to set a string longer than this.
the maximum length of the string
this ParameterString for chaining setters
if the max length is less than length of current value of this Parameter.
Sets the suggested length of string when making a user interface control.
suggested length of string to show
this Parameter for chaining setters
Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.
For an object whose main purpose is to represent another Printable object, it is
recommended to include the result of calling toStringShort
on that other object.
For example, calling toStringShort()
on a DisplayShape might return something like
this:
DisplayShape{polygon:Polygon{'chain3'}}
a minimal string representation of this object.
Generated using TypeDoc
Provides access to a string value of a Subject. See Parameter for more information.
See Internationalization for information about localized and language-independent strings.