diff --git a/js/friction/FrictionA11yStrings.js b/js/friction/FrictionA11yStrings.js index 86582cc8..b9828505 100644 --- a/js/friction/FrictionA11yStrings.js +++ b/js/friction/FrictionA11yStrings.js @@ -23,7 +23,7 @@ define( function( require ) { } }; - // TODO: This seems it should be factored out + // TODO: This seems it should be factored out, see https://github.com/phetsims/tasks/issues/917 if ( phet.chipper.queryParameters.stringTest === 'xss' ) { for ( var key in FrictionA11yStrings ) { FrictionA11yStrings[ key ].value += ''; diff --git a/js/friction/FrictionSharedConstants.js b/js/friction/FrictionConstants.js similarity index 84% rename from js/friction/FrictionSharedConstants.js rename to js/friction/FrictionConstants.js index 877074b8..62a6ebac 100644 --- a/js/friction/FrictionSharedConstants.js +++ b/js/friction/FrictionConstants.js @@ -2,7 +2,6 @@ /** * Shared constants for the 'Friction' simulation. - * TODO: rename to FrictionConstants * * @author Jesse Greenberg (PhET Interactive Simulations) * @author Michael Kauzmann (PhET Interactive Simulations) @@ -13,7 +12,7 @@ define( function( require ) { // modules var friction = require( 'FRICTION/friction' ); - var FrictionSharedConstants = { + var FrictionConstants = { TOP_BOOK_COLOR_MACRO: 'rgb(125,226,249)', // color of the macroscopic view of the book TOP_BOOK_COLOR: 'rgb(125,226,249)', // color for the book in the magnified view TOP_BOOK_ATOMS_COLOR: 'rgb( 0, 255, 255 )', // color for the atoms in the magnified view @@ -24,7 +23,7 @@ define( function( require ) { ATOM_RADIUS: 7 // in screen coordinates }; - friction.register( 'FrictionSharedConstants', FrictionSharedConstants ); + friction.register( 'FrictionConstants', FrictionConstants ); - return FrictionSharedConstants; + return FrictionConstants; } ); \ No newline at end of file diff --git a/js/friction/model/FrictionModel.js b/js/friction/model/FrictionModel.js index 2c1306a6..c02c5181 100644 --- a/js/friction/model/FrictionModel.js +++ b/js/friction/model/FrictionModel.js @@ -13,7 +13,7 @@ define( function( require ) { // modules var Emitter = require( 'AXON/Emitter' ); var friction = require( 'FRICTION/friction' ); - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var inherit = require( 'PHET_CORE/inherit' ); var NumberProperty = require( 'AXON/NumberProperty' ); var Property = require( 'AXON/Property' ); @@ -26,15 +26,15 @@ define( function( require ) { var BooleanIO = require( 'ifphetio!PHET_IO/types/BooleanIO' ); // constants - var ATOM_RADIUS = FrictionSharedConstants.ATOM_RADIUS; // radius of single atom + var ATOM_RADIUS = FrictionConstants.ATOM_RADIUS; // radius of single atom var ATOM_SPACING_X = 20; // x-distance between neighbors (atoms) var ATOM_SPACING_Y = 20; // y-distance between neighbors (atoms) var INITIAL_ATOM_SPACING_Y = 25; // initial distance between top and bottom atoms var AMPLITUDE_MIN = 1; // min amplitude for an atom var AMPLITUDE_EVAPORATE = 7; // evaporation amplitude for an atom var AMPLITUDE_MAX = 12; // atom's max amplitude - var BOOK_TOP_ATOMS_COLOR = FrictionSharedConstants.TOP_BOOK_ATOMS_COLOR; // color of top book - var BOOK_BOTTOM_ATOMS_COLOR = FrictionSharedConstants.BOTTOM_BOOK_ATOMS_COLOR; // color of bottom + var BOOK_TOP_ATOMS_COLOR = FrictionConstants.TOP_BOOK_ATOMS_COLOR; // color of top book + var BOOK_BOTTOM_ATOMS_COLOR = FrictionConstants.BOTTOM_BOOK_ATOMS_COLOR; // color of bottom var COOLING_RATE = 0.2; // proportion per second; adjust in order to change the cooling rate var HEATING_MULTIPLIER = 0.0075; // multiplied by distance moved while in contact to control heating rate var EVAPORATION_AMPLITUDE_REDUCTION = 0.01; // decrease in amplitude (a.k.a. temperature) when an atom evaporates diff --git a/js/friction/view/FrictionScreenView.js b/js/friction/view/FrictionScreenView.js index 1886f5fc..2e7e7635 100644 --- a/js/friction/view/FrictionScreenView.js +++ b/js/friction/view/FrictionScreenView.js @@ -14,7 +14,7 @@ define( function( require ) { var BookNode = require( 'FRICTION/friction/view/book/BookNode' ); var Bounds2 = require( 'DOT/Bounds2' ); var friction = require( 'FRICTION/friction' ); - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var inherit = require( 'PHET_CORE/inherit' ); var MagnifierNode = require( 'FRICTION/friction/view/magnifier/MagnifierNode' ); var ResetAllButton = require( 'SCENERY_PHET/buttons/ResetAllButton' ); @@ -50,7 +50,7 @@ define( function( require ) { this.draggableBook = new BookNode( model, chemistryString, { x: 65, y: 209, - color: FrictionSharedConstants.TOP_BOOK_COLOR_MACRO, + color: FrictionConstants.TOP_BOOK_COLOR_MACRO, drag: true, tandem: tandem.createTandem( 'chemistryBookNode' ) } ); diff --git a/js/friction/view/book/BookNode.js b/js/friction/view/book/BookNode.js index da3445c7..98bf5b1a 100644 --- a/js/friction/view/book/BookNode.js +++ b/js/friction/view/book/BookNode.js @@ -18,7 +18,7 @@ define( function( require ) { var friction = require( 'FRICTION/friction' ); var FrictionA11yStrings = require( 'FRICTION/friction/FrictionA11yStrings' ); var FrictionKeyboardDragHandler = require( 'FRICTION/friction/view/FrictionKeyboardDragHandler' ); - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var inherit = require( 'PHET_CORE/inherit' ); var Node = require( 'SCENERY/nodes/Node' ); var Shape = require( 'KITE/Shape' ); @@ -40,7 +40,7 @@ define( function( require ) { // whether or not we can drag the book drag: false, - color: FrictionSharedConstants.BOTTOM_BOOK_COLOR_MACRO + color: FrictionConstants.BOTTOM_BOOK_COLOR_MACRO }, options ); assert && assert( typeof options.x === 'number', 'options.x must be specified' ); diff --git a/js/friction/view/book/CoverNode.js b/js/friction/view/book/CoverNode.js index 489867db..471f4df9 100644 --- a/js/friction/view/book/CoverNode.js +++ b/js/friction/view/book/CoverNode.js @@ -11,7 +11,7 @@ define( function( require ) { 'use strict'; // modules - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var inherit = require( 'PHET_CORE/inherit' ); var Node = require( 'SCENERY/nodes/Node' ); var Path = require( 'SCENERY/nodes/Path' ); @@ -71,7 +71,7 @@ define( function( require ) { } ) ); var titleNode = new Text( title, { font: FONT, - fill: FrictionSharedConstants.BOOK_TEXT_COLOR, + fill: FrictionConstants.BOOK_TEXT_COLOR, pickable: false } ); titleNode.scale( Math.min( ( WIDTH * 0.9 ) / titleNode.width, 1 ) ); diff --git a/js/friction/view/magnifier/AtomCanvasNode.js b/js/friction/view/magnifier/AtomCanvasNode.js index b321fbcf..aa1d6286 100644 --- a/js/friction/view/magnifier/AtomCanvasNode.js +++ b/js/friction/view/magnifier/AtomCanvasNode.js @@ -11,7 +11,7 @@ define( function( require ) { // modules var CanvasNode = require( 'SCENERY/nodes/CanvasNode' ); var friction = require( 'FRICTION/friction' ); - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var inherit = require( 'PHET_CORE/inherit' ); var Vector2 = require( 'DOT/Vector2' ); @@ -40,7 +40,7 @@ define( function( require ) { var context = this.particleImageCanvas.getContext( '2d' ); context.strokeStyle = 'black'; context.lineWidth = 2; - context.fillStyle = FrictionSharedConstants.TOP_BOOK_ATOMS_COLOR; + context.fillStyle = FrictionConstants.TOP_BOOK_ATOMS_COLOR; context.beginPath(); context.arc( PARTICLE_IMAGE_SIZE / 2, @@ -53,7 +53,7 @@ define( function( require ) { context.stroke(); // draw the circle that will be used for atoms in the bottom book onto the canvas - context.fillStyle = FrictionSharedConstants.BOTTOM_BOOK_ATOMS_COLOR; + context.fillStyle = FrictionConstants.BOTTOM_BOOK_ATOMS_COLOR; context.beginPath(); context.arc( PARTICLE_IMAGE_SIZE * 1.5, @@ -107,7 +107,7 @@ define( function( require ) { // image width - this is tweaked slightly to account for stroke and to get behavior that is consistent with // previous versions of the sim - var particleImageSize = FrictionSharedConstants.ATOM_RADIUS * 2 * 1.1; + var particleImageSize = FrictionConstants.ATOM_RADIUS * 2 * 1.1; // render each of the atoms on the canvas for ( var i = 0; i < this.atoms.length; i++ ) { diff --git a/js/friction/view/magnifier/AtomNode.js b/js/friction/view/magnifier/AtomNode.js index 2d4711ce..07838a87 100644 --- a/js/friction/view/magnifier/AtomNode.js +++ b/js/friction/view/magnifier/AtomNode.js @@ -13,7 +13,7 @@ define( function( require ) { // modules var Circle = require( 'SCENERY/nodes/Circle' ); var friction = require( 'FRICTION/friction' ); - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var Image = require( 'SCENERY/nodes/Image' ); var inherit = require( 'PHET_CORE/inherit' ); var Node = require( 'SCENERY/nodes/Node' ); @@ -34,7 +34,7 @@ define( function( require ) { // TODO: mark these variables with visibility annotations // flag records whether we are on the top book - this.isTopAtom = options.color === FrictionSharedConstants.TOP_BOOK_ATOMS_COLOR; + this.isTopAtom = options.color === FrictionConstants.TOP_BOOK_ATOMS_COLOR; // TODO: visibility annotation and docs this.isEvaporated = false; diff --git a/js/friction/view/magnifier/MagnifierNode.js b/js/friction/view/magnifier/MagnifierNode.js index 3c05395a..190b9bd2 100644 --- a/js/friction/view/magnifier/MagnifierNode.js +++ b/js/friction/view/magnifier/MagnifierNode.js @@ -22,7 +22,7 @@ define( function( require ) { var friction = require( 'FRICTION/friction' ); var FrictionA11yStrings = require( 'FRICTION/friction/FrictionA11yStrings' ); var FrictionKeyboardDragHandler = require( 'FRICTION/friction/view/FrictionKeyboardDragHandler' ); - var FrictionSharedConstants = require( 'FRICTION/friction/FrictionSharedConstants' ); + var FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); var inherit = require( 'PHET_CORE/inherit' ); var MagnifierTargetNode = require( 'FRICTION/friction/view/magnifier/MagnifierTargetNode' ); var Node = require( 'SCENERY/nodes/Node' ); @@ -120,12 +120,12 @@ define( function( require ) { this.param.height / 3, 0, this.param.round - 3, - { fill: FrictionSharedConstants.BOTTOM_BOOK_COLOR } + { fill: FrictionConstants.BOTTOM_BOOK_COLOR } ) ] } ); this.addRowCircles( model, this.bottomBookBackground, { - color: FrictionSharedConstants.BOTTOM_BOOK_COLOR, + color: FrictionConstants.BOTTOM_BOOK_COLOR, x: -model.atoms.distanceX / 2, y: 2 * this.param.height / 3 - 2, width: this.param.width @@ -144,7 +144,7 @@ define( function( require ) { 4 * this.param.height / 3 - model.atoms.distance, this.param.round, this.param.round, { - fill: FrictionSharedConstants.TOP_BOOK_COLOR + fill: FrictionConstants.TOP_BOOK_COLOR } ); model.addDragInputListener( background, options.tandem.createTandem( 'backgroundDragHandler' ) ); this.topBookBackground.addChild( background ); @@ -194,7 +194,7 @@ define( function( require ) { dragArea.addAccessibleInputListener( this.keyboardDragHandler ); this.addRowCircles( model, this.topBookBackground, { - color: FrictionSharedConstants.TOP_BOOK_COLOR, + color: FrictionConstants.TOP_BOOK_COLOR, x: -this.param.width, y: this.param.height / 3 - model.atoms.distance, width: 3 * this.param.width