Skip to content

Commit

Permalink
udpate doc/refactor screen summary node and PositionDescriber and sub…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 11, 2019
1 parent f55c962 commit 8663675
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
35 changes: 17 additions & 18 deletions js/gravity-force-lab/view/GravityForceLabScreenSummaryNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,34 +58,33 @@ define( require => {

super();

// subtypes of ForceDescriber initialize the singleton to the appropriate subtype
// @private - describers
this.forceDescriber = forceDescriber;
this.positionDescriber = positionDescriber;
this.massDescriber = massDescriber;

var mainSummaryDescriptionNode = new Node( { tagName: 'p', innerContent: options.mainDescriptionContent } );
var secondSummaryDescriptionNode = new Node( {
tagName: 'p',
innerContent: options.secondaryDescriptionContent
} );

this.simStateNode = new Node( {
tagName: 'ul',
labelTagName: 'p',
labelContent: options.simStateLabel
} );

// @private - Nodes for PDOM content
this.forceVectorsSummaryItem = new Node( { tagName: 'li' } );

// @public - TODO: Why?
this.objectDistanceSummaryItem = new Node( { tagName: 'li' } );
this.massValuesSummaryItem = new Node( { tagName: 'li' } );
this.robotsSummaryItem = new Node( { tagName: 'li' } );

// initialize the list contents
this.updateSimStateList();

this.simStateNode.children = [
const simStateNode = new Node( {
tagName: 'ul',
labelTagName: 'p',
labelContent: options.simStateLabel
} );

var mainSummaryDescriptionNode = new Node( { tagName: 'p', innerContent: options.mainDescriptionContent } );
var secondSummaryDescriptionNode = new Node( {
tagName: 'p',
innerContent: options.secondaryDescriptionContent
} );

simStateNode.children = [
this.forceVectorsSummaryItem,
this.objectDistanceSummaryItem,
this.massValuesSummaryItem,
Expand All @@ -103,10 +102,10 @@ define( require => {
this.children = [
mainSummaryDescriptionNode,
secondSummaryDescriptionNode,
this.simStateNode,
simStateNode,
interactionHintNode ];

Property.multilink( [ model.forceProperty, model.forceValuesProperty ], ( force, showValues ) => {
Property.multilink( [ model.forceProperty, model.forceValuesProperty ], () => {
this.updateForceVectorSummary();
this.updateRobotEffort();
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ define( require => {

class GravityForceLabPositionDescriber extends PositionDescriber {

/**
* @param {GravityForceLabModel} model
* @param {string} object1Label
* @param {string} object2Label
* @param {Object} [options]
*/
constructor( model, object1Label, object2Label, options ) {

options = _.extend( {
Expand All @@ -24,6 +30,7 @@ define( require => {
* @param {number} distance
* @returns {number}
* @protected
* @override
*/
getDistanceIndex( distance ) {
assert && assert( distance > 0, 'Distance between spheres should always be positive.' );
Expand Down

0 comments on commit 8663675

Please sign in to comment.