Skip to content

Commit

Permalink
duplicate coordinatesVisibleProperty in subclasses, #55
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <[email protected]>
  • Loading branch information
pixelzoom committed Oct 14, 2018
1 parent fe00f7e commit cfeeab0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
24 changes: 8 additions & 16 deletions js/common/view/GQViewProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ define( require => {
options = _.extend( {
equationForm: 'standard', // see GQConstants.EQUATION_FORMS
graphContentsVisible: true,
equationsVisible: GQQueryParameters.checkAll,
coordinatesVisible: true,
equationAccordionBoxExpanded: true,
equationsVisible: GQQueryParameters.checkAll,
tandem: Tandem.required
}, options );

Expand All @@ -43,33 +42,26 @@ define( require => {
phetioDocumentation: 'whether the contents of the graph are visible'
} );

// @public
this.equationsVisibleProperty = new BooleanProperty( options.equationsVisible, {
tandem: options.tandem.createTandem( 'equationsVisibleProperty' ),
phetioDocumentation: 'whether equations are visible on the graphed curves'
} );

// @public
this.coordinatesVisibleProperty = new BooleanProperty( options.coordinatesVisible, {
tandem: options.tandem.createTandem( 'coordinatesVisibleProperty' ),
phetioDocumentation: 'whether coordinates are visible on points and manipulators'
} );

// @public
this.equationAccordionBoxExpandedProperty = new BooleanProperty( options.equationAccordionBoxExpanded, {
tandem: options.tandem.createTandem( 'equationAccordionBoxExpandedProperty' ),
phetioDocumentation: 'whether the equation accordion box is expanded'
} );

// @public
this.equationsVisibleProperty = new BooleanProperty( options.equationsVisible, {
tandem: options.tandem.createTandem( 'equationsVisibleProperty' ),
phetioDocumentation: 'whether equations are visible on graphed curves'
} );
}

/**
* @public
*/
reset() {
this.graphContentsVisibleProperty.reset();
this.equationsVisibleProperty.reset();
this.coordinatesVisibleProperty.reset();
this.equationAccordionBoxExpandedProperty.reset();
this.equationsVisibleProperty.reset();
}
}

Expand Down
10 changes: 8 additions & 2 deletions js/focusanddirectrix/view/FocusAndDirectrixViewProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ define( require => {

options = _.extend( {
equationForm: 'vertex',
coordinatesVisible: GQQueryParameters.checkAll,
tandem: Tandem.required
}, options );

Expand All @@ -51,7 +50,13 @@ define( require => {
// @public whether an interactive point is visible on the quadratic
this.pointOnParabolaVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, {
tandem: options.tandem.createTandem( 'pointOnParabolaVisibleProperty' ),
phetioDocumentation: 'whether the interactive point on the quadratic is visible'
phetioDocumentation: 'whether the manipulator for the point on the parabola is visible'
} );

// @public
this.coordinatesVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, {
tandem: options.tandem.createTandem( 'coordinatesVisibleProperty' ),
phetioDocumentation: 'whether coordinates are visible on manipulators (vertex, focus, point on parabola)'
} );
}

Expand All @@ -65,6 +70,7 @@ define( require => {
this.focusVisibleProperty.reset();
this.directrixVisibleProperty.reset();
this.pointOnParabolaVisibleProperty.reset();
this.coordinatesVisibleProperty.reset();
}
}

Expand Down
11 changes: 9 additions & 2 deletions js/standardform/view/StandardFormViewProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define( require => {
// @public
this.vertexVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, {
tandem: options.tandem.createTandem( 'vertexVisibleProperty' ),
phetioDocumentation: 'whether the vertex point is visible'
phetioDocumentation: 'whether the vertex is visible'
} );

// @public
Expand All @@ -43,7 +43,13 @@ define( require => {
// @public
this.rootsVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, {
tandem: options.tandem.createTandem( 'rootsVisibleProperty' ),
phetioDocumentation: 'whether the real roots of the quadratic are visible'
phetioDocumentation: 'whether the roots of the quadratic are visible'
} );

// @public
this.coordinatesVisibleProperty = new BooleanProperty( true, {
tandem: options.tandem.createTandem( 'coordinatesVisibleProperty' ),
phetioDocumentation: 'whether coordinates are visible on the vertex and roots'
} );
}

Expand All @@ -56,6 +62,7 @@ define( require => {
this.vertexVisibleProperty.reset();
this.axisOfSymmetryVisibleProperty.reset();
this.rootsVisibleProperty.reset();
this.coordinatesVisibleProperty.reset();
}
}

Expand Down
9 changes: 8 additions & 1 deletion js/vertexform/view/VertexFormViewProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ define( require => {
// @public
this.vertexVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, {
tandem: options.tandem.createTandem( 'vertexVisibleProperty' ),
phetioDocumentation: 'whether the vertex manipulator is visible'
phetioDocumentation: 'whether the vertex is visible'
} );

// @public
this.axisOfSymmetryVisibleProperty = new BooleanProperty( GQQueryParameters.checkAll, {
tandem: options.tandem.createTandem( 'axisOfSymmetryVisibleProperty' ),
phetioDocumentation: 'whether the axis of symmetry is visible'
} );

// @public
this.coordinatesVisibleProperty = new BooleanProperty( true, {
tandem: options.tandem.createTandem( 'coordinatesVisibleProperty' ),
phetioDocumentation: 'whether coordinates are visible on the vertex'
} );
}

/**
Expand All @@ -50,6 +56,7 @@ define( require => {
super.reset();
this.vertexVisibleProperty.reset();
this.axisOfSymmetryVisibleProperty.reset();
this.coordinatesVisibleProperty.reset();
}
}

Expand Down

0 comments on commit cfeeab0

Please sign in to comment.