Skip to content

Commit

Permalink
Rename checkbox creation methods, see #153
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Apr 26, 2023
1 parent 3012ebe commit 4cbaf3e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions js/common/view/BottomRepresentationCheckboxGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const TEXT_OPTIONS = {

export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxGroup {

private static newGridBox( text: Node, icon: Node, iconGroup: AlignGroup ): GridBox {
private static createGridBox( text: Node, icon: Node, iconGroup: AlignGroup ): GridBox {
return new GridBox( {
stretch: true,
spacing: 5,
Expand All @@ -44,10 +44,10 @@ export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxG
} );
}

public static getVariabilityCheckbox( alignGroup: AlignGroup, model: VariabilityModel ): VerticalCheckboxGroupItem {
public static getVariabilityCheckboxItem( alignGroup: AlignGroup, model: VariabilityModel ): VerticalCheckboxGroupItem {
return {
createNode: ( tandem: Tandem ) => {
return BottomRepresentationCheckboxGroup.newGridBox(
return BottomRepresentationCheckboxGroup.createGridBox(
new Text( CenterAndVariabilityStrings.variabilityStringProperty, TEXT_OPTIONS ),
NumberLineNode.createMeanIndicatorNode( true, true ),
alignGroup
Expand All @@ -58,10 +58,10 @@ export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxG
};
}

public static getMedianCheckbox( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
public static getMedianCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
return {
createNode: ( tandem: Tandem ) => {
return BottomRepresentationCheckboxGroup.newGridBox(
return BottomRepresentationCheckboxGroup.createGridBox(
new Text( CenterAndVariabilityStrings.medianStringProperty, TEXT_OPTIONS ),
new ArrowNode( 0, 0, 0, 27, {
fill: CAVColors.medianColorProperty,
Expand All @@ -77,9 +77,9 @@ export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxG
};
}

public static getMeanCheckbox( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
public static getMeanCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
return {
createNode: ( tandem: Tandem ) => BottomRepresentationCheckboxGroup.newGridBox( new Text( CenterAndVariabilityStrings.meanStringProperty, TEXT_OPTIONS ),
createNode: ( tandem: Tandem ) => BottomRepresentationCheckboxGroup.createGridBox( new Text( CenterAndVariabilityStrings.meanStringProperty, TEXT_OPTIONS ),
NumberLineNode.createMeanIndicatorNode( true, true ), alignGroup ),
property: model.isShowingPlayAreaMeanProperty,
tandemName: 'meanCheckbox'
Expand All @@ -90,7 +90,7 @@ export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxG
tandemName: string, alignGroup: AlignGroup ): VerticalCheckboxGroupItem {
return {
createNode: ( tandem: Tandem ) => {
return BottomRepresentationCheckboxGroup.newGridBox(
return BottomRepresentationCheckboxGroup.createGridBox(
new Text( stringProperty, TEXT_OPTIONS ),
new PredictionThumbNode( { color: color, maxHeight: 20, pickable: false } ),
alignGroup );
Expand All @@ -100,7 +100,7 @@ export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxG
};
}

public static getPredictMedianCheckbox( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
public static getPredictMedianCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
return BottomRepresentationCheckboxGroup.createPredictionItem(
model.isShowingMedianPredictionProperty,
CenterAndVariabilityStrings.predictMedianStringProperty,
Expand All @@ -111,7 +111,7 @@ export default class BottomRepresentationCheckboxGroup extends VerticalCheckboxG
);
}

public static getPredictMeanCheckbox( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
public static getPredictMeanCheckboxItem( alignGroup: AlignGroup, model: CAVModel ): VerticalCheckboxGroupItem {
return BottomRepresentationCheckboxGroup.createPredictionItem(
model.isShowingMeanPredictionProperty,
CenterAndVariabilityStrings.predictMeanStringProperty,
Expand Down
8 changes: 4 additions & 4 deletions js/mean-and-median/view/MeanAndMedianScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export default class MeanAndMedianScreenView extends CAVScreenView {

const iconGroup = new AlignGroup();
const bottomCheckboxGroup = new VerticalCheckboxGroup( [
BottomRepresentationCheckboxGroup.getPredictMedianCheckbox( iconGroup, model ),
BottomRepresentationCheckboxGroup.getPredictMeanCheckbox( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMedianCheckbox( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMeanCheckbox( iconGroup, model )
BottomRepresentationCheckboxGroup.getPredictMedianCheckboxItem( iconGroup, model ),
BottomRepresentationCheckboxGroup.getPredictMeanCheckboxItem( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMedianCheckboxItem( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMeanCheckboxItem( iconGroup, model )
], {
tandem: options.tandem.createTandem( 'bottomCheckboxGroup' )
} );
Expand Down
4 changes: 2 additions & 2 deletions js/median/view/MedianScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class MedianScreenView extends CAVScreenView {

const iconGroup = new AlignGroup();
const bottomCheckboxGroup = new VerticalCheckboxGroup( [
BottomRepresentationCheckboxGroup.getPredictMedianCheckbox( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMedianCheckbox( iconGroup, model )
BottomRepresentationCheckboxGroup.getPredictMedianCheckboxItem( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMedianCheckboxItem( iconGroup, model )
], {
tandem: options.tandem.createTandem( 'bottomCheckboxGroup' )
} );
Expand Down
6 changes: 3 additions & 3 deletions js/variability/view/VariabilityScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export default class VariabilityScreenView extends CAVScreenView {

const iconGroup = new AlignGroup();
const bottomCheckboxGroup = new VerticalCheckboxGroup( [
BottomRepresentationCheckboxGroup.getVariabilityCheckbox( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMedianCheckbox( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMeanCheckbox( iconGroup, model )
BottomRepresentationCheckboxGroup.getVariabilityCheckboxItem( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMedianCheckboxItem( iconGroup, model ),
BottomRepresentationCheckboxGroup.getMeanCheckboxItem( iconGroup, model )
], {
tandem: options.tandem.createTandem( 'bottomCheckboxGroup' )
} );
Expand Down

0 comments on commit 4cbaf3e

Please sign in to comment.