Skip to content

Commit

Permalink
Renamed [C|c]heckBox => [C|c]heckbox, see phetsims/tasks#910
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 12, 2018
1 parent 253532b commit a556c76
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
40 changes: 20 additions & 20 deletions js/flow/view/FlowToolsControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define( function( require ) {

// modules
var Bounds2 = require( 'DOT/Bounds2' );
var CheckBox = require( 'SUN/CheckBox' );
var Checkbox = require( 'SUN/Checkbox' );
var Circle = require( 'SCENERY/nodes/Circle' );
var fluidPressureAndFlow = require( 'FLUID_PRESSURE_AND_FLOW/fluidPressureAndFlow' );
var HBox = require( 'SCENERY/nodes/HBox' );
Expand Down Expand Up @@ -72,41 +72,41 @@ define( function( require ) {
}
};

var checkBoxOptions = {
var checkboxOptions = {
boxWidth: 15,
spacing: 2
};

var rulerCheckBox = new CheckBox( createItem( rulerSpec ), flowModel.isRulerVisibleProperty, checkBoxOptions );
var frictionCheckBox = new CheckBox( createItem( frictionSpec ), flowModel.pipe.frictionProperty, checkBoxOptions );
var fluxMeterCheckBox = new CheckBox( createItem( fluxMeterSpec ), flowModel.isFluxMeterVisibleProperty,
checkBoxOptions );
var dotsCheckBox = new CheckBox( createItem( dotsSpec ), flowModel.isDotsVisibleProperty, checkBoxOptions );
var rulerCheckbox = new Checkbox( createItem( rulerSpec ), flowModel.isRulerVisibleProperty, checkboxOptions );
var frictionCheckbox = new Checkbox( createItem( frictionSpec ), flowModel.pipe.frictionProperty, checkboxOptions );
var fluxMeterCheckbox = new Checkbox( createItem( fluxMeterSpec ), flowModel.isFluxMeterVisibleProperty,
checkboxOptions );
var dotsCheckbox = new Checkbox( createItem( dotsSpec ), flowModel.isDotsVisibleProperty, checkboxOptions );

var maxCheckBoxWidth = _.maxBy( [ rulerCheckBox, frictionCheckBox, fluxMeterCheckBox, dotsCheckBox ],
var maxCheckboxWidth = _.maxBy( [ rulerCheckbox, frictionCheckbox, fluxMeterCheckbox, dotsCheckbox ],
function( item ) {
return item.width;
} ).width + 5;

//touch Areas
rulerCheckBox.touchArea = new Bounds2( rulerCheckBox.localBounds.minX - 5, rulerCheckBox.localBounds.minY,
rulerCheckBox.localBounds.minX + maxCheckBoxWidth, rulerCheckBox.localBounds.maxY );
frictionCheckBox.touchArea = new Bounds2( frictionCheckBox.localBounds.minX - 5, frictionCheckBox.localBounds.minY,
frictionCheckBox.localBounds.minX + maxCheckBoxWidth, frictionCheckBox.localBounds.maxY );
fluxMeterCheckBox.touchArea = new Bounds2( fluxMeterCheckBox.localBounds.minX - 5,
fluxMeterCheckBox.localBounds.minY,
fluxMeterCheckBox.localBounds.minX + maxCheckBoxWidth, fluxMeterCheckBox.localBounds.maxY );
dotsCheckBox.touchArea = new Bounds2( dotsCheckBox.localBounds.minX - 5, dotsCheckBox.localBounds.minY,
dotsCheckBox.localBounds.minX + maxCheckBoxWidth, dotsCheckBox.localBounds.maxY );
rulerCheckbox.touchArea = new Bounds2( rulerCheckbox.localBounds.minX - 5, rulerCheckbox.localBounds.minY,
rulerCheckbox.localBounds.minX + maxCheckboxWidth, rulerCheckbox.localBounds.maxY );
frictionCheckbox.touchArea = new Bounds2( frictionCheckbox.localBounds.minX - 5, frictionCheckbox.localBounds.minY,
frictionCheckbox.localBounds.minX + maxCheckboxWidth, frictionCheckbox.localBounds.maxY );
fluxMeterCheckbox.touchArea = new Bounds2( fluxMeterCheckbox.localBounds.minX - 5,
fluxMeterCheckbox.localBounds.minY,
fluxMeterCheckbox.localBounds.minX + maxCheckboxWidth, fluxMeterCheckbox.localBounds.maxY );
dotsCheckbox.touchArea = new Bounds2( dotsCheckbox.localBounds.minX - 5, dotsCheckbox.localBounds.minY,
dotsCheckbox.localBounds.minX + maxCheckboxWidth, dotsCheckbox.localBounds.maxY );

// pad all the rows so the text nodes are left aligned and the icons is right aligned

var checkBoxes = new VBox( {
var checkboxes = new VBox( {
align: 'left', spacing: 4,
children: [ rulerCheckBox, frictionCheckBox, fluxMeterCheckBox, dotsCheckBox ]
children: [ rulerCheckbox, frictionCheckbox, fluxMeterCheckbox, dotsCheckbox ]
} );

Panel.call( this, checkBoxes, options );
Panel.call( this, checkboxes, options );
}

//Create an icon for the ruler check box
Expand Down
16 changes: 8 additions & 8 deletions js/under-pressure/view/ControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define( function( require ) {

// modules
var AtmosphereControlNode = require( 'FLUID_PRESSURE_AND_FLOW/under-pressure/view/AtmosphereControlNode' );
var CheckBox = require( 'SUN/CheckBox' );
var Checkbox = require( 'SUN/Checkbox' );
var fluidPressureAndFlow = require( 'FLUID_PRESSURE_AND_FLOW/fluidPressureAndFlow' );
var HBox = require( 'SCENERY/nodes/HBox' );
var HStrut = require( 'SCENERY/nodes/HStrut' );
Expand Down Expand Up @@ -63,22 +63,22 @@ define( function( require ) {
alignOptions.spacing * 2;
var rulerArray = [ rulerSet[ 0 ], new HStrut( padWidth ), rulerSet[ 1 ] ];

var rulerCheckBox = new CheckBox( new HBox( { children: rulerArray } ), underPressureModel.isRulerVisibleProperty,
var rulerCheckbox = new Checkbox( new HBox( { children: rulerArray } ), underPressureModel.isRulerVisibleProperty,
alignOptions );
var gridCheckBox = new CheckBox( new HBox( { children: gridArray } ), underPressureModel.isGridVisibleProperty,
var gridCheckbox = new Checkbox( new HBox( { children: gridArray } ), underPressureModel.isGridVisibleProperty,
alignOptions );

// touch areas, empirically determined
rulerCheckBox.touchArea = rulerCheckBox.bounds.dilatedY( 1 );
gridCheckBox.touchArea = gridCheckBox.bounds.dilatedY( 3 );
rulerCheckbox.touchArea = rulerCheckbox.bounds.dilatedY( 1 );
gridCheckbox.touchArea = gridCheckbox.bounds.dilatedY( 3 );

var checkBoxChildren = [ rulerCheckBox, gridCheckBox ];
var checkboxChildren = [ rulerCheckbox, gridCheckbox ];

var checkBoxes = new VBox( { align: 'left', spacing: 5, children: checkBoxChildren } );
var checkboxes = new VBox( { align: 'left', spacing: 5, children: checkboxChildren } );

var content = new VBox( {
spacing: 5,
children: [ checkBoxes, new VStrut( 2 ), atmosphereControlNode ],
children: [ checkboxes, new VStrut( 2 ), atmosphereControlNode ],
align: 'left'
} );

Expand Down
16 changes: 8 additions & 8 deletions js/watertower/view/ToolsControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define( function( require ) {
'use strict';

// modules
var CheckBox = require( 'SUN/CheckBox' );
var Checkbox = require( 'SUN/Checkbox' );
var fluidPressureAndFlow = require( 'FLUID_PRESSURE_AND_FLOW/fluidPressureAndFlow' );
var HBox = require( 'SCENERY/nodes/HBox' );
var HStrut = require( 'SCENERY/nodes/HStrut' );
Expand Down Expand Up @@ -68,20 +68,20 @@ define( function( require ) {
return new HBox( { children: [ itemSpec.label, new HStrut( strutWidth ), itemSpec.icon ] } );
};

var checkBoxOptions = {
var checkboxOptions = {
boxWidth: 18,
spacing: 5
};

// pad all the rows so the text nodes are left aligned and the icons is right aligned
var checkBoxChildren = [
new CheckBox( createItem( ruler ), waterTowerModel.isRulerVisibleProperty, checkBoxOptions ),
new CheckBox( createItem( measuringTape ), waterTowerModel.isMeasuringTapeVisibleProperty, checkBoxOptions ),
new CheckBox( createItem( hose ), waterTowerModel.isHoseVisibleProperty, checkBoxOptions )
var checkboxChildren = [
new Checkbox( createItem( ruler ), waterTowerModel.isRulerVisibleProperty, checkboxOptions ),
new Checkbox( createItem( measuringTape ), waterTowerModel.isMeasuringTapeVisibleProperty, checkboxOptions ),
new Checkbox( createItem( hose ), waterTowerModel.isHoseVisibleProperty, checkboxOptions )
];
var checkBoxes = new VBox( { align: 'left', spacing: 10, children: checkBoxChildren } );
var checkboxes = new VBox( { align: 'left', spacing: 10, children: checkboxChildren } );

Panel.call( this, checkBoxes, options );
Panel.call( this, checkboxes, options );
}

//Create an icon for the ruler check box
Expand Down

0 comments on commit a556c76

Please sign in to comment.