Skip to content

Commit

Permalink
author annotation is coulombs-law-main, tandem moved to options in Ch…
Browse files Browse the repository at this point in the history
…argeNode, positioning option updates, see #63
  • Loading branch information
mbarlow12 committed Sep 21, 2018
1 parent 45b3b4c commit 2e29934
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions js/atomic/view/CoulombsLawAtomicView.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ define( function( require ) {
coulombsLawModel.object1,
this.layoutBounds,
this.modelViewTransform,
tandem.createTandem( 'chargeNode1' ),
{
label: charge1AbbreviatedString,
otherObjectLabel: charge2AbbreviatedString,
Expand All @@ -67,15 +66,15 @@ define( function( require ) {
atomicScale: true,
maxArrowWidth: ARROW_MAX_WIDTH,
pullRangeMultiplier: PULL_RANGE_MULTIPLIER,
forceReadoutDecimalPlaces: 9
forceReadoutDecimalPlaces: 9,
tandem: tandem.createTandem( 'chargeNode1' )
} );

var chargeNode2 = new ChargeNode(
coulombsLawModel,
coulombsLawModel.object2,
this.layoutBounds,
this.modelViewTransform,
tandem.createTandem( 'chargeNode2' ),
{
label: charge2AbbreviatedString,
otherObjectLabel: charge1AbbreviatedString,
Expand All @@ -85,7 +84,8 @@ define( function( require ) {
atomicScale: true,
maxArrowWidth: ARROW_MAX_WIDTH,
pullRangeMultiplier: PULL_RANGE_MULTIPLIER,
forceReadoutDecimalPlaces: 9
forceReadoutDecimalPlaces: 9,
tandem: tandem.createTandem( 'chargeNode2' )
} );

// charge nodes and arrows are added to the bottom of the scene graph so that the ruler will appear above them yet
Expand Down
17 changes: 8 additions & 9 deletions js/common/view/ChargeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

/**
* Scenery node for the charge object. Children include the pusher/pullers, the circular charge, the force arrow, and
* all labels. Most instantiation details are handled in ISLCObjectNode including all property linking and drawing.
// REVIEW: Use Property instead of property in above comment
* all labels. Most instantiation details are handled in ISLCObjectNode including all Property linking and drawing.
*
* @author Jesse Greenberg (PhET Interactive Simulations)
* @author Michael Barlow (PhET Interactive Simulations)
Expand All @@ -17,9 +16,10 @@ define( function( require ) {
var coulombsLaw = require( 'COULOMBS_LAW/coulombsLaw' );
var CoulombsLawColorProfile = require( 'COULOMBS_LAW/common/CoulombsLawColorProfile' );
var inherit = require( 'PHET_CORE/inherit' );
var RangeWithValue = require('DOT/RangeWithValue');
var RadialGradient = require( 'SCENERY/util/RadialGradient' );
var ISLCObjectNode = require('INVERSE_SQUARE_LAW_COMMON/view/ISLCObjectNode');
var RangeWithValue = require('DOT/RangeWithValue');
var RadialGradient = require( 'SCENERY/util/RadialGradient' );
var Tandem = require( 'TANDEM/Tandem' );

// constants
var ISLCConstants = require( 'INVERSE_SQUARE_LAW_COMMON/ISLCConstants' );
Expand All @@ -30,11 +30,10 @@ define( function( require ) {
* @param {Charge} chargeObjectModel
* @param {Bounds2} layoutBounds
* @param {ModelViewTransform2} modelViewTransform
* @param {Tandem} tandem // TODO: move to options // REVIEW: Handle todo
* @param {Object} options
* @constructor
*/
function ChargeNode( model, chargeObjectModel, layoutBounds, modelViewTransform, tandem, options ) {
function ChargeNode( model, chargeObjectModel, layoutBounds, modelViewTransform, options ) {

var forceConstant = ISLCConstants.k;

Expand All @@ -57,7 +56,7 @@ define( function( require ) {
arrowStroke: CoulombsLawColorProfile.forceArrowStrokeProperty,
labelShadowFill: CoulombsLawColorProfile.labelShadowFillProperty,

tandem: tandem.createTandem( 'chargeNode1' )
tandem: Tandem.required
}, options );

// @private
Expand All @@ -77,8 +76,8 @@ define( function( require ) {

// function that determines the current puller image to represent
var pullForceRange = new RangeWithValue( minForce, maxForce );
ISLCObjectNode.call(

ISLCObjectNode.call(
this,
model,
chargeObjectModel,
Expand Down
5 changes: 3 additions & 2 deletions js/coulombs-law-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
/**
* Main entry point for the sim.
*
* @author $AUTHOR$
* @author Michael Barlow (PhET Interactive Simulations)
* @author Jesse Greenberg (PhET Interactive Simulations)
*/
// REVIEW: Update @author
define( function( require ) {
'use strict';

Expand Down
28 changes: 14 additions & 14 deletions js/macro/view/CoulombsLawMacroView.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,34 @@ define( function( require ) {
CoulombsLawCommonView.call( this, coulombsLawModel, SCALE_FACTOR, unitsMicrocoulombsString, MODEL_VIEW_TRANSFORM_SCALE, rulerOptions, tandem );

// charge nodes added in each screen to allow for different decimal precision and arrow height
var chargeNode1 = new ChargeNode(
coulombsLawModel,
coulombsLawModel.object1,
this.layoutBounds,
var chargeNode1 = new ChargeNode(
coulombsLawModel,
coulombsLawModel.object1,
this.layoutBounds,
this.modelViewTransform,
tandem.createTandem( 'chargeNode1' ),
{
label: charge1AbbreviatedString,
otherObjectLabel: charge2AbbreviatedString,
defaultDirection: 'left',
arrowColor: '#66f',
forceArrowHeight: 70,
forceReadoutDecimalPlaces: 3
forceReadoutDecimalPlaces: 3,
tandem: tandem.createTandem( 'chargeNode1' )
} );

var chargeNode2 = new ChargeNode(
coulombsLawModel,
coulombsLawModel.object2,
this.layoutBounds,
var chargeNode2 = new ChargeNode(
coulombsLawModel,
coulombsLawModel.object2,
this.layoutBounds,
this.modelViewTransform,
tandem.createTandem( 'chargeNode2' ),
{
label: charge2AbbreviatedString,
otherObjectLabel: charge1AbbreviatedString,
defaultDirection: 'right',
arrowColor: '#f66',
forceArrowHeight: 120,
forceReadoutDecimalPlaces: 3
forceReadoutDecimalPlaces: 3,
tandem: tandem.createTandem( 'chargeNode2' )
} );

// charge nodes and arrows are added to the bottom of the scene graph so that the ruler will appear above them yet
Expand All @@ -87,13 +87,13 @@ define( function( require ) {
// create a line the length of 1 cm
var legendNodeLineLength = this.modelViewTransform.modelToViewDeltaX( 1E-2 );

var legendNode = new ISLCLegendNode(
var legendNode = new ISLCLegendNode(
legendNodeLineLength, // length of the line
unitsMacroLegendScaleString, // unit string
{
fill: CoulombsLawColorProfile.legendNodeFillProperty,
bottom: this.layoutBounds.maxY - 10,
tandem: tandem.createTandem( 'legendNode' )
tandem: tandem.createTandem( 'legendNode' )
} );

// REVIEW: Pass into options for legendNode.
Expand Down

0 comments on commit 2e29934

Please sign in to comment.