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 22a1097 commit c884a30
Show file tree
Hide file tree
Showing 28 changed files with 49 additions and 20 deletions.
3 changes: 2 additions & 1 deletion js/BicyclePumpNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ export default class BicyclePumpNode extends Node {
handleCursor: 'ns-resize',

// NodeOptions
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'PumpNode'
}, providedOptions );

const width = options.width;
Expand Down
3 changes: 2 additions & 1 deletion js/ClapperboardButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class ClapperboardButton extends Node {
},

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

super( options );
Expand Down
3 changes: 2 additions & 1 deletion js/EyeDropperNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export default class EyeDropperNode extends Node {

// NodeOptions
cursor: 'pointer',
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'DropperNode'
}, provideOptions );

super();
Expand Down
1 change: 1 addition & 0 deletions js/FaucetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default class FaucetNode extends AccessibleSlider( Node, 0 ) {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'FaucetNode',
phetioType: FaucetNode.FaucetNodeIO,
phetioEventType: EventType.USER
}, providedOptions );
Expand Down
1 change: 1 addition & 0 deletions js/FineCoarseSpinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default class FineCoarseSpinner extends Node {
// NodeOptions
disabledOpacity: 0.5, // {number} opacity used to make the control look disabled
tandem: Tandem.REQUIRED,
tandemSuffix: 'Spinner',
phetioEnabledPropertyInstrumented: true
}, providedOptions );

Expand Down
3 changes: 2 additions & 1 deletion js/GaugeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export default class GaugeNode extends Node {
updateWhenInvisible: true,

// NodeOptions
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Node'
}, providedOptions );

assert && assert( options.span <= 2 * Math.PI, `options.span must be <= 2 * Math.PI: ${options.span}` );
Expand Down
1 change: 1 addition & 0 deletions js/HeaterCoolerFront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default class HeaterCoolerFront extends Node {

// NodeOptions
tandem: Tandem.REQUIRED,
tandemSuffix: 'HeaterCoolerNode',
phetioType: Node.NodeIO
}, providedOptions );

Expand Down
3 changes: 2 additions & 1 deletion js/HeaterCoolerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export default class HeaterCoolerNode extends Node {
baseColor: HeaterCoolerFront.DEFAULT_BASE_COLOR,

// NodeOptions
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'HeaterCoolerNode'
}, providedOptions );

this.heatCoolAmountProperty = heatCoolAmountProperty;
Expand Down
3 changes: 2 additions & 1 deletion js/LaserPointerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ const DEFAULT_OPTIONS = optionize<LaserPointerNodeOptions, SelfOptions, NodeOpti
proportionStickingOut: 0.5
},

tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: [ 'LaserPointerNode', 'LightNode' ]
} );
assert && Object.freeze( DEFAULT_OPTIONS );

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

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'Control',
phetioType: NumberControl.NumberControlIO,
phetioEnabledPropertyInstrumented: true, // opt into default PhET-iO instrumented enabledProperty
visiblePropertyOptions: { phetioFeatured: true }
Expand Down
3 changes: 2 additions & 1 deletion js/RulerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class RulerNode extends Node {
tickMarksOnBottom: true,

// NodeOptions
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'RulerNode'
}, providedOptions );

// things you're likely to mess up, add more as needed
Expand Down
3 changes: 2 additions & 1 deletion js/SpectrumSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export default class SpectrumSlider extends AccessibleSlider( Node, 0 ) {
cursorStroke: 'black',

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

}, providedOptions );

Expand Down
3 changes: 2 additions & 1 deletion js/StopSignNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export default class StopSignNode extends Node {
outerStroke: 'black',

// NodeOptions
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'StopSignNode'
}, providedOptions );

options.children = [
Expand Down
1 change: 1 addition & 0 deletions js/Stopwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default class Stopwatch extends PhetioObject {

// PhetioObjectOptions
tandem: Tandem.REQUIRED,
tandemSuffix: 'Stopwatch',
phetioType: ReferenceIO( IOType.ObjectIO ),
phetioState: false
}, providedOptions );
Expand Down
5 changes: 3 additions & 2 deletions js/TimeControlNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export default class TimeControlNode extends Node {
disabledOpacity: SceneryConstants.DISABLED_OPACITY,

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

Expand All @@ -114,7 +115,7 @@ export default class TimeControlNode extends Node {

this.playPauseStepButtons = new PlayPauseStepButtonGroup( isPlayingProperty,
combineOptions<PlayPauseStepButtonGroupOptions>( {
tandem: options.tandem.createTandem( 'playPauseStepButtons' )
tandem: options.tandem.createTandem( 'playPauseStepButtonGroup' )
}, options.playPauseStepButtonOptions ) );
children.push( this.playPauseStepButtons );

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

// phetio
tandem: Tandem.REQUIRED,
tandemSuffix: 'RadioButtonGroup',

// pdom
labelTagName: 'h4',
Expand Down
3 changes: 2 additions & 1 deletion js/WavelengthNumberControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export default class WavelengthNumberControl extends NumberControl {
height: DEFAULT_THUMB_HEIGHT,
cursorHeight: DEFAULT_TRACK_SIZE.height
},
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Control'
}, providedOptions );

const trackNode = new SpectrumSliderTrack( wavelengthProperty, options.range,
Expand Down
3 changes: 2 additions & 1 deletion js/ZoomButtonGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default class ZoomButtonGroup extends FlowBox {
spacing: 0,
orientation: 'horizontal',
align: 'center',
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'ZoomButtonGroup'
}, providedOptions );

// zoom in
Expand Down
3 changes: 2 additions & 1 deletion js/accessibility/GrabDragInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ class GrabDragInteraction extends EnabledComponent {
},

// {Tandem} - For instrumenting
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'GrabDragInteraction'
}, options );

// a second block for options that use other options, therefore needing the defaults to be filled in
Expand Down
1 change: 1 addition & 0 deletions js/bucket/BucketFront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default class BucketFront extends Node {

const options = optionize<BucketFrontOptions, StrictOmit<SelfOptions, 'labelNode'>, NodeOptions>()( {
tandem: Tandem.REQUIRED,
tandemSuffix: 'BucketFrontNode',
cursor: 'pointer'
}, providedOptions );

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

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

// pdom
tagName: 'div', // so that it can receive descriptions
Expand Down
4 changes: 3 additions & 1 deletion js/buttons/RefreshButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default class RefreshButton extends RectangularPushButton {
iconHeight: 35,

// RectangularPushButtonOptions
baseColor: PhetColorScheme.BUTTON_YELLOW
baseColor: PhetColorScheme.BUTTON_YELLOW,

tandemSuffix: 'RefreshButton'
}, providedOptions );

options.content = new Path( syncAltSolidShape, {
Expand Down
1 change: 1 addition & 0 deletions js/buttons/ResetAllButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class ResetAllButton extends ResetButton {

// phet-io
tandem: Tandem.REQUIRED,
tandemSuffix: 'ResetAllButton',
phetioDocumentation: 'The orange, round button that can be used to restore the initial state',

// sound generation
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/ResetButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export default class ResetButton extends RoundPushButton {
xContentOffset: -0.03 * BUTTON_RADIUS,
yContentOffset: -0.0125 * BUTTON_RADIUS,

tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'ResetButton'
}, providedOptions );

// icon, with bounds adjusted so that center of circle appears to be centered on button, see sun#235
Expand Down
3 changes: 2 additions & 1 deletion js/buttons/ZoomButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default class ZoomButton extends RectangularPushButton {

// RectangularPushButtonOptions
baseColor: PhetColorScheme.BUTTON_YELLOW,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Button'
}, providedOptions );

// Plus or minus sign in middle of magnifying glass
Expand Down
3 changes: 2 additions & 1 deletion js/input/MovableDragHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class MovableDragHandler extends SimpleDragHandler {
// the target can be overridden here. This is useful when you need to attach a listener to a sub-component
// of a node hierarchy
targetNode: null,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'DragListener'
}, options );

let startOffset; // where the drag started relative to positionProperty, in parent view coordinates
Expand Down
3 changes: 2 additions & 1 deletion js/keypad/Keypad.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class Keypad extends Node {
accumulatorOptions: null,

// phet-io
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'Keypad'
}, options );

super();
Expand Down
3 changes: 2 additions & 1 deletion js/keypad/NumberAccumulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class NumberAccumulator extends AbstractKeyAccumulator {
options = merge( {
maxDigitsRightOfMantissa: 0,
maxDigits: MAX_DIGITS,
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
tandemSuffix: 'NumberAccumulator'
}, options );

// verify option values
Expand Down

0 comments on commit c884a30

Please sign in to comment.