Skip to content

Commit

Permalink
Add tandemSuffix option, specify and match conventions, see phetsims/…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 26, 2022
1 parent 0565bd2 commit e3f7f3c
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 12 deletions.
1 change: 1 addition & 0 deletions js/ABSwitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default class ABSwitch<T> extends HBox {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Switch',
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true // opt into default PhET-iO instrumented enabledProperty
}, providedOptions );
Expand Down
1 change: 1 addition & 0 deletions js/AccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default class AccordionBox extends Node {

// phet-io support
tandem: Tandem.REQUIRED,
tandemSuffix: 'AccordionBox',
phetioType: AccordionBox.AccordionBoxIO,
phetioEventType: EventType.USER,
visiblePropertyOptions: { phetioFeatured: true }
Expand Down
1 change: 1 addition & 0 deletions js/AquaRadioButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default class AquaRadioButton<T> extends Voicing( Node ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'RadioButton',
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true, // opt into default PhET-iO instrumented enabledProperty

Expand Down
1 change: 1 addition & 0 deletions js/AquaRadioButtonGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class AquaRadioButtonGroup<T> extends FlowBox {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'RadioButtonGroup',
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true, // opt into default PhET-iO instrumented enabledProperty

Expand Down
1 change: 1 addition & 0 deletions js/Checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default class Checkbox extends WidthSizable( Voicing( Node ) ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Checkbox',
phetioEventType: EventType.USER,
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true, // opt into default PhET-iO instrumented enabledProperty
Expand Down
1 change: 1 addition & 0 deletions js/ComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export default class ComboBox<T> extends WidthSizable( Node ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'ComboBox',
phetioType: ComboBox.ComboBoxIO,
phetioEventType: EventType.USER,
visiblePropertyOptions: { phetioFeatured: true },
Expand Down
1 change: 1 addition & 0 deletions js/ComboBoxListItemNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default class ComboBoxListItemNode<T> extends Voicing( Node ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Item',

// Together, these options make it possible to reorder the combo box items in studio, and save a customized
// simulation with the new order.
Expand Down
3 changes: 2 additions & 1 deletion js/ExpandCollapseButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default class ExpandCollapseButton extends BooleanRectangularToggleButton
touchAreaYDilation: 5,

// phet-io
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// BooleanRectangularToggleButtonOptions that are controlled by ExpandCollapseButton
Expand Down
1 change: 1 addition & 0 deletions js/NumberPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default class NumberPicker extends AccessibleNumberSpinner( Node, 0 ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Picker',
phetioReadOnly: PhetioObject.DEFAULT_OPTIONS.phetioReadOnly,
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true
Expand Down
1 change: 1 addition & 0 deletions js/NumberSpinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default class NumberSpinner extends AccessibleNumberSpinner( Node, 0 ) {

// PhET-iO
tandem: Tandem.REQUIRED,
tandemSuffix: 'Spinner',
phetioEnabledPropertyInstrumented: true // opt into default PhET-iO instrumented enabledProperty
}, providedOptions );

Expand Down
1 change: 1 addition & 0 deletions js/PageControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default class PageControl extends Node {

// NodeOptions
tandem: Tandem.REQUIRED,
tandemSuffix: 'PageControl',
visiblePropertyOptions: {
phetioFeatured: true
}
Expand Down
1 change: 1 addition & 0 deletions js/Slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export default class Slider extends AccessibleSlider( Node, 0 ) {

// Supertype options
tandem: Tandem.REQUIRED,
tandemSuffix: 'Slider',
phetioType: Slider.SliderIO,
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true // opt into default PhET-iO instrumented enabledProperty
Expand Down
3 changes: 2 additions & 1 deletion js/SliderThumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default class SliderThumb extends Rectangle {
fill: 'rgb( 50, 145, 184 )',
stroke: 'black',
lineWidth: 1,
tandem: Tandem.REQUIRED // Slider.js adds to this tandem to nest its dragListener under the thumb.
tandem: Tandem.REQUIRED, // Slider.js adds to this tandem to nest its dragListener under the thumb.
tandemSuffix: 'ThumbNode'
}, providedOptions );

// Set a default corner radius
Expand Down
3 changes: 2 additions & 1 deletion js/SliderTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default class SliderTrack extends Node {
valueChangeSoundGeneratorOptions: {},

// phet-io
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'TrackNode'
}, providedOptions );

// If no sound generator was provided, create the default.
Expand Down
1 change: 1 addition & 0 deletions js/ToggleSwitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default class ToggleSwitch<T> extends Voicing( Node ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Switch',
phetioEventType: EventType.USER,
phetioReadOnly: PhetioObject.DEFAULT_OPTIONS.phetioReadOnly,
visiblePropertyOptions: { phetioFeatured: true },
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/BooleanRectangularToggleButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export default class BooleanRectangularToggleButton extends RectangularToggleBut

const options = optionize<BooleanRectangularToggleButtonOptions, SelfOptions, RectangularToggleButtonOptions>()( {
content: content,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

super( booleanProperty, false, true, options );
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/BooleanRoundToggleButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class BooleanRoundToggleButton extends RoundToggleButton<boolean> {

const options = optionize<BooleanRoundToggleButtonOptions, SelfOptions, RoundToggleButtonOptions>()( {
content: null,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

const content = new BooleanToggleNode( booleanProperty, trueNode, falseNode, {
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RectangularMomentaryButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class RectangularMomentaryButton<T> extends RectangularButton {
public constructor( property: TProperty<T>, valueOff: T, valueOn: T, providedOptions?: RectangularMomentaryButtonOptions ) {

const options = optionize<RectangularMomentaryButtonOptions, SelfOptions, RectangularButtonOptions>()( {
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RectangularPushButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class RectangularPushButton extends RectangularButton {

const options = optionize<RectangularPushButtonOptions, SelfOptions, SuperOptions>()( {
soundPlayer: pushButtonSoundPlayer,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Save the listener and add it after creating the button model. This is done so that
Expand Down
1 change: 1 addition & 0 deletions js/buttons/RectangularRadioButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default class RectangularRadioButton<T> extends RectangularButton {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button',
phetioReadOnly: PhetioObject.DEFAULT_OPTIONS.phetioReadOnly // to support properly passing this to children, see https://github.com/phetsims/tandem/issues/60
}, providedOptions );

Expand Down
1 change: 1 addition & 0 deletions js/buttons/RectangularRadioButtonGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export default class RectangularRadioButtonGroup<T> extends FlowBox {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'ButtonGroup',
visiblePropertyOptions: { phetioFeatured: true },
phetioEnabledPropertyInstrumented: true, // opt into default PhET-iO instrumented enabledProperty

Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RectangularToggleButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default class RectangularToggleButton<T> extends RectangularButton {
valueOnSoundPlayer: toggleOnSoundPlayer,

// phet-io support
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RoundMomentaryButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default class RoundMomentaryButton<T> extends RoundButton {
public constructor( property: TProperty<T>, valueOff: T, valueOn: T, providedOptions?: RoundMomentaryButtonOptions ) {

const options = optionize<RoundMomentaryButtonOptions, SelfOptions, RoundButtonOptions>()( {
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RoundPushButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default class RoundPushButton extends RoundButton {

const options = optionize<RoundPushButtonOptions, SelfOptions, SuperOptions>()( {
soundPlayer: pushButtonSoundPlayer,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Save the listener and add it after creating the button model. This is done so that
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RoundStickyToggleButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default class RoundStickyToggleButton<T> extends RoundButton {
soundPlayer: pushButtonSoundPlayer,

// RoundButtonOptions
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/RoundToggleButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default class RoundToggleButton<T> extends RoundButton {
valueOnSoundPlayer: toggleOnSoundPlayer,

// phet-io support
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Expand Down
1 change: 1 addition & 0 deletions js/buttons/TextPushButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default class TextPushButton extends RectangularPushButton {

// RectangularPushButtonOptions
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button',
innerContent: text
}, providedOptions );

Expand Down

0 comments on commit e3f7f3c

Please sign in to comment.