From a64423b8c9dd2d04f78047d0c2fc53ebd004409a Mon Sep 17 00:00:00 2001 From: samreid Date: Tue, 13 Jun 2017 09:52:17 -0600 Subject: [PATCH] Expanded abbreviations, see https://github.com/phetsims/circuit-construction-kit-common/issues/339 --- ...js => CircuitConstructionKitCommonUtil.js} | 6 +- js/view/AmmeterNode.js | 4 +- js/view/BatteryNode.js | 2 +- js/view/BatteryResistanceControl.js | 6 +- js/view/CCKIcon.js | 89 ------------------- ... => CircuitConstructionKitAccordionBox.js} | 6 +- ...=> CircuitConstructionKitLightBulbNode.js} | 20 ++--- ...anel.js => CircuitConstructionKitPanel.js} | 6 +- ...js => CircuitConstructionKitScreenView.js} | 6 +- js/view/CircuitElementEditContainerPanel.js | 6 +- js/view/CircuitElementEditPanel.js | 4 +- js/view/CircuitElementNode.js | 2 +- js/view/CircuitElementToolbox.js | 10 +-- js/view/CircuitLayerNode.js | 8 +- js/view/DisplayOptionsPanel.js | 6 +- js/view/FixedLengthCircuitElementNode.js | 10 +-- js/view/LightBulbSocketNode.js | 8 +- js/view/ResistorNode.js | 2 +- js/view/SensorToolbox.js | 6 +- js/view/SeriesAmmeterNode.js | 6 +- js/view/SwitchNode.js | 2 +- js/view/SwitchReadoutNode.js | 4 +- js/view/{CCKTrashButton.js => TrashButton.js} | 6 +- js/view/VoltmeterNode.js | 4 +- js/view/WireResistivityControl.js | 6 +- 25 files changed, 73 insertions(+), 162 deletions(-) rename js/{CCKUtil.js => CircuitConstructionKitCommonUtil.js} (89%) delete mode 100644 js/view/CCKIcon.js rename js/view/{CCKAccordionBox.js => CircuitConstructionKitAccordionBox.js} (86%) rename js/view/{CCKLightBulbNode.js => CircuitConstructionKitLightBulbNode.js} (88%) rename js/view/{CCKPanel.js => CircuitConstructionKitPanel.js} (82%) rename js/view/{CCKScreenView.js => CircuitConstructionKitScreenView.js} (98%) rename js/view/{CCKTrashButton.js => TrashButton.js} (87%) diff --git a/js/CCKUtil.js b/js/CircuitConstructionKitCommonUtil.js similarity index 89% rename from js/CCKUtil.js rename to js/CircuitConstructionKitCommonUtil.js index 34682f05..7e85ea3b 100644 --- a/js/CCKUtil.js +++ b/js/CircuitConstructionKitCommonUtil.js @@ -17,12 +17,12 @@ define( function( require ) { /** * @constructor */ - function CCKUtil() { + function CircuitConstructionKitCommonUtil() { } - circuitConstructionKitCommon.register( 'CCKUtil', CCKUtil ); + circuitConstructionKitCommon.register( 'CircuitConstructionKitCommonUtil', CircuitConstructionKitCommonUtil ); - return inherit( Object, CCKUtil, {}, { + return inherit( Object, CircuitConstructionKitCommonUtil, {}, { /** * Sets the values of a given Matrix to be translated the rotated diff --git a/js/view/AmmeterNode.js b/js/view/AmmeterNode.js index c78bf13f..b455d202 100644 --- a/js/view/AmmeterNode.js +++ b/js/view/AmmeterNode.js @@ -23,7 +23,7 @@ define( function( require ) { var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); var BooleanProperty = require( 'AXON/BooleanProperty' ); var MovableDragHandler = require( 'SCENERY_PHET/input/MovableDragHandler' ); - var CCKUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKUtil' ); + var CircuitConstructionKitCommonUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitCommonUtil' ); // images var ammeterBodyImage = require( 'mipmap!CIRCUIT_CONSTRUCTION_KIT_COMMON/ammeter_body.png' ); @@ -77,7 +77,7 @@ define( function( require ) { // Ammeters in this sim only show positive values, not direction (which is arbitrary anyways) return current === null ? questionMarkString : Math.abs( current ) > max ? maxString : - CCKUtil.createMeasurementReadout( ampereUnitsString, 'ampere', current, 3 ); + CircuitConstructionKitCommonUtil.createMeasurementReadout( ampereUnitsString, 'ampere', current, 3 ); } ); var probeTextNode = new ProbeTextNode( currentReadoutProperty, options.showResultsProperty, currentString, tandem.createTandem( 'probeTextNode' ), { diff --git a/js/view/BatteryNode.js b/js/view/BatteryNode.js index e4f233e1..ce29f9de 100644 --- a/js/view/BatteryNode.js +++ b/js/view/BatteryNode.js @@ -32,7 +32,7 @@ define( function( require ) { var RIGHT_JUNCTION = WIDTH / 2 + GAP / 2; /** - * @param {CCKScreenView} circuitConstructionKitScreenView + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView * @param {CircuitLayerNode} circuitLayerNode * @param {Battery} battery * @param {Property.} showResultsProperty - supplied for consistency with other CircuitElementNode constructors diff --git a/js/view/BatteryResistanceControl.js b/js/view/BatteryResistanceControl.js index ac6c67c4..6d47379a 100644 --- a/js/view/BatteryResistanceControl.js +++ b/js/view/BatteryResistanceControl.js @@ -18,7 +18,7 @@ define( function( require ) { var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); var VBox = require( 'SCENERY/nodes/VBox' ); var PhetFont = require( 'SCENERY_PHET/PhetFont' ); - var CCKAccordionBox = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKAccordionBox' ); + var CircuitConstructionKitAccordionBox = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitAccordionBox' ); var Util = require( 'DOT/Util' ); var Range = require( 'DOT/Range' ); var StringUtils = require( 'PHETCOMMON/util/StringUtils' ); @@ -94,7 +94,7 @@ define( function( require ) { tandem: readoutTextPanelTandem } ); - CCKAccordionBox.call( this, alignGroup.createBox( new VBox( { + CircuitConstructionKitAccordionBox.call( this, alignGroup.createBox( new VBox( { spacing: -4, children: [ readoutTextPanel, slider ] } ) ), batteryResistanceString, tandem ); @@ -102,5 +102,5 @@ define( function( require ) { circuitConstructionKitCommon.register( 'BatteryResistanceControl', BatteryResistanceControl ); - return inherit( CCKAccordionBox, BatteryResistanceControl ); + return inherit( CircuitConstructionKitAccordionBox, BatteryResistanceControl ); } ); diff --git a/js/view/CCKIcon.js b/js/view/CCKIcon.js deleted file mode 100644 index 8c60c14f..00000000 --- a/js/view/CCKIcon.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2017, University of Colorado Boulder - -/** - * Home screen/navigation bar icon that shows common circuit elements. - * - * @author Sam Reid (PhET Interactive Simulations) - */ -define( function( require ) { - 'use strict'; - - // modules - var circuitConstructionKitCommon = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/circuitConstructionKitCommon' ); - var inherit = require( 'PHET_CORE/inherit' ); - var Screen = require( 'JOIST/Screen' ); - var Rectangle = require( 'SCENERY/nodes/Rectangle' ); - var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); - var VBox = require( 'SCENERY/nodes/VBox' ); - var HBox = require( 'SCENERY/nodes/HBox' ); - var Image = require( 'SCENERY/nodes/Image' ); - var ResistorNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/ResistorNode' ); - var Vertex = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Vertex' ); - var Resistor = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Resistor' ); - var Wire = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Wire' ); - var WireNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/WireNode' ); - var CustomLightBulbNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CustomLightBulbNode' ); - var NumberProperty = require( 'AXON/NumberProperty' ); - var Property = require( 'AXON/Property' ); - - // images - var batteryMipmap = require( 'mipmap!CIRCUIT_CONSTRUCTION_KIT_COMMON/battery.png' ); - - // constants - var BACKGROUND_COLOR = CircuitConstructionKitConstants.BACKGROUND_COLOR; - var ELEMENT_WIDTH = 50; - - /** - * @param {Tandem} tandem - * @constructor - */ - function CCKIcon( tandem ) { - - Rectangle.call( this, 0, 0, Screen.MINIMUM_HOME_SCREEN_ICON_SIZE.width, Screen.MINIMUM_HOME_SCREEN_ICON_SIZE.height, { - fill: BACKGROUND_COLOR - } ); - - var viewProperty = new Property( 'lifelike' ); - - var wire = new Wire( new Vertex( 0, 0 ), new Vertex( 100, 0 ), new Property( 0 ), tandem.createTandem( 'wire' ) ); - var wireNode = new WireNode( null, null, wire, null, viewProperty, tandem.createTandem( 'wireIcon' ) ); - - // Model element used to create the node - var resistor = new Resistor( new Vertex( 0, 0 ), new Vertex( CircuitConstructionKitConstants.RESISTOR_LENGTH, 0 ), tandem.createTandem( 'resistor' ) ); - - var resistorNode = new ResistorNode( null, null, resistor, null, viewProperty, tandem.createTandem( 'resistorIcon' ), { - icon: true - } ); - - var batteryNode = new Image( batteryMipmap ); - - var lightBulbNode = new CustomLightBulbNode( new NumberProperty( 0 ) ); - - // icons should not be discoverable by assistive technology, and should not be focusable - var a11yIconOptions = { - tagName: null, - focusable: false - }; - - resistorNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / resistorNode.width * 0.75 } ) ); - wireNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / wireNode.width * 0.7 } ) ); - batteryNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / batteryNode.width } ) ); - lightBulbNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / lightBulbNode.width / 2 } ) ); - var vBox = new VBox( { - spacing: 20, - children: [ new HBox( { spacing: 20, children: [ wireNode, resistorNode ] } ), new HBox( { - spacing: 20, - children: [ batteryNode, lightBulbNode ] - } ) ] - } ); - vBox.mutate( { - scale: this.height / vBox.height * 0.8, - center: this.center - } ); - this.addChild( vBox ); - } - - circuitConstructionKitCommon.register( 'CCKIcon', CCKIcon ); - - return inherit( Rectangle, CCKIcon ); -} ); \ No newline at end of file diff --git a/js/view/CCKAccordionBox.js b/js/view/CircuitConstructionKitAccordionBox.js similarity index 86% rename from js/view/CCKAccordionBox.js rename to js/view/CircuitConstructionKitAccordionBox.js index 73a01bb7..c925db3b 100644 --- a/js/view/CCKAccordionBox.js +++ b/js/view/CircuitConstructionKitAccordionBox.js @@ -24,7 +24,7 @@ define( function( require ) { * @param {Tandem} tandem * @constructor */ - function CCKAccordionBox( content, title, tandem ) { + function CircuitConstructionKitAccordionBox( content, title, tandem ) { AccordionBox.call( this, content, { fill: CircuitConstructionKitConstants.PANEL_COLOR, cornerRadius: CircuitConstructionKitConstants.CORNER_RADIUS, @@ -46,7 +46,7 @@ define( function( require ) { } ); } - circuitConstructionKitCommon.register( 'CCKAccordionBox', CCKAccordionBox ); + circuitConstructionKitCommon.register( 'CircuitConstructionKitAccordionBox', CircuitConstructionKitAccordionBox ); - return inherit( AccordionBox, CCKAccordionBox ); + return inherit( AccordionBox, CircuitConstructionKitAccordionBox ); } ); \ No newline at end of file diff --git a/js/view/CCKLightBulbNode.js b/js/view/CircuitConstructionKitLightBulbNode.js similarity index 88% rename from js/view/CCKLightBulbNode.js rename to js/view/CircuitConstructionKitLightBulbNode.js index 7f4ec8f6..98760b05 100644 --- a/js/view/CCKLightBulbNode.js +++ b/js/view/CircuitConstructionKitLightBulbNode.js @@ -1,7 +1,7 @@ // Copyright 2015-2017, University of Colorado Boulder /** - * Named CCKLightBulbNode to avoid collisions with SCENERY_PHET/LightBulbNode. Renders the bulb shape and brightness + * Named CircuitConstructionKitLightBulbNode to avoid collisions with SCENERY_PHET/LightBulbNode. Renders the bulb shape and brightness * lines. Note that the socket is rendered in LightBulbSocketNode. * * @author Sam Reid (PhET Interactive Simulations) @@ -24,7 +24,7 @@ define( function( require ) { var Shape = require( 'KITE/Shape' ); var LightBulbSocketNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/LightBulbSocketNode' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); - var CCKUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKUtil' ); + var CircuitConstructionKitCommonUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitCommonUtil' ); // images var fireImage = require( 'mipmap!CIRCUIT_CONSTRUCTION_KIT_COMMON/fire.png' ); @@ -61,7 +61,7 @@ define( function( require ) { /** * This constructor is called dynamically and must match the signature of other circuit element nodes. - * @param {CCKScreenView} circuitConstructionKitScreenView - the main screen view + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView - the main screen view * @param {CircuitLayerNode} circuitLayerNode - the node for the entire circuit * @param {LightBulb} lightBulb - the light bulb model * @param {Property.} showResultsProperty - true if the sim can display values @@ -70,7 +70,7 @@ define( function( require ) { * @param {Object} [options] * @constructor */ - function CCKLightBulbNode( circuitConstructionKitScreenView, circuitLayerNode, lightBulb, showResultsProperty, viewProperty, tandem, options ) { + function CircuitConstructionKitLightBulbNode( circuitConstructionKitScreenView, circuitLayerNode, lightBulb, showResultsProperty, viewProperty, tandem, options ) { options = options || {}; var brightnessProperty = new NumberProperty( 0 ); var updateBrightness = Property.multilink( [ lightBulb.currentProperty, showResultsProperty, lightBulb.voltageDifferenceProperty ], function( current, running, voltageDifference ) { @@ -169,15 +169,15 @@ define( function( require ) { circuitLayerNode && circuitLayerNode.lightBulbSocketLayer.addChild( this.socketNode ); } - this.disposeCCKLightBulbNode = function() { + this.disposeCircuitConstructionKitLightBulbNode = function() { updateBrightness.dispose(); circuitLayerNode && circuitLayerNode.lightBulbSocketLayer.removeChild( this.socketNode ); }; } - circuitConstructionKitCommon.register( 'CCKLightBulbNode', CCKLightBulbNode ); + circuitConstructionKitCommon.register( 'CircuitConstructionKitLightBulbNode', CircuitConstructionKitLightBulbNode ); - return inherit( FixedLengthCircuitElementNode, CCKLightBulbNode, { + return inherit( FixedLengthCircuitElementNode, CircuitConstructionKitLightBulbNode, { /** * @override @@ -189,13 +189,13 @@ define( function( require ) { var angle = delta.angle() + Math.PI / 4; // Update the node transform in a single step, see #66 - CCKUtil.setToTranslationRotation( SCRATCH_MATRIX, startPosition, angle ); + CircuitConstructionKitCommonUtil.setToTranslationRotation( SCRATCH_MATRIX, startPosition, angle ); this.contentNode.setMatrix( SCRATCH_MATRIX ); this.highlightNode && this.highlightNode.setMatrix( SCRATCH_MATRIX ); // Update the fire transform - CCKUtil.setToTranslationRotation( SCRATCH_MATRIX, startPosition, angle ) + CircuitConstructionKitCommonUtil.setToTranslationRotation( SCRATCH_MATRIX, startPosition, angle ) .multiplyMatrix( SCRATCH_MATRIX_2.setToTranslation( -100, -fireImage[ 0 ].height - 350 ) ); this.fireNode && this.fireNode.setMatrix( SCRATCH_MATRIX ); @@ -206,7 +206,7 @@ define( function( require ) { * @public */ dispose: function() { - this.disposeCCKLightBulbNode(); + this.disposeCircuitConstructionKitLightBulbNode(); FixedLengthCircuitElementNode.prototype.dispose.call( this ); }, diff --git a/js/view/CCKPanel.js b/js/view/CircuitConstructionKitPanel.js similarity index 82% rename from js/view/CCKPanel.js rename to js/view/CircuitConstructionKitPanel.js index 28a3a219..aff74d69 100644 --- a/js/view/CCKPanel.js +++ b/js/view/CircuitConstructionKitPanel.js @@ -20,7 +20,7 @@ define( function( require ) { * @param {Object} [options] * @constructor */ - function CCKPanel( content, tandem, options ) { + function CircuitConstructionKitPanel( content, tandem, options ) { options = _.extend( { fill: CircuitConstructionKitConstants.PANEL_COLOR, stroke: 'black', @@ -33,7 +33,7 @@ define( function( require ) { Panel.call( this, content, options ); } - circuitConstructionKitCommon.register( 'CCKPanel', CCKPanel ); + circuitConstructionKitCommon.register( 'CircuitConstructionKitPanel', CircuitConstructionKitPanel ); - return inherit( Panel, CCKPanel, {} ); + return inherit( Panel, CircuitConstructionKitPanel, {} ); } ); \ No newline at end of file diff --git a/js/view/CCKScreenView.js b/js/view/CircuitConstructionKitScreenView.js similarity index 98% rename from js/view/CCKScreenView.js rename to js/view/CircuitConstructionKitScreenView.js index a77618a2..c2faa480 100644 --- a/js/view/CCKScreenView.js +++ b/js/view/CircuitConstructionKitScreenView.js @@ -61,7 +61,7 @@ define( function( require ) { * @param {Object} [options] * @constructor */ - function CCKScreenView( circuitConstructionKitModel, tandem, options ) { + function CircuitConstructionKitScreenView( circuitConstructionKitModel, tandem, options ) { var self = this; this.circuitConstructionKitModel = circuitConstructionKitModel; @@ -381,9 +381,9 @@ define( function( require ) { } ); } - circuitConstructionKitCommon.register( 'CCKScreenView', CCKScreenView ); + circuitConstructionKitCommon.register( 'CircuitConstructionKitScreenView', CircuitConstructionKitScreenView ); - return inherit( ScreenView, CCKScreenView, { + return inherit( ScreenView, CircuitConstructionKitScreenView, { /** * When other UI components are moved to the back, we must make sure the background stays behind them. diff --git a/js/view/CircuitElementEditContainerPanel.js b/js/view/CircuitElementEditContainerPanel.js index 92ccb119..9d68b454 100644 --- a/js/view/CircuitElementEditContainerPanel.js +++ b/js/view/CircuitElementEditContainerPanel.js @@ -24,7 +24,7 @@ define( function( require ) { var CircuitElementEditPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitElementEditPanel' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); var SwitchReadoutNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/SwitchReadoutNode' ); - var CCKTrashButton = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKTrashButton' ); + var TrashButton = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/TrashButton' ); // strings var tapCircuitElementToEditString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_COMMON/tapCircuitElementToEdit' ); @@ -99,7 +99,7 @@ define( function( require ) { else if ( isResistor ) { // Just show a trash button for non-editable resistors which are grab bag items - previousPanel = new CCKTrashButton( circuit, selectedCircuitElement, groupTandem.createNextTandem().createTandem( 'trashButton' ) ); + previousPanel = new TrashButton( circuit, selectedCircuitElement, groupTandem.createNextTandem().createTandem( 'trashButton' ) ); } else if ( isBattery ) { previousPanel = new CircuitElementEditPanel( voltageString, voltsString, selectedCircuitElement.voltageProperty, circuit, selectedCircuitElement, groupTandem.createNextTandem() ); @@ -110,7 +110,7 @@ define( function( require ) { else if ( isSeriesAmmeter || isWire ) { // Just show a trash button - previousPanel = new CCKTrashButton( circuit, selectedCircuitElement, groupTandem.createNextTandem().createTandem( 'trashButton' ) ); + previousPanel = new TrashButton( circuit, selectedCircuitElement, groupTandem.createNextTandem().createTandem( 'trashButton' ) ); } } else { diff --git a/js/view/CircuitElementEditPanel.js b/js/view/CircuitElementEditPanel.js index 1013d0fa..3dbb9719 100644 --- a/js/view/CircuitElementEditPanel.js +++ b/js/view/CircuitElementEditPanel.js @@ -16,7 +16,7 @@ define( function( require ) { var NumberControl = require( 'SCENERY_PHET/NumberControl' ); var PhetFont = require( 'SCENERY_PHET/PhetFont' ); var StringUtils = require( 'PHETCOMMON/util/StringUtils' ); - var CCKTrashButton = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKTrashButton' ); + var TrashButton = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/TrashButton' ); // strings var valueUnitsPatternString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_COMMON/valueUnitsPattern' ); @@ -53,7 +53,7 @@ define( function( require ) { } ) ); // The button that deletes the circuit component - var trashButton = new CCKTrashButton( circuit, circuitElement, tandem.createTandem( 'trashButton' ) ); + var trashButton = new TrashButton( circuit, circuitElement, tandem.createTandem( 'trashButton' ) ); var children = [ numberControl ]; circuitElement.canBeDroppedInToolbox && children.push( trashButton ); diff --git a/js/view/CircuitElementNode.js b/js/view/CircuitElementNode.js index 84f55206..fc6bcb29 100644 --- a/js/view/CircuitElementNode.js +++ b/js/view/CircuitElementNode.js @@ -140,7 +140,7 @@ define( function( require ) { * @param {Object} event - scenery event * @param {Node} node - the node the input listener is attached to * @param {Vertex[]} vertices - the vertices that are dragged - * @param {CCKScreenView} circuitConstructionKitScreenView + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView * @param {CircuitLayerNode} circuitLayerNode * @param {Vector2} startPoint * @param {boolean} dragged diff --git a/js/view/CircuitElementToolbox.js b/js/view/CircuitElementToolbox.js index c3d64c3a..d84b9cce 100644 --- a/js/view/CircuitElementToolbox.js +++ b/js/view/CircuitElementToolbox.js @@ -12,7 +12,7 @@ define( function( require ) { // modules var inherit = require( 'PHET_CORE/inherit' ); var circuitConstructionKitCommon = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/circuitConstructionKitCommon' ); - var CCKPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKPanel' ); + var CircuitConstructionKitPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitPanel' ); var Node = require( 'SCENERY/nodes/Node' ); var Battery = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Battery' ); var LightBulb = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/LightBulb' ); @@ -22,7 +22,7 @@ define( function( require ) { var Resistor = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Resistor' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); var ResistorNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/ResistorNode' ); - var CCKLightBulbNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKLightBulbNode' ); + var CircuitConstructionKitLightBulbNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitLightBulbNode' ); var SwitchNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/SwitchNode' ); var BatteryNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/BatteryNode' ); var WireNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/WireNode' ); @@ -106,8 +106,8 @@ define( function( require ) { var wireIcon = new WireNode( null, null, wire, null, viewProperty, tandem.createTandem( 'wireIcon' ) ); var lightBulbIconModel = LightBulb.createAtPosition( new Vector2( 0, 0 ), circuit.vertexGroupTandem, CircuitConstructionKitConstants.DEFAULT_RESISTANCE, circuit.lightBulbGroupTandem.createNextTandem(), { highResistance: false } ); var highResistanceLightBulbIconModel = LightBulb.createAtPosition( new Vector2( 0, 0 ), circuit.vertexGroupTandem, 1000, circuit.lightBulbGroupTandem.createNextTandem(), { highResistance: true } ); - var lightBulbIcon = new CCKLightBulbNode( null, null, lightBulbIconModel, new Property( true ), viewProperty, tandem.createTandem( 'lightBulbIcon' ), { icon: true } ); - var highResistanceLightBulbIcon = new CCKLightBulbNode( null, null, highResistanceLightBulbIconModel, new Property( true ), viewProperty, tandem.createTandem( 'highResistanceLightBulbIcon' ), { icon: true } ); + var lightBulbIcon = new CircuitConstructionKitLightBulbNode( null, null, lightBulbIconModel, new Property( true ), viewProperty, tandem.createTandem( 'lightBulbIcon' ), { icon: true } ); + var highResistanceLightBulbIcon = new CircuitConstructionKitLightBulbNode( null, null, highResistanceLightBulbIconModel, new Property( true ), viewProperty, tandem.createTandem( 'highResistanceLightBulbIcon' ), { icon: true } ); var resistor = new Resistor( new Vertex( 0, 0 ), new Vertex( CircuitConstructionKitConstants.RESISTOR_LENGTH, 0 ), tandem.createTandem( 'resistor' ) ); var highResistanceResistor = new Resistor( new Vertex( 0, 0 ), new Vertex( CircuitConstructionKitConstants.RESISTOR_LENGTH, 0 ), tandem.createTandem( 'highResistanceResistor' ), { resistorType: 'high-resistance-resistor', resistance: 1000 @@ -395,7 +395,7 @@ define( function( require ) { var child = null; if ( children.length <= ITEMS_PER_PAGE ) { - child = new CCKPanel( new LayoutBox( { + child = new CircuitConstructionKitPanel( new LayoutBox( { orientation: options.orientation, spacing: CircuitConstructionKitConstants.TOOLBOX_ITEM_SPACING, children: children, diff --git a/js/view/CircuitLayerNode.js b/js/view/CircuitLayerNode.js index 0bb38f2c..73aaf998 100644 --- a/js/view/CircuitLayerNode.js +++ b/js/view/CircuitLayerNode.js @@ -22,7 +22,7 @@ define( function( require ) { var WireNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/WireNode' ); var SwitchNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/SwitchNode' ); var BatteryNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/BatteryNode' ); - var CCKLightBulbNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKLightBulbNode' ); + var CircuitConstructionKitLightBulbNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitLightBulbNode' ); var ResistorNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/ResistorNode' ); var SeriesAmmeterNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/SeriesAmmeterNode' ); var VertexNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/VertexNode' ); @@ -42,7 +42,7 @@ define( function( require ) { /** * @param {Circuit} circuit - the model Circuit - * @param {CCKScreenView} circuitConstructionKitScreenView - for dropping CircuitElement instances back in the toolbox + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView - for dropping CircuitElement instances back in the toolbox * @param {Tandem} tandem * @constructor */ @@ -75,7 +75,7 @@ define( function( require ) { // @public (read-only) so that additional Nodes may be interleaved this.mainLayer = new Node(); - // @public (read-only) but CCKLightBulbNode calls addChild/removeChild to add sockets to the front layer + // @public (read-only) but CircuitConstructionKitLightBulbNode calls addChild/removeChild to add sockets to the front layer this.lightBulbSocketLayer = new Node(); // @private Electrons appear in this layer when they need to be in front of the socket (on the right hand side of the bulb) @@ -183,7 +183,7 @@ define( function( require ) { initializeCircuitElementType( WireNode, Wire, tandem.createGroupTandem( 'wireNode' ) ); initializeCircuitElementType( BatteryNode, Battery, tandem.createGroupTandem( 'batteryNode' ) ); - initializeCircuitElementType( CCKLightBulbNode, LightBulb, tandem.createGroupTandem( 'lightBulbNode' ) ); + initializeCircuitElementType( CircuitConstructionKitLightBulbNode, LightBulb, tandem.createGroupTandem( 'lightBulbNode' ) ); initializeCircuitElementType( ResistorNode, Resistor, tandem.createGroupTandem( 'resistorNode' ) ); initializeCircuitElementType( SeriesAmmeterNode, SeriesAmmeter, tandem.createGroupTandem( 'seriesAmmeterNode' ) ); initializeCircuitElementType( SwitchNode, Switch, tandem.createGroupTandem( 'switchNode' ) ); diff --git a/js/view/DisplayOptionsPanel.js b/js/view/DisplayOptionsPanel.js index 62421d05..c9f159a7 100644 --- a/js/view/DisplayOptionsPanel.js +++ b/js/view/DisplayOptionsPanel.js @@ -11,7 +11,7 @@ define( function( require ) { // modules var circuitConstructionKitCommon = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/circuitConstructionKitCommon' ); var inherit = require( 'PHET_CORE/inherit' ); - var CCKPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKPanel' ); + var CircuitConstructionKitPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitPanel' ); var Text = require( 'SCENERY/nodes/Text' ); var HBox = require( 'SCENERY/nodes/HBox' ); var VBox = require( 'SCENERY/nodes/VBox' ); @@ -123,7 +123,7 @@ define( function( require ) { } ) ]; - CCKPanel.call( this, alignGroup.createBox( new VBox( { + CircuitConstructionKitPanel.call( this, alignGroup.createBox( new VBox( { children: children, spacing: 10, align: 'left' @@ -138,5 +138,5 @@ define( function( require ) { circuitConstructionKitCommon.register( 'DisplayOptionsPanel', DisplayOptionsPanel ); - return inherit( CCKPanel, DisplayOptionsPanel ); + return inherit( CircuitConstructionKitPanel, DisplayOptionsPanel ); } ); \ No newline at end of file diff --git a/js/view/FixedLengthCircuitElementNode.js b/js/view/FixedLengthCircuitElementNode.js index bc91f083..56d97e9b 100644 --- a/js/view/FixedLengthCircuitElementNode.js +++ b/js/view/FixedLengthCircuitElementNode.js @@ -20,7 +20,7 @@ define( function( require ) { var Node = require( 'SCENERY/nodes/Node' ); var Image = require( 'SCENERY/nodes/Image' ); var FixedLengthCircuitElementHighlightNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/FixedLengthCircuitElementHighlightNode' ); - var CCKUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKUtil' ); + var CircuitConstructionKitCommonUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitCommonUtil' ); // images var fireImage = require( 'mipmap!CIRCUIT_CONSTRUCTION_KIT_COMMON/fire.png' ); @@ -30,7 +30,7 @@ define( function( require ) { var rotationMatrix = new Matrix3(); /** - * @param {CCKScreenView} circuitConstructionKitScreenView - so that the node can be dropped back into the toolbox + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView - so that the node can be dropped back into the toolbox * @param {CircuitLayerNode} circuitLayerNode - Null if an icon is created * @param {FixedLengthCircuitElement} circuitElement - the corresponding model element * @param {Property.} viewProperty - 'lifelike'|'schematic' @@ -216,7 +216,7 @@ define( function( require ) { /** * Multiple updates may happen per frame, they are batched and updated once in the view step to improve performance. - * @protected - CCKLightBulbNode calls updateRender for its child socket node + * @protected - CircuitConstructionKitLightBulbNode calls updateRender for its child socket node */ updateRender: function() { @@ -226,7 +226,7 @@ define( function( require ) { var angle = delta.angle(); // Update the node transform in a single step, see #66 - CCKUtil.setToTranslationRotation( transform, startPosition, angle ); + CircuitConstructionKitCommonUtil.setToTranslationRotation( transform, startPosition, angle ); this.contentNode.setMatrix( transform ); this.highlightNode && this.highlightNode.setMatrix( transform ); @@ -234,7 +234,7 @@ define( function( require ) { var flameExtent = 0.8; var scale = delta.magnitude() / fireImage[ 0 ].width * flameExtent; var flameMargin = (1 - flameExtent) / 2; - CCKUtil.setToTranslationRotation( transform, startPosition, angle ) + CircuitConstructionKitCommonUtil.setToTranslationRotation( transform, startPosition, angle ) .multiplyMatrix( rotationMatrix.setToScale( scale ) ) .multiplyMatrix( rotationMatrix.setToTranslation( delta.magnitude() * flameMargin / scale, -fireImage[ 0 ].height ) ); this.fireNode && this.fireNode.setMatrix( transform ); diff --git a/js/view/LightBulbSocketNode.js b/js/view/LightBulbSocketNode.js index 07976c0b..4980cedf 100644 --- a/js/view/LightBulbSocketNode.js +++ b/js/view/LightBulbSocketNode.js @@ -17,14 +17,14 @@ define( function( require ) { var Matrix3 = require( 'DOT/Matrix3' ); var Rectangle = require( 'SCENERY/nodes/Rectangle' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); - var CCKUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKUtil' ); + var CircuitConstructionKitCommonUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitCommonUtil' ); // constants var SCRATCH_MATRIX = new Matrix3(); /** * This constructor is called dynamically and must match the signature of other circuit element nodes. - * @param {CCKScreenView} circuitConstructionKitScreenView - the main screen view + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView - the main screen view * @param {CircuitLayerNode} circuitLayerNode - the node for the entire circuit * @param {LightBulb} lightBulb - the light bulb model * @param {Property.} showResultsProperty - true if the sim can display values @@ -49,7 +49,7 @@ define( function( require ) { FixedLengthCircuitElementNode.call( this, circuitConstructionKitScreenView, circuitLayerNode, lightBulb, viewProperty, lightBulbNode, new Rectangle( 0, 0, 10, 10 ), tandem, options ); - // Suppress the highlight for the socket, the highlight is shown by the CCKLightBulbNode + // Suppress the highlight for the socket, the highlight is shown by the CircuitConstructionKitLightBulbNode if ( this.highlightNode ) { this.highlightNode.stroke = null; } @@ -68,7 +68,7 @@ define( function( require ) { var angle = endPosition.minus( startPosition ).angle() + Math.PI / 4; // Update the node transform in a single step, see #66 - CCKUtil.setToTranslationRotation( SCRATCH_MATRIX, startPosition, angle ); + CircuitConstructionKitCommonUtil.setToTranslationRotation( SCRATCH_MATRIX, startPosition, angle ); this.contentNode.setMatrix( SCRATCH_MATRIX ); }, diff --git a/js/view/ResistorNode.js b/js/view/ResistorNode.js index 30defdec..132a6d80 100644 --- a/js/view/ResistorNode.js +++ b/js/view/ResistorNode.js @@ -51,7 +51,7 @@ define( function( require ) { var SCHEMATIC_WAVELENGTH = 54 * SCHEMATIC_SCALE; /** - * @param {CCKScreenView} circuitConstructionKitScreenView + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView * @param {CircuitLayerNode} [circuitLayerNode] optional, null for icons * @param {Resistor} resistor * @param {Property.} showResultsProperty - not used here but appears in signature to keep same signature as other CircuitElementNode subclasses. diff --git a/js/view/SensorToolbox.js b/js/view/SensorToolbox.js index 89b166d0..799cb893 100644 --- a/js/view/SensorToolbox.js +++ b/js/view/SensorToolbox.js @@ -10,7 +10,7 @@ define( function( require ) { // modules var inherit = require( 'PHET_CORE/inherit' ); var circuitConstructionKitCommon = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/circuitConstructionKitCommon' ); - var CCKPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKPanel' ); + var CircuitConstructionKitPanel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitPanel' ); var CircuitElementToolNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitElementToolNode' ); var HBox = require( 'SCENERY/nodes/HBox' ); var VBox = require( 'SCENERY/nodes/VBox' ); @@ -130,7 +130,7 @@ define( function( require ) { ] } ); - CCKPanel.call( this, alignGroup.createBox( new HBox( { + CircuitConstructionKitPanel.call( this, alignGroup.createBox( new HBox( { spacing: showSeriesAmmeters ? 20 : 40, align: 'bottom', children: [ voltmeterToolIcon, ammeterToolIcon ] @@ -141,5 +141,5 @@ define( function( require ) { circuitConstructionKitCommon.register( 'SensorToolbox', SensorToolbox ); - return inherit( CCKPanel, SensorToolbox ); + return inherit( CircuitConstructionKitPanel, SensorToolbox ); } ); \ No newline at end of file diff --git a/js/view/SeriesAmmeterNode.js b/js/view/SeriesAmmeterNode.js index 98a6dd48..1f9d9034 100644 --- a/js/view/SeriesAmmeterNode.js +++ b/js/view/SeriesAmmeterNode.js @@ -19,7 +19,7 @@ define( function( require ) { var Text = require( 'SCENERY/nodes/Text' ); var Panel = require( 'SUN/Panel' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); - var CCKUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKUtil' ); + var CircuitConstructionKitCommonUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitCommonUtil' ); // strings var currentString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_COMMON/current' ); @@ -32,7 +32,7 @@ define( function( require ) { var WIDEST_LABEL = '99.99 A'; /** - * @param {CCKScreenView} circuitConstructionKitScreenView + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView * @param {CircuitLayerNode} circuitLayerNode * @param {SeriesAmmeter} seriesAmmeter * @param {Property.} showResultsProperty - supplied for consistency with other CircuitElementNode constructors @@ -64,7 +64,7 @@ define( function( require ) { // The ammeter doesn't indicate direction current = Math.abs( current ); - var currentText = ( current < 1E-10 ) ? '' : CCKUtil.createMeasurementReadout( ampereUnitsString, 'ampere', current, 3 ); + var currentText = ( current < 1E-10 ) ? '' : CircuitConstructionKitCommonUtil.createMeasurementReadout( ampereUnitsString, 'ampere', current, 3 ); readoutText.setText( currentText ); // Center the text in the panel diff --git a/js/view/SwitchNode.js b/js/view/SwitchNode.js index f952a76b..991417ca 100644 --- a/js/view/SwitchNode.js +++ b/js/view/SwitchNode.js @@ -28,7 +28,7 @@ define( function( require ) { var SWITCH_END = CircuitConstructionKitConstants.SWITCH_END; /** - * @param {CCKScreenView} circuitConstructionKitScreenView + * @param {CircuitConstructionKitScreenView} circuitConstructionKitScreenView * @param {CircuitLayerNode} circuitLayerNode * @param {Switch} circuitSwitch * @param {Property.} showResultsProperty - supplied for consistency with other CircuitElementNode constructors diff --git a/js/view/SwitchReadoutNode.js b/js/view/SwitchReadoutNode.js index 91cbd024..c17db10e 100644 --- a/js/view/SwitchReadoutNode.js +++ b/js/view/SwitchReadoutNode.js @@ -13,7 +13,7 @@ define( function( require ) { var inherit = require( 'PHET_CORE/inherit' ); var Node = require( 'SCENERY/nodes/Node' ); var Text = require( 'SCENERY/nodes/Text' ); - var CCKTrashButton = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKTrashButton' ); + var TrashButton = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/TrashButton' ); // strings var theSwitchIsOpenString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_COMMON/theSwitchIsOpen' ); @@ -49,7 +49,7 @@ define( function( require ) { circuitSwitch.closedProperty.link( closedListener ); // Show a trash button to the right of the text - var trashButton = new CCKTrashButton( circuit, circuitSwitch, tandem.createTandem( 'trashButton' ) ).mutate( { + var trashButton = new TrashButton( circuit, circuitSwitch, tandem.createTandem( 'trashButton' ) ).mutate( { left: maxWidth + 10, centerY: closedText.centerY } ); diff --git a/js/view/CCKTrashButton.js b/js/view/TrashButton.js similarity index 87% rename from js/view/CCKTrashButton.js rename to js/view/TrashButton.js index c245f251..c236a340 100644 --- a/js/view/CCKTrashButton.js +++ b/js/view/TrashButton.js @@ -22,7 +22,7 @@ define( function( require ) { * @param {Tandem} tandem * @constructor */ - function CCKTrashButton( circuit, circuitElement, tandem ) { + function TrashButton( circuit, circuitElement, tandem ) { RoundPushButton.call( this, { baseColor: PhetColorScheme.PHET_LOGO_YELLOW, @@ -38,7 +38,7 @@ define( function( require ) { } ); } - circuitConstructionKitCommon.register( 'CCKTrashButton', CCKTrashButton ); + circuitConstructionKitCommon.register( 'TrashButton', TrashButton ); - return inherit( RoundPushButton, CCKTrashButton ); + return inherit( RoundPushButton, TrashButton ); } ); \ No newline at end of file diff --git a/js/view/VoltmeterNode.js b/js/view/VoltmeterNode.js index b190cb21..c8743b9f 100644 --- a/js/view/VoltmeterNode.js +++ b/js/view/VoltmeterNode.js @@ -19,7 +19,7 @@ define( function( require ) { var Vector2 = require( 'DOT/Vector2' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); var BooleanProperty = require( 'AXON/BooleanProperty' ); - var CCKUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKUtil' ); + var CircuitConstructionKitCommonUtil = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitCommonUtil' ); var MovableDragHandler = require( 'SCENERY_PHET/input/MovableDragHandler' ); // images @@ -78,7 +78,7 @@ define( function( require ) { // Displays the voltage reading var voltageReadoutProperty = new DerivedProperty( [ voltmeter.voltageProperty ], function( voltage ) { - return voltage === null ? questionMarkString : CCKUtil.createMeasurementReadout( voltageUnitsString, 'voltage', voltage, 2 ); + return voltage === null ? questionMarkString : CircuitConstructionKitCommonUtil.createMeasurementReadout( voltageUnitsString, 'voltage', voltage, 2 ); } ); var probeTextNode = new ProbeTextNode( voltageReadoutProperty, options.showResultsProperty, voltageString, tandem.createTandem( 'probeTextNode' ), { diff --git a/js/view/WireResistivityControl.js b/js/view/WireResistivityControl.js index f69d2966..1f7f9cff 100644 --- a/js/view/WireResistivityControl.js +++ b/js/view/WireResistivityControl.js @@ -14,7 +14,7 @@ define( function( require ) { var Text = require( 'SCENERY/nodes/Text' ); var HSlider = require( 'SUN/HSlider' ); var CircuitConstructionKitConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CircuitConstructionKitConstants' ); - var CCKAccordionBox = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKAccordionBox' ); + var CircuitConstructionKitAccordionBox = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitConstructionKitAccordionBox' ); // strings var tinyString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_COMMON/tiny' ); @@ -52,10 +52,10 @@ define( function( require ) { slider.addMajorTick( 0, createLabel( true ) ); slider.addMajorTick( max, createLabel( false ) ); - CCKAccordionBox.call( this, alignGroup.createBox( slider ), wireResistivityString, tandem ); + CircuitConstructionKitAccordionBox.call( this, alignGroup.createBox( slider ), wireResistivityString, tandem ); } circuitConstructionKitCommon.register( 'WireResistivityControl', WireResistivityControl ); - return inherit( CCKAccordionBox, WireResistivityControl ); + return inherit( CircuitConstructionKitAccordionBox, WireResistivityControl ); } );