Skip to content

Commit

Permalink
Expanded abbreviations, see #339
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jun 13, 2017
1 parent eb5cd2e commit a64423b
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 162 deletions.
6 changes: 3 additions & 3 deletions js/CCKUtil.js → js/CircuitConstructionKitCommonUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions js/view/AmmeterNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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' ), {
Expand Down
2 changes: 1 addition & 1 deletion js/view/BatteryNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<boolean>} showResultsProperty - supplied for consistency with other CircuitElementNode constructors
Expand Down
6 changes: 3 additions & 3 deletions js/view/BatteryResistanceControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -94,13 +94,13 @@ 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 );
}

circuitConstructionKitCommon.register( 'BatteryResistanceControl', BatteryResistanceControl );

return inherit( CCKAccordionBox, BatteryResistanceControl );
return inherit( CircuitConstructionKitAccordionBox, BatteryResistanceControl );
} );
89 changes: 0 additions & 89 deletions js/view/CCKIcon.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -46,7 +46,7 @@ define( function( require ) {
} );
}

circuitConstructionKitCommon.register( 'CCKAccordionBox', CCKAccordionBox );
circuitConstructionKitCommon.register( 'CircuitConstructionKitAccordionBox', CircuitConstructionKitAccordionBox );

return inherit( AccordionBox, CCKAccordionBox );
return inherit( AccordionBox, CircuitConstructionKitAccordionBox );
} );
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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' );
Expand Down Expand Up @@ -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.<boolean>} showResultsProperty - true if the sim can display values
Expand All @@ -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 ) {
Expand Down Expand Up @@ -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
Expand All @@ -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 );

Expand All @@ -206,7 +206,7 @@ define( function( require ) {
* @public
*/
dispose: function() {
this.disposeCCKLightBulbNode();
this.disposeCircuitConstructionKitLightBulbNode();
FixedLengthCircuitElementNode.prototype.dispose.call( this );
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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, {} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions js/view/CircuitElementEditContainerPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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() );
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions js/view/CircuitElementEditPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion js/view/CircuitElementNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit a64423b

Please sign in to comment.