Skip to content

PreferencesModel

Overview

A Class that manages Simulation features that are enabled and disabled by user Preferences.

@author Jesse Greenberg

Class PreferencesModel

import { PreferencesModel } from 'scenerystack/sim';

Constructor

new PreferencesModel( providedOptions : PreferencesModelOptions )

Instance Methods

preferenceModelHasCustom( preferenceModel : Required<CustomPreferencesOptions> ) : boolean

supportsSimulationPreferences() : boolean

Returns true if the SimulationModel supports any preferences that can be changed.

supportsVisualPreferences() : boolean

Returns true if the VisualModel has any preferences that can be changed.

supportsAudioPreferences() : boolean

Returns true if the AudioModel has any preferences that can be changed.

supportsInputPreferences() : boolean

Returns true if the InputModel has any preferences that can be changed.

supportsLocalizationPreferences() : boolean

Returns true if the LocalizationModel has any preferences that can be changed.

shouldShowDialog() : boolean

Returns true if this model supports any controllable preferences for the dialog. Returns false when the dialog would have nothing to display.

Instance Properties

simulationModel : SimulationModel

(readonly)

visualModel : VisualModel

(readonly)

audioModel : AudioModel

(readonly)

inputModel : InputModel

(readonly)

localizationModel : LocalizationModel

(readonly)

Static Properties

PreferencesModelIO : IOType

Type AudioModel

Model for controls that appear in the "Audio" panel of preferences

import type { AudioModel } from 'scenerystack/sim';

Required<AudioPreferencesOptions>

Type InputModel

import type { InputModel } from 'scenerystack/sim';

Required<InputPreferencesOptions>

Type LocalizationModel

import type { LocalizationModel } from 'scenerystack/sim';

Required<LocalizationPreferencesOptions>

Type PreferencesModelOptions

import type { PreferencesModelOptions } from 'scenerystack/sim';
  • simulationOptions?: SimulationPreferencesOptions
    configuration for controls in the "Simulation" tab of the PreferencesDialog
  • visualOptions?: VisualPreferencesOptions
    configuration for controls in the "Visual" tab of the PreferencesDialog
  • audioOptions?: AudioPreferencesOptions
    configuration for controls in the "Audio" tab of the PreferencesDialog
  • inputOptions?: InputPreferencesOptions
    configuration for controls in the "Input" tab of the PreferencesDialog
  • localizationOptions?: LocalizationPreferencesOptions
    configuration for controls in the "Localization" tab of the PreferencesDialog
  • & PhetioObjectOptions

Type SimulationModel

Model for controls that appear in the "Simulation" panel of preferences

import type { SimulationModel } from 'scenerystack/sim';
  • tandemName: string
  • & Required<SimulationPreferencesOptions>

Type VisualModel

Model for controls that appear in the "Visual" panel of preferences

import type { VisualModel } from 'scenerystack/sim';

Required<VisualPreferencesOptions>

Source Code

See the source for PreferencesModel.ts in the joist repository.