diff --git a/js/common/view/BottomRepresentationCheckboxGroup.ts b/js/common/view/PlayAreaCheckboxFactory.ts similarity index 87% rename from js/common/view/BottomRepresentationCheckboxGroup.ts rename to js/common/view/PlayAreaCheckboxFactory.ts index 9bb22270..40d1912f 100644 --- a/js/common/view/BottomRepresentationCheckboxGroup.ts +++ b/js/common/view/PlayAreaCheckboxFactory.ts @@ -30,7 +30,7 @@ const TEXT_OPTIONS = { maxWidth: CAVConstants.CHECKBOX_TEXT_MAX_WIDTH }; -export default class BottomRepresentationCheckboxGroup { +export default class PlayAreaCheckboxFactory { private static createGridBox( text: Node, icon: Node, iconGroup: AlignGroup ): GridBox { return new GridBox( { @@ -47,7 +47,7 @@ export default class BottomRepresentationCheckboxGroup { public static getIntervalToolCheckboxItem( alignGroup: AlignGroup, model: VariabilityModel ): VerticalCheckboxGroupItem { return { createNode: ( tandem: Tandem ) => { - return BottomRepresentationCheckboxGroup.createGridBox( + return PlayAreaCheckboxFactory.createGridBox( new Text( CenterAndVariabilityStrings.intervalToolStringProperty, TEXT_OPTIONS ), new IntervalToolIconNode(), alignGroup @@ -61,7 +61,7 @@ export default class BottomRepresentationCheckboxGroup { public static getMedianCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem { return { createNode: ( tandem: Tandem ) => { - return BottomRepresentationCheckboxGroup.createGridBox( + return PlayAreaCheckboxFactory.createGridBox( new Text( CenterAndVariabilityStrings.medianStringProperty, TEXT_OPTIONS ), new ArrowNode( 0, 0, 0, 27, { fill: CAVColors.medianColorProperty, @@ -79,7 +79,7 @@ export default class BottomRepresentationCheckboxGroup { public static getMeanCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem { return { - createNode: ( tandem: Tandem ) => BottomRepresentationCheckboxGroup.createGridBox( new Text( CenterAndVariabilityStrings.meanStringProperty, TEXT_OPTIONS ), + createNode: ( tandem: Tandem ) => PlayAreaCheckboxFactory.createGridBox( new Text( CenterAndVariabilityStrings.meanStringProperty, TEXT_OPTIONS ), NumberLineNode.createMeanIndicatorNode( true, true ), alignGroup ), property: model.isPlayAreaMeanVisibleProperty, tandemName: 'meanCheckbox' @@ -90,7 +90,7 @@ export default class BottomRepresentationCheckboxGroup { tandemName: string, alignGroup: AlignGroup ): VerticalCheckboxGroupItem { return { createNode: ( tandem: Tandem ) => { - return BottomRepresentationCheckboxGroup.createGridBox( + return PlayAreaCheckboxFactory.createGridBox( new Text( stringProperty, TEXT_OPTIONS ), new PredictionThumbNode( { color: color, maxHeight: 20, pickable: false } ), alignGroup ); @@ -101,7 +101,7 @@ export default class BottomRepresentationCheckboxGroup { } public static getPredictMedianCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem { - return BottomRepresentationCheckboxGroup.createPredictionItem( + return PlayAreaCheckboxFactory.createPredictionItem( model.isMedianPredictionVisibleProperty, CenterAndVariabilityStrings.predictMedianStringProperty, CAVColors.medianColorProperty, @@ -112,7 +112,7 @@ export default class BottomRepresentationCheckboxGroup { } public static getPredictMeanCheckboxItem( alignGroup: AlignGroup, model: MeanAndMedianModel ): VerticalCheckboxGroupItem { - return BottomRepresentationCheckboxGroup.createPredictionItem( + return PlayAreaCheckboxFactory.createPredictionItem( model.isMeanPredictionVisibleProperty, CenterAndVariabilityStrings.predictMeanStringProperty, CAVColors.meanColorProperty, @@ -123,4 +123,4 @@ export default class BottomRepresentationCheckboxGroup { } } -centerAndVariability.register( 'BottomRepresentationCheckboxGroup', BottomRepresentationCheckboxGroup ); \ No newline at end of file +centerAndVariability.register( 'PlayAreaCheckboxFactory', PlayAreaCheckboxFactory ); \ No newline at end of file diff --git a/js/mean-and-median/view/MeanAndMedianScreenView.ts b/js/mean-and-median/view/MeanAndMedianScreenView.ts index 6a25ced9..4d216353 100644 --- a/js/mean-and-median/view/MeanAndMedianScreenView.ts +++ b/js/mean-and-median/view/MeanAndMedianScreenView.ts @@ -17,7 +17,7 @@ import Range from '../../../../dot/js/Range.js'; import StrictOmit from '../../../../phet-core/js/types/StrictOmit.js'; import CAVScreenView, { CAVScreenViewOptions } from '../../common/view/CAVScreenView.js'; import MeanAndMedianAccordionBox from './MeanAndMedianAccordionBox.js'; -import BottomRepresentationCheckboxGroup from '../../common/view/BottomRepresentationCheckboxGroup.js'; +import PlayAreaCheckboxFactory from '../../common/view/PlayAreaCheckboxFactory.js'; import CAVConstants from '../../common/CAVConstants.js'; import PredictionSlider from '../../common/view/PredictionSlider.js'; import Property from '../../../../axon/js/Property.js'; @@ -44,10 +44,10 @@ export default class MeanAndMedianScreenView extends CAVScreenView { const iconGroup = new AlignGroup(); this.setBottomControls( new VerticalCheckboxGroup( [ - BottomRepresentationCheckboxGroup.getPredictMedianCheckboxItem( iconGroup, model ), - BottomRepresentationCheckboxGroup.getPredictMeanCheckboxItem( iconGroup, model ), - BottomRepresentationCheckboxGroup.getMedianCheckboxItem( iconGroup, model ), - BottomRepresentationCheckboxGroup.getMeanCheckboxItem( iconGroup, model ) + PlayAreaCheckboxFactory.getPredictMedianCheckboxItem( iconGroup, model ), + PlayAreaCheckboxFactory.getPredictMeanCheckboxItem( iconGroup, model ), + PlayAreaCheckboxFactory.getMedianCheckboxItem( iconGroup, model ), + PlayAreaCheckboxFactory.getMeanCheckboxItem( iconGroup, model ) ], { tandem: this.tandem.createTandem( 'bottomCheckboxGroup' ) } ) ); diff --git a/js/median/view/MedianScreenView.ts b/js/median/view/MedianScreenView.ts index 61141309..fd1cd8e3 100644 --- a/js/median/view/MedianScreenView.ts +++ b/js/median/view/MedianScreenView.ts @@ -15,7 +15,7 @@ import CenterAndVariabilityStrings from '../../CenterAndVariabilityStrings.js'; import StrictOmit from '../../../../phet-core/js/types/StrictOmit.js'; import CAVScreenView, { CAVScreenViewOptions } from '../../common/view/CAVScreenView.js'; import MedianAccordionBox from './MedianAccordionBox.js'; -import BottomRepresentationCheckboxGroup from '../../common/view/BottomRepresentationCheckboxGroup.js'; +import PlayAreaCheckboxFactory from '../../common/view/PlayAreaCheckboxFactory.js'; import { AlignGroup } from '../../../../scenery/js/imports.js'; import CAVConstants from '../../common/CAVConstants.js'; import VerticalCheckboxGroup from '../../../../sun/js/VerticalCheckboxGroup.js'; @@ -43,8 +43,8 @@ export default class MedianScreenView extends CAVScreenView { const iconGroup = new AlignGroup(); this.setBottomControls( new VerticalCheckboxGroup( [ - BottomRepresentationCheckboxGroup.getPredictMedianCheckboxItem( iconGroup, model ), - BottomRepresentationCheckboxGroup.getMedianCheckboxItem( iconGroup, model ) + PlayAreaCheckboxFactory.getPredictMedianCheckboxItem( iconGroup, model ), + PlayAreaCheckboxFactory.getMedianCheckboxItem( iconGroup, model ) ], { tandem: this.tandem.createTandem( 'bottomCheckboxGroup' ) } ) ); diff --git a/js/variability/view/VariabilityScreenView.ts b/js/variability/view/VariabilityScreenView.ts index 3b03b938..0def7013 100644 --- a/js/variability/view/VariabilityScreenView.ts +++ b/js/variability/view/VariabilityScreenView.ts @@ -19,7 +19,7 @@ import SceneRadioButtonGroup from './SceneRadioButtonGroup.js'; import VariabilityMeasureRadioButtonGroup from './VariabilityMeasureRadioButtonGroup.js'; import CAVScreenView, { CAVScreenViewOptions } from '../../common/view/CAVScreenView.js'; import VariabilityAccordionBox from './VariabilityAccordionBox.js'; -import BottomRepresentationCheckboxGroup from '../../common/view/BottomRepresentationCheckboxGroup.js'; +import PlayAreaCheckboxFactory from '../../common/view/PlayAreaCheckboxFactory.js'; import CAVConstants from '../../common/CAVConstants.js'; import VerticalCheckboxGroup from '../../../../sun/js/VerticalCheckboxGroup.js'; import SoccerPlayer from '../../common/model/SoccerPlayer.js'; @@ -109,9 +109,9 @@ export default class VariabilityScreenView extends CAVScreenView { spacing: 15, children: [ new VerticalCheckboxGroup( [ - BottomRepresentationCheckboxGroup.getMedianCheckboxItem( iconGroup, model ), - BottomRepresentationCheckboxGroup.getMeanCheckboxItem( iconGroup, model ), - BottomRepresentationCheckboxGroup.getIntervalToolCheckboxItem( iconGroup, model ) + PlayAreaCheckboxFactory.getMedianCheckboxItem( iconGroup, model ), + PlayAreaCheckboxFactory.getMeanCheckboxItem( iconGroup, model ), + PlayAreaCheckboxFactory.getIntervalToolCheckboxItem( iconGroup, model ) ], { tandem: this.tandem.createTandem( 'bottomCheckboxGroup' ) } )