Skip to content

Commit

Permalink
Rename BottomRepresentationCheckboxGroup.ts to PlayAreaCheckboxFactor…
Browse files Browse the repository at this point in the history
…y.ts, see: #153
  • Loading branch information
marlitas committed May 12, 2023
1 parent 2c084a4 commit 17bb5c9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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( {
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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'
Expand All @@ -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 );
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -123,4 +123,4 @@ export default class BottomRepresentationCheckboxGroup {
}
}

centerAndVariability.register( 'BottomRepresentationCheckboxGroup', BottomRepresentationCheckboxGroup );
centerAndVariability.register( 'PlayAreaCheckboxFactory', PlayAreaCheckboxFactory );
10 changes: 5 additions & 5 deletions js/mean-and-median/view/MeanAndMedianScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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' )
} ) );
Expand Down
6 changes: 3 additions & 3 deletions js/median/view/MedianScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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' )
} ) );
Expand Down
8 changes: 4 additions & 4 deletions js/variability/view/VariabilityScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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' )
} )
Expand Down

0 comments on commit 17bb5c9

Please sign in to comment.