diff --git a/js/common/view/EquationAccordionBox.js b/js/common/view/EquationAccordionBox.js index a1204d56..5e792851 100644 --- a/js/common/view/EquationAccordionBox.js +++ b/js/common/view/EquationAccordionBox.js @@ -15,6 +15,7 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const HSeparator = require( 'SUN/HSeparator' ); const SaveCurveControls = require( 'GRAPHING_QUADRATICS/common/view/SaveCurveControls' ); + const Tandem = require( 'TANDEM/Tandem' ); const VBox = require( 'SCENERY/nodes/VBox' ); class EquationAccordionBox extends AccordionBox { @@ -24,16 +25,20 @@ define( require => { * @param {BooleanProperty} expandedProperty * @param {Node} titleNode * @param {Node} interactiveEquationNode - * @param {Tandem} tandem + * @param {Object} [options] * @abstract */ - constructor( model, expandedProperty, titleNode, interactiveEquationNode, tandem ) { + constructor( model, expandedProperty, titleNode, interactiveEquationNode, options ) { - const options = _.extend( { - expandedProperty: expandedProperty, - titleNode: titleNode, - tandem: tandem - }, GQConstants.ACCORDION_BOX_OPTIONS ); + options = _.extend( { + tandem: Tandem.required + }, GQConstants.ACCORDION_BOX_OPTIONS, options ); + + assert && assert( !options.expandedProperty, 'EquationAccordionBox sets expandedProperty' ); + options.expandedProperty = expandedProperty; + + assert && assert( !options.titleNode, 'EquationAccordionBox sets titleNode' ); + options.titleNode = titleNode; const saveCurveControls = new SaveCurveControls( model.saveQuadratic.bind( model ), model.eraseQuadratics.bind( model ), model.savedQuadratics.lengthProperty ); diff --git a/js/common/view/GQScreenView.js b/js/common/view/GQScreenView.js index de746d58..5598779a 100644 --- a/js/common/view/GQScreenView.js +++ b/js/common/view/GQScreenView.js @@ -17,6 +17,7 @@ define( require => { const PointToolNode = require( 'GRAPHING_QUADRATICS/common/view/PointToolNode' ); const ResetAllButton = require( 'SCENERY_PHET/buttons/ResetAllButton' ); const ScreenView = require( 'JOIST/ScreenView' ); + const Tandem = require( 'TANDEM/Tandem' ); const VBox = require( 'SCENERY/nodes/VBox' ); // constants @@ -30,14 +31,16 @@ define( require => { * @param {Node} graphNode * @param {Node} equationControls * @param {Node} graphControls - * @param {Tandem} tandem + * @param {Object} options */ - constructor( model, viewProperties, graphNode, equationControls, graphControls, tandem ) { + constructor( model, viewProperties, graphNode, equationControls, graphControls, options ) { - super( { + options = _.extend( { layoutBounds: GQConstants.SCREEN_VIEW_LAYOUT_BOUNDS, - tandem: tandem - } ); + tandem: Tandem.required + }, options ); + + super( options ); // Point tools moveToFront when dragged, so give them a common parent to preserve rendering order. const pointToolsParent = new Node(); diff --git a/js/common/view/GQViewProperties.js b/js/common/view/GQViewProperties.js index 50f019a1..ae0e53e0 100644 --- a/js/common/view/GQViewProperties.js +++ b/js/common/view/GQViewProperties.js @@ -12,21 +12,22 @@ define( require => { const BooleanProperty = require( 'AXON/BooleanProperty' ); const GQConstants = require( 'GRAPHING_QUADRATICS/common/GQConstants' ); const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); + const Tandem = require( 'TANDEM/Tandem' ); /** - * @param {Tandem} tandem * @param {Object} [options] */ class GQViewProperties { - constructor( tandem, options ) { + constructor( options ) { options = _.extend( { equationForm: 'standard', // see GQConstants.EQUATION_FORMS graphContentsVisible: true, equationsVisible: true, coordinatesVisible: true, - equationAccordionBoxExpanded: true + equationAccordionBoxExpanded: true, + tandem: Tandem.required }, options ); assert && assert( GQConstants.EQUATION_FORMS.includes( options.equationForm ), @@ -37,25 +38,25 @@ define( require => { // @public this.graphContentsVisibleProperty = new BooleanProperty( options.graphContentsVisible, { - tandem: tandem.createTandem( 'graphContentsVisibleProperty' ), + tandem: options.tandem.createTandem( 'graphContentsVisibleProperty' ), phetioInstanceDocumentation: 'whether the contents of the graph are visible' } ); // @public this.equationsVisibleProperty = new BooleanProperty( options.equationsVisible, { - tandem: tandem.createTandem( 'equationsVisibleProperty' ), + tandem: options.tandem.createTandem( 'equationsVisibleProperty' ), phetioInstanceDocumentation: 'whether equations are visible on the graphed lines' } ); // @public this.coordinatesVisibleProperty = new BooleanProperty( options.coordinatesVisible, { - tandem: tandem.createTandem( 'coordinatesVisibleProperty' ), + tandem: options.tandem.createTandem( 'coordinatesVisibleProperty' ), phetioInstanceDocumentation: 'whether coordinates are visible on points and manipulators' } ); // @public this.equationAccordionBoxExpandedProperty = new BooleanProperty( options.equationAccordionBoxExpanded, { - tandem: tandem.createTandem( 'equationAccordionBoxExpandedProperty' ), + tandem: options.tandem.createTandem( 'equationAccordionBoxExpandedProperty' ), phetioInstanceDocumentation: 'whether the equation accordion box is expanded' } ); } diff --git a/js/explore/view/ExploreAccordionBox.js b/js/explore/view/ExploreAccordionBox.js index d4503781..d30c06f1 100644 --- a/js/explore/view/ExploreAccordionBox.js +++ b/js/explore/view/ExploreAccordionBox.js @@ -13,22 +13,27 @@ define( require => { const ExploreInteractiveEquationNode = require( 'GRAPHING_QUADRATICS/explore/view/ExploreInteractiveEquationNode' ); const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const StandardFormEquationNode = require( 'GRAPHING_QUADRATICS/standardform/view/StandardFormEquationNode' ); + const Tandem = require( 'TANDEM/Tandem' ); class ExploreAccordionBox extends EquationAccordionBox { /** * @param {ExploreModel} model * @param {BooleanProperty} expandedProperty - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( model, expandedProperty, tandem ) { + constructor( model, expandedProperty, options ) { + + options = _.extend( { + tandem: Tandem.required + }, options ); const titleNode = new StandardFormEquationNode(); const interactiveEquationNode = new ExploreInteractiveEquationNode( model.quadraticProperty, model.aRange, model.bRange, model.cRange ); - super( model, expandedProperty, titleNode, interactiveEquationNode, tandem ); + super( model, expandedProperty, titleNode, interactiveEquationNode, options ); } } diff --git a/js/explore/view/ExploreScreenView.js b/js/explore/view/ExploreScreenView.js index ad1a7395..4e1475de 100644 --- a/js/explore/view/ExploreScreenView.js +++ b/js/explore/view/ExploreScreenView.js @@ -24,14 +24,24 @@ define( require => { */ constructor( model, tandem ) { - const viewProperties = new ExploreViewProperties( tandem.createTandem( 'viewProperties') ); + const options = { + tandem: tandem + }; + + const viewProperties = new ExploreViewProperties( { + tandem: tandem.createTandem( 'viewProperties' ) + } ); super( model, viewProperties, new ExploreGraphNode( model, viewProperties ), - new ExploreAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, tandem.createTandem( 'equationAccordionBox') ), - new QuadraticTermsAccordionBox( viewProperties, tandem.createTandem( 'quadraticTermsAccordionBox') ), - tandem + new ExploreAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, { + tandem: tandem.createTandem( 'equationAccordionBox' ) + } ), + new QuadraticTermsAccordionBox( viewProperties, { + tandem: tandem.createTandem( 'quadraticTermsAccordionBox' ) + } ), + options ); } } diff --git a/js/explore/view/ExploreViewProperties.js b/js/explore/view/ExploreViewProperties.js index f2cafb9b..7ede832c 100644 --- a/js/explore/view/ExploreViewProperties.js +++ b/js/explore/view/ExploreViewProperties.js @@ -13,38 +13,43 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const GQQueryParameters = require( 'GRAPHING_QUADRATICS/common/GQQueryParameters' ); const GQViewProperties = require( 'GRAPHING_QUADRATICS/common/view/GQViewProperties' ); + const Tandem = require( 'TANDEM/Tandem' ); class ExploreViewProperties extends GQViewProperties { /** - * @param {Tandem} tandem + * @param {Object} options */ - constructor( tandem ) { + constructor( options ) { - super( tandem ); + options = _.extend( { + tandem: Tandem.required + }, options ); + + super( options ); // @public this.quadraticTermsAccordionBoxExpandedProperty = new BooleanProperty( true, { - tandem: tandem.createTandem( 'quadraticTermsAccordionBoxExpandedProperty' ), - phetioDocumentation: 'whether the quadratic terms accordion box is expanded' + tandem: options.tandem.createTandem( 'quadraticTermsAccordionBoxExpandedProperty' ), + phetioDocumentation: 'whether the Quadratic Terms accordion box is expanded' } ); // @public this.quadraticTermVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'quadraticTermVisibleProperty' ), - phetioDocumentation: 'whether the quadratic term, y = ax^2, is visible' + tandem: options.tandem.createTandem( 'quadraticTermVisibleProperty' ), + phetioDocumentation: 'whether the quadratic term (y = ax^2) is visible' } ); // @public this.linearTermVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'linearTermVisibleProperty' ), - phetioDocumentation: 'whether the linear term, y = bx, is visible' + tandem: options.tandem.createTandem( 'linearTermVisibleProperty' ), + phetioDocumentation: 'whether the linear term (y = bx) is visible' } ); // @public this.constantTermVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'constantTermVisibleProperty' ), - phetioDocumentation: 'whether the constant term, y = c, is visible' + tandem: options.tandem.createTandem( 'constantTermVisibleProperty' ), + phetioDocumentation: 'whether the constant term (y = c) is visible' } ); } diff --git a/js/explore/view/QuadraticTermsAccordionBox.js b/js/explore/view/QuadraticTermsAccordionBox.js index 0f7c7b46..ae69e785 100644 --- a/js/explore/view/QuadraticTermsAccordionBox.js +++ b/js/explore/view/QuadraticTermsAccordionBox.js @@ -20,6 +20,7 @@ define( require => { const PhetFont = require( 'SCENERY_PHET/PhetFont' ); const RichText = require( 'SCENERY/nodes/RichText' ); const StringUtils = require( 'PHETCOMMON/util/StringUtils' ); + const Tandem = require( 'TANDEM/Tandem' ); const Text = require( 'SCENERY/nodes/Text' ); const VBox = require( 'SCENERY/nodes/VBox' ); @@ -33,15 +34,15 @@ define( require => { /** * @param {ExploreViewProperties} viewProperties - * @param {Tandem} tandem * @param {Object} [options] */ - constructor( viewProperties, tandem, options ) { + constructor( viewProperties, options ) { options = _.extend( { expandedProperty: viewProperties.quadraticTermsAccordionBoxExpandedProperty, titleAlignX: 'left', - titleXSpacing: 8 + titleXSpacing: 8, + tandem: Tandem.required }, GQConstants.ACCORDION_BOX_OPTIONS, options ); assert && assert( !options.titleNode, 'QuadraticTermsAccordionBox sets titleNode' ); @@ -61,8 +62,8 @@ define( require => { fill: GQColors.QUADRATIC_TERM } ); const quadraticTermCheckbox = new Checkbox( quadraticTermLabel, viewProperties.quadraticTermVisibleProperty, { - tandem: tandem.createTandem( 'quadraticTermCheckbox' ), - phetioDocumentation: 'checkbox that makes the quadratic term visible' + tandem: options.tandem.createTandem( 'quadraticTermCheckbox' ), + phetioDocumentation: 'checkbox that makes the quadratic term (y = ax^2) visible' } ); // y = bx @@ -76,8 +77,8 @@ define( require => { fill: GQColors.LINEAR_TERM } ); const linearTermCheckbox = new Checkbox( linearTermLabel, viewProperties.linearTermVisibleProperty, { - tandem: tandem.createTandem( 'linearTermCheckbox' ), - phetioDocumentation: 'checkbox that makes the linear term visible' + tandem: options.tandem.createTandem( 'linearTermCheckbox' ), + phetioDocumentation: 'checkbox that makes the linear term (y = bx) visible' } ); // y = c @@ -90,8 +91,8 @@ define( require => { fill: GQColors.CONSTANT_TERM } ); const constantTermCheckbox = new Checkbox( constantTermLabel, viewProperties.constantTermVisibleProperty, { - tandem: tandem.createTandem( 'constantTermCheckbox' ), - phetioDocumentation: 'checkbox that makes the constant term visible' + tandem: options.tandem.createTandem( 'constantTermCheckbox' ), + phetioDocumentation: 'checkbox that makes the constant term (y = c) visible' } ); // vertical layout diff --git a/js/focusanddirectrix/view/FocusAndDirectrixAccordionBox.js b/js/focusanddirectrix/view/FocusAndDirectrixAccordionBox.js index 0ca5477b..a6254850 100644 --- a/js/focusanddirectrix/view/FocusAndDirectrixAccordionBox.js +++ b/js/focusanddirectrix/view/FocusAndDirectrixAccordionBox.js @@ -13,6 +13,7 @@ define( require => { const FocusAndDirectrixEquationNode = require( 'GRAPHING_QUADRATICS/focusanddirectrix/view/FocusAndDirectrixEquationNode' ); const FocusAndDirectrixInteractiveEquationNode = require( 'GRAPHING_QUADRATICS/focusanddirectrix/view/FocusAndDirectrixInteractiveEquationNode' ); const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); + const Tandem = require( 'TANDEM/Tandem' ); class FocusAndDirectrixAccordionBox extends EquationAccordionBox { @@ -23,6 +24,10 @@ define( require => { */ constructor( model, expandedProperty, options ) { + options = _.extend( { + tandem: Tandem.required + }, options ); + const titleNode = new FocusAndDirectrixEquationNode(); const interactiveEquationNode = new FocusAndDirectrixInteractiveEquationNode( diff --git a/js/focusanddirectrix/view/FocusAndDirectrixGraphControls.js b/js/focusanddirectrix/view/FocusAndDirectrixGraphControls.js index 71b8e62e..5e4f42a5 100644 --- a/js/focusanddirectrix/view/FocusAndDirectrixGraphControls.js +++ b/js/focusanddirectrix/view/FocusAndDirectrixGraphControls.js @@ -16,6 +16,7 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const Panel = require( 'SUN/Panel' ); const PointOnQuadraticCheckbox = require( 'GRAPHING_QUADRATICS/focusanddirectrix/view/PointOnQuadraticCheckbox' ); + const Tandem = require( 'TANDEM/Tandem' ); const VBox = require( 'SCENERY/nodes/VBox' ); const VertexCheckbox = require( 'GRAPHING_QUADRATICS/common/view/VertexCheckbox' ); @@ -23,30 +24,30 @@ define( require => { /** * @param {GQViewProperties} viewProperties - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( viewProperties, tandem ) { + constructor( viewProperties, options ) { - const options = _.extend( { - tandem: tandem - }, GQConstants.PANEL_OPTIONS ); + options = _.extend( { + tandem: Tandem.required + }, GQConstants.PANEL_OPTIONS, options ); // checkboxes const vertexCheckbox = new VertexCheckbox( viewProperties.vertexVisibleProperty, { manipulatorIcon: true, - tandem: tandem.createTandem( 'vertexCheckbox' ) + tandem: options.tandem.createTandem( 'vertexCheckbox' ) } ); const focusCheckbox = new FocusCheckbox( viewProperties.focusVisibleProperty, { - tandem: tandem.createTandem( 'focusCheckbox' ) + tandem: options.tandem.createTandem( 'focusCheckbox' ) } ); const directrixCheckbox = new DirectrixCheckbox( viewProperties.directrixVisibleProperty, { - tandem: tandem.createTandem( 'directrixCheckbox' ) + tandem: options.tandem.createTandem( 'directrixCheckbox' ) } ); const pointOnQuadraticCheckbox = new PointOnQuadraticCheckbox( viewProperties.pointOnQuadraticVisibleProperty, { - tandem: tandem.createTandem( 'pointOnQuadraticCheckbox' ) + tandem: options.tandem.createTandem( 'pointOnQuadraticCheckbox' ) } ); const coordinatesCheckbox = new CoordinatesCheckbox( viewProperties.coordinatesVisibleProperty, { - tandem: tandem.createTandem( 'coordinatesCheckbox' ) + tandem: options.tandem.createTandem( 'coordinatesCheckbox' ) } ); // vertical layout diff --git a/js/focusanddirectrix/view/FocusAndDirectrixScreenView.js b/js/focusanddirectrix/view/FocusAndDirectrixScreenView.js index 123548f5..a7b7666f 100644 --- a/js/focusanddirectrix/view/FocusAndDirectrixScreenView.js +++ b/js/focusanddirectrix/view/FocusAndDirectrixScreenView.js @@ -24,14 +24,24 @@ define( require => { */ constructor( model, tandem ) { - const viewProperties = new FocusAndDirectrixViewProperties( tandem.createTandem( 'viewProperties') ); + const options = { + tandem: tandem + }; + + const viewProperties = new FocusAndDirectrixViewProperties( { + tandem: options.tandem.createTandem( 'viewProperties') + } ); super( model, viewProperties, new FocusAndDirectrixGraphNode( model, viewProperties ), - new FocusAndDirectrixAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, tandem.createTandem( 'equationAccordionBox') ), - new FocusAndDirectrixGraphControls( viewProperties, tandem.createTandem( 'graphControls' ) ), - tandem + new FocusAndDirectrixAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, { + tandem: options.tandem.createTandem( 'equationAccordionBox') + } ), + new FocusAndDirectrixGraphControls( viewProperties, { + tandem: options.tandem.createTandem( 'graphControls' ) + } ), + options ); } } diff --git a/js/focusanddirectrix/view/FocusAndDirectrixViewProperties.js b/js/focusanddirectrix/view/FocusAndDirectrixViewProperties.js index 020377aa..d74b2239 100644 --- a/js/focusanddirectrix/view/FocusAndDirectrixViewProperties.js +++ b/js/focusanddirectrix/view/FocusAndDirectrixViewProperties.js @@ -13,40 +13,44 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const GQQueryParameters = require( 'GRAPHING_QUADRATICS/common/GQQueryParameters' ); const GQViewProperties = require( 'GRAPHING_QUADRATICS/common/view/GQViewProperties' ); + const Tandem = require( 'TANDEM/Tandem' ); class FocusAndDirectrixViewProperties extends GQViewProperties { /** - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( tandem ) { + constructor( options ) { - super( tandem, { + options = _.extend( { equationForm: 'vertex', - coordinatesVisible: GQQueryParameters.checkAll - } ); + coordinatesVisible: GQQueryParameters.checkAll, + tandem: Tandem.required + }, options ); + + super( options ); // @public this.vertexVisibleProperty = new BooleanProperty( true, { - tandem: tandem.createTandem( 'vertexVisibleProperty' ), + tandem: options.tandem.createTandem( 'vertexVisibleProperty' ), phetioInstanceDocumentation: 'whether the vertex manipulator is visible' } ); // @public this.focusVisibleProperty = new BooleanProperty( true, { - tandem: tandem.createTandem( 'focusVisibleProperty' ), + tandem: options.tandem.createTandem( 'focusVisibleProperty' ), phetioInstanceDocumentation: 'whether the focus manipulator is visible' } ); // @public this.directrixVisibleProperty = new BooleanProperty( true, { - tandem: tandem.createTandem( 'directrixVisibleProperty' ), + tandem: options.tandem.createTandem( 'directrixVisibleProperty' ), phetioInstanceDocumentation: 'whether the directrix is visible' } ); // @public whether an interactive point is visible on the quadratic this.pointOnQuadraticVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'pointOnQuadraticVisibleProperty' ), + tandem: options.tandem.createTandem( 'pointOnQuadraticVisibleProperty' ), phetioInstanceDocumentation: 'whether the interactive point on the quadratic is visible' } ); } diff --git a/js/standardform/view/StandardFormAccordionBox.js b/js/standardform/view/StandardFormAccordionBox.js index 9bff218f..10b0f069 100644 --- a/js/standardform/view/StandardFormAccordionBox.js +++ b/js/standardform/view/StandardFormAccordionBox.js @@ -13,6 +13,7 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const StandardFormEquationNode = require( 'GRAPHING_QUADRATICS/standardform/view/StandardFormEquationNode' ); const StandardFormInteractiveEquationNode = require( 'GRAPHING_QUADRATICS/standardform/view/StandardFormInteractiveEquationNode' ); + const Tandem = require( 'TANDEM/Tandem' ); class StandardFormAccordionBox extends EquationAccordionBox { @@ -23,6 +24,10 @@ define( require => { */ constructor( model, expandedProperty, options ) { + options = _.extend( { + tandem: Tandem.required + }, options ); + const titleNode = new StandardFormEquationNode(); const interactiveEquationNode = new StandardFormInteractiveEquationNode( diff --git a/js/standardform/view/StandardFormGraphControls.js b/js/standardform/view/StandardFormGraphControls.js index ced684a2..8ac06ace 100644 --- a/js/standardform/view/StandardFormGraphControls.js +++ b/js/standardform/view/StandardFormGraphControls.js @@ -16,6 +16,7 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const Panel = require( 'SUN/Panel' ); const RootsCheckbox = require( 'GRAPHING_QUADRATICS/standardform/view/RootsCheckbox' ); + const Tandem = require( 'TANDEM/Tandem' ); const VBox = require( 'SCENERY/nodes/VBox' ); const VertexCheckbox = require( 'GRAPHING_QUADRATICS/common/view/VertexCheckbox' ); @@ -23,26 +24,26 @@ define( require => { /** * @param {StandardFormViewProperties} viewProperties - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( viewProperties, tandem ) { + constructor( viewProperties, options ) { - const options = _.extend( { - tandem: tandem - }, GQConstants.PANEL_OPTIONS ); + options = _.extend( { + tandem: Tandem.required + }, GQConstants.PANEL_OPTIONS, options ); // checkboxes const vertexCheckbox = new VertexCheckbox( viewProperties.vertexVisibleProperty, { - tandem: tandem.createTandem( 'vertexCheckbox' ) + tandem: options.tandem.createTandem( 'vertexCheckbox' ) } ); const axisOfSymmetryCheckbox = new AxisOfSymmetryCheckbox( viewProperties.axisOfSymmetryVisibleProperty, { - tandem: tandem.createTandem( 'axisOfSymmetryCheckbox' ) + tandem: options.tandem.createTandem( 'axisOfSymmetryCheckbox' ) } ); const rootsCheckbox = new RootsCheckbox( viewProperties.rootsVisibleProperty, { - tandem: tandem.createTandem( 'rootsCheckbox' ) + tandem: options.tandem.createTandem( 'rootsCheckbox' ) } ); const coordinatesCheckbox = new CoordinatesCheckbox( viewProperties.coordinatesVisibleProperty, { - tandem: tandem.createTandem( 'coordinatesCheckbox' ) + tandem: options.tandem.createTandem( 'coordinatesCheckbox' ) } ); // vertical layout diff --git a/js/standardform/view/StandardFormScreenView.js b/js/standardform/view/StandardFormScreenView.js index 0f854c91..62315006 100644 --- a/js/standardform/view/StandardFormScreenView.js +++ b/js/standardform/view/StandardFormScreenView.js @@ -24,14 +24,24 @@ define( require => { */ constructor( model, tandem ) { - const viewProperties = new StandardFormViewProperties( tandem.createTandem( 'viewProperties') ); + const options = { + tandem: tandem + }; + + const viewProperties = new StandardFormViewProperties( { + tandem: options.tandem.createTandem( 'viewProperties') + } ); super( model, viewProperties, new StandardFormGraphNode( model, viewProperties ), - new StandardFormAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, tandem.createTandem( 'equationAccordionBox') ), - new StandardFormGraphControls( viewProperties, tandem.createTandem( 'graphControls') ), - tandem + new StandardFormAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, { + tandem: options.tandem.createTandem( 'equationAccordionBox') + } ), + new StandardFormGraphControls( viewProperties, { + tandem: options.tandem.createTandem( 'graphControls') + } ), + options ); } } diff --git a/js/standardform/view/StandardFormViewProperties.js b/js/standardform/view/StandardFormViewProperties.js index 811b9aff..b1f8e1e5 100644 --- a/js/standardform/view/StandardFormViewProperties.js +++ b/js/standardform/view/StandardFormViewProperties.js @@ -13,31 +13,36 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const GQQueryParameters = require( 'GRAPHING_QUADRATICS/common/GQQueryParameters' ); const GQViewProperties = require( 'GRAPHING_QUADRATICS/common/view/GQViewProperties' ); + const Tandem = require( 'TANDEM/Tandem' ); class StandardFormViewProperties extends GQViewProperties { /** - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( tandem ) { + constructor( options ) { - super( tandem ); + options = _.extend( { + tandem: Tandem.required + }, options ); + + super( options ); // @public this.vertexVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'vertexVisibleProperty' ), + tandem: options.tandem.createTandem( 'vertexVisibleProperty' ), phetioInstanceDocumentation: 'whether the vertex point is visible' } ); // @public this.axisOfSymmetryVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'axisOfSymmetryVisibleProperty' ), + tandem: options.tandem.createTandem( 'axisOfSymmetryVisibleProperty' ), phetioInstanceDocumentation: 'whether the axis of symmetry is visible' } ); // @public this.rootsVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'rootsVisibleProperty' ), + tandem: options.tandem.createTandem( 'rootsVisibleProperty' ), phetioInstanceDocumentation: 'whether the real roots of the quadratic are visible' } ); } diff --git a/js/vertexform/view/VertexFormAccordionBox.js b/js/vertexform/view/VertexFormAccordionBox.js index c22ab01e..3891c871 100644 --- a/js/vertexform/view/VertexFormAccordionBox.js +++ b/js/vertexform/view/VertexFormAccordionBox.js @@ -11,6 +11,7 @@ define( require => { // modules const EquationAccordionBox = require( 'GRAPHING_QUADRATICS/common/view/EquationAccordionBox' ); const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); + const Tandem = require( 'TANDEM/Tandem' ); const VertexFormEquationNode = require( 'GRAPHING_QUADRATICS/vertexform/view/VertexFormEquationNode' ); const VertexFormInteractiveEquationNode = require( 'GRAPHING_QUADRATICS/vertexform/view/VertexFormInteractiveEquationNode' ); @@ -23,6 +24,10 @@ define( require => { */ constructor( model, expandedProperty, options ) { + options = _.extend( { + tandem: Tandem.required + }, options ); + const titleNode = new VertexFormEquationNode(); const interactiveEquationNode = new VertexFormInteractiveEquationNode( diff --git a/js/vertexform/view/VertexFormGraphControls.js b/js/vertexform/view/VertexFormGraphControls.js index 42fc79f0..6fe44da0 100644 --- a/js/vertexform/view/VertexFormGraphControls.js +++ b/js/vertexform/view/VertexFormGraphControls.js @@ -15,6 +15,7 @@ define( require => { const GQConstants = require( 'GRAPHING_QUADRATICS/common/GQConstants' ); const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const Panel = require( 'SUN/Panel' ); + const Tandem = require( 'TANDEM/Tandem' ); const VBox = require( 'SCENERY/nodes/VBox' ); const VertexCheckbox = require( 'GRAPHING_QUADRATICS/common/view/VertexCheckbox' ); @@ -22,24 +23,24 @@ define( require => { /** * @param {GQViewProperties} viewProperties - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( viewProperties, tandem ) { + constructor( viewProperties, options ) { - const options = _.extend( { - tandem: tandem - }, GQConstants.PANEL_OPTIONS ); + options = _.extend( { + tandem: Tandem.required + }, GQConstants.PANEL_OPTIONS, options ); // checkboxes const vertexCheckbox = new VertexCheckbox( viewProperties.vertexVisibleProperty, { manipulatorIcon: true, - tandem: tandem.createTandem( 'vertexCheckbox' ) + tandem: options.tandem.createTandem( 'vertexCheckbox' ) } ); const axisOfSymmetryCheckbox = new AxisOfSymmetryCheckbox( viewProperties.axisOfSymmetryVisibleProperty, { - tandem: tandem.createTandem( 'axisOfSymmetryCheckbox' ) + tandem: options.tandem.createTandem( 'axisOfSymmetryCheckbox' ) } ); const coordinatesCheckbox = new CoordinatesCheckbox( viewProperties.coordinatesVisibleProperty, { - tandem: tandem.createTandem( 'coordinatesCheckbox' ) + tandem: options.tandem.createTandem( 'coordinatesCheckbox' ) } ); // vertical layout diff --git a/js/vertexform/view/VertexFormScreenView.js b/js/vertexform/view/VertexFormScreenView.js index 06664ed2..2a57e3d7 100644 --- a/js/vertexform/view/VertexFormScreenView.js +++ b/js/vertexform/view/VertexFormScreenView.js @@ -24,14 +24,24 @@ define( require => { */ constructor( model, tandem ) { - const viewProperties = new VertexFormViewProperties( tandem.createTandem( 'viewProperties' ) ); + const options = { + tandem: tandem + }; + + const viewProperties = new VertexFormViewProperties( { + tandem: options.tandem.createTandem( 'viewProperties' ) + } ); super( model, viewProperties, new VertexFormGraphNode( model, viewProperties ), - new VertexFormAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, tandem.createTandem( 'equationAccordionBox' ) ), - new VertexFormGraphControls( viewProperties, tandem.createTandem( 'graphControls' ) ), - tandem + new VertexFormAccordionBox( model, viewProperties.equationAccordionBoxExpandedProperty, { + tandem: options.tandem.createTandem( 'equationAccordionBox' ) + } ), + new VertexFormGraphControls( viewProperties, { + tandem: options.tandem.createTandem( 'graphControls' ) + } ), + options ); } } diff --git a/js/vertexform/view/VertexFormViewProperties.js b/js/vertexform/view/VertexFormViewProperties.js index b3fef286..54883413 100644 --- a/js/vertexform/view/VertexFormViewProperties.js +++ b/js/vertexform/view/VertexFormViewProperties.js @@ -13,27 +13,31 @@ define( require => { const graphingQuadratics = require( 'GRAPHING_QUADRATICS/graphingQuadratics' ); const GQQueryParameters = require( 'GRAPHING_QUADRATICS/common/GQQueryParameters' ); const GQViewProperties = require( 'GRAPHING_QUADRATICS/common/view/GQViewProperties' ); + const Tandem = require( 'TANDEM/Tandem' ); class VertexFormViewProperties extends GQViewProperties { /** - * @param {Tandem} tandem + * @param {Object} [options] */ - constructor( tandem ) { + constructor( options ) { - super( tandem, { - equationForm: 'vertex' - } ); + options = _.extend( { + equationForm: 'vertex', + tandem: Tandem.required + }, options ); + + super( options ); // @public this.vertexVisibleProperty = new BooleanProperty( true, { - tandem: tandem.createTandem( 'vertexVisibleProperty' ), + tandem: options.tandem.createTandem( 'vertexVisibleProperty' ), phetioInstanceDocumentation: 'whether the vertex manipulator is visible' } ); // @public this.axisOfSymmetryVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, { - tandem: tandem.createTandem( 'axisOfSymmetryVisibleProperty' ), + tandem: options.tandem.createTandem( 'axisOfSymmetryVisibleProperty' ), phetioInstanceDocumentation: 'whether the axis of symmetry is visible' } ); }