From 3cce9f976d260876b01eecec9b3a972690748e92 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Wed, 3 May 2023 12:04:39 -0600 Subject: [PATCH] rename type CreateSceneNodeFunction, https://github.com/phetsims/reactants-products-and-leftovers/issues/78 --- js/common/view/RPALScreenView.ts | 8 ++++---- js/molecules/view/MoleculesScreenView.ts | 8 ++++---- js/sandwiches/view/SandwichesScreenView.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/js/common/view/RPALScreenView.ts b/js/common/view/RPALScreenView.ts index 0b045dd..4b06b7f 100644 --- a/js/common/view/RPALScreenView.ts +++ b/js/common/view/RPALScreenView.ts @@ -21,7 +21,7 @@ import { BeforeAfterNodeOptions } from './RPALSceneNode.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import BooleanIO from '../../../../tandem/js/types/BooleanIO.js'; -export type CreateBeforeAfterNodeFunction = ( +export type CreateSceneNodeFunction = ( reaction: Reaction, beforeExpandedProperty: Property, afterExpandedProperty: Property, @@ -33,12 +33,12 @@ export default class RPALScreenView extends Scree /** * @param model * @param createEquationNode - creates an equation for a specified reaction - * @param createBeforeAfterNode - creates the Before/After boxes for a specified reaction + * @param createSceneNode - creates the Before/After boxes for a specified reaction * @param tandem */ protected constructor( model: RPALBaseModel, createEquationNode: CreateEquationNodeFunction, - createBeforeAfterNode: CreateBeforeAfterNodeFunction, + createSceneNode: CreateSceneNodeFunction, tandem: Tandem ) { super( { @@ -62,7 +62,7 @@ export default class RPALScreenView extends Scree const sceneNodesTandem = tandem.createTandem( 'sceneNodes' ); const beforeAfterNodes = model.reactions.map( reaction => { const beforeAfterNodesTandem = sceneNodesTandem.createTandem( `${reaction.tandem.name}SceneNode` ); - return createBeforeAfterNode( reaction, beforeExpandedProperty, afterExpandedProperty, { + return createSceneNode( reaction, beforeExpandedProperty, afterExpandedProperty, { visibleProperty: new DerivedProperty( [ model.reactionProperty ], value => ( value === reaction ), { tandem: beforeAfterNodesTandem.createTandem( 'visibleProperty' ), phetioValueType: BooleanIO diff --git a/js/molecules/view/MoleculesScreenView.ts b/js/molecules/view/MoleculesScreenView.ts index 44b46c5..ec6fa8f 100644 --- a/js/molecules/view/MoleculesScreenView.ts +++ b/js/molecules/view/MoleculesScreenView.ts @@ -12,7 +12,7 @@ import Tandem from '../../../../tandem/js/Tandem.js'; import RPALConstants from '../../common/RPALConstants.js'; import RPALSceneNode, { BeforeAfterNodeOptions } from '../../common/view/RPALSceneNode.js'; import MoleculesEquationNode from '../../common/view/MoleculesEquationNode.js'; -import RPALScreenView, { CreateBeforeAfterNodeFunction } from '../../common/view/RPALScreenView.js'; +import RPALScreenView, { CreateSceneNodeFunction } from '../../common/view/RPALScreenView.js'; import reactantsProductsAndLeftovers from '../../reactantsProductsAndLeftovers.js'; import MoleculesModel from '../model/MoleculesModel.js'; import { CreateEquationNodeFunction } from '../../common/view/ReactionBarNode.js'; @@ -27,8 +27,8 @@ export default class MoleculesScreenView extends RPALScreenView { visibleProperty: visibleProperty } ); - // Creates the Before/After interface for a specified reaction. - const createBeforeAfterNode: CreateBeforeAfterNodeFunction = + // Creates the user interface for a specified reaction. + const createSceneNode: CreateSceneNodeFunction = ( reaction, beforeExpandedProperty, afterExpandedProperty, options ) => new RPALSceneNode( reaction, beforeExpandedProperty, afterExpandedProperty, combineOptions( { @@ -36,7 +36,7 @@ export default class MoleculesScreenView extends RPALScreenView { minIconSize: new Dimension2( 30, 25 ) // eyeballed }, options ) ); - super( model, createEquationNode, createBeforeAfterNode, tandem ); + super( model, createEquationNode, createSceneNode, tandem ); } } diff --git a/js/sandwiches/view/SandwichesScreenView.ts b/js/sandwiches/view/SandwichesScreenView.ts index a1e939e..776026b 100644 --- a/js/sandwiches/view/SandwichesScreenView.ts +++ b/js/sandwiches/view/SandwichesScreenView.ts @@ -10,7 +10,7 @@ import Dimension2 from '../../../../dot/js/Dimension2.js'; import Tandem from '../../../../tandem/js/Tandem.js'; import RPALConstants from '../../common/RPALConstants.js'; import RPALSceneNode, { BeforeAfterNodeOptions } from '../../common/view/RPALSceneNode.js'; -import RPALScreenView, { CreateBeforeAfterNodeFunction } from '../../common/view/RPALScreenView.js'; +import RPALScreenView, { CreateSceneNodeFunction } from '../../common/view/RPALScreenView.js'; import reactantsProductsAndLeftovers from '../../reactantsProductsAndLeftovers.js'; import ReactantsProductsAndLeftoversStrings from '../../ReactantsProductsAndLeftoversStrings.js'; import SandwichesModel from '../model/SandwichesModel.js'; @@ -33,8 +33,8 @@ export default class SandwichesScreenView extends RPALScreenView const createEquationNode: CreateEquationNodeFunction = ( reaction, visibleProperty ) => new SandwichesEquationNode( reaction, maxSandwichSize, visibleProperty ); - // Creates the Before/After interface for a specified reaction. - const createBeforeAfterNode: CreateBeforeAfterNodeFunction = + // Creates the user interface for a specified reaction. + const createSceneNode: CreateSceneNodeFunction = ( reaction, beforeExpandedProperty, afterExpandedProperty, options ) => new RPALSceneNode( reaction, beforeExpandedProperty, afterExpandedProperty, combineOptions( { @@ -46,7 +46,7 @@ export default class SandwichesScreenView extends RPALScreenView boxYMargin: 8 // large enough to accommodate the biggest sandwich }, options ) ); - super( model, createEquationNode, createBeforeAfterNode, tandem ); + super( model, createEquationNode, createSceneNode, tandem ); } }