From 8e3b2a9f8edf6aed3f8cd46f602c943f417ef4b6 Mon Sep 17 00:00:00 2001 From: Martin Veillette Date: Thu, 29 Jul 2021 10:45:55 -0400 Subject: [PATCH] add documentation to methods (#129) --- js/common/model/Optic.js | 2 ++ js/common/model/Ray.js | 2 ++ js/common/model/Ruler.js | 2 ++ js/common/model/SourceObject.js | 4 ++-- js/common/view/GeometricOpticsRulerNode.js | 3 +++ js/common/view/GeometricOpticsRulersLayer.js | 1 + js/common/view/GeometricOpticsScreenView.js | 1 + js/common/view/SourceObjectNode.js | 1 + 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/js/common/model/Optic.js b/js/common/model/Optic.js index 6db98655..c77c8182 100644 --- a/js/common/model/Optic.js +++ b/js/common/model/Optic.js @@ -462,6 +462,8 @@ class Optic { } /** + * get the bounds of the optically "active" component + * In practice, it means that we exclude the backing (fill) of the mirror * @public * @returns {Bounds2} */ diff --git a/js/common/model/Ray.js b/js/common/model/Ray.js index 2cc06eeb..529bbad9 100644 --- a/js/common/model/Ray.js +++ b/js/common/model/Ray.js @@ -29,10 +29,12 @@ class Ray extends Ray2 { assert && assert( typeof options.length === 'number' ); + // @public {number} this.length = options.length; } /** + * Set the length of the ray * @public * @param {number} length */ diff --git a/js/common/model/Ruler.js b/js/common/model/Ruler.js index 87213eaa..77e8dbe5 100644 --- a/js/common/model/Ruler.js +++ b/js/common/model/Ruler.js @@ -55,6 +55,7 @@ class Ruler { } /** + * is the ruler horizontal * @public * @returns {boolean} */ @@ -63,6 +64,7 @@ class Ruler { } /** + * is the ruler vertical * @public * @returns {boolean} */ diff --git a/js/common/model/SourceObject.js b/js/common/model/SourceObject.js index e7fc4434..0c37667b 100644 --- a/js/common/model/SourceObject.js +++ b/js/common/model/SourceObject.js @@ -84,10 +84,10 @@ class SourceObject { const scale = representation.isObject ? OBJECT_SCALE_FACTOR : SOURCE_SCALE_FACTOR; - // update the value of the offset + // {Vector2} update the value of the offset this.offsetPosition = representation.offsetPosition.dividedScalar( scale ); - // update the left top position - the firstPosition is the ground truth when changing representation + // {Vector2} update the left top position - the firstPosition is the ground truth when changing representation this.leftTopProperty.value = this.firstPositionProperty.value.plus( this.offsetPosition ); } ); diff --git a/js/common/view/GeometricOpticsRulerNode.js b/js/common/view/GeometricOpticsRulerNode.js index 1eb4e3bf..8752b099 100644 --- a/js/common/view/GeometricOpticsRulerNode.js +++ b/js/common/view/GeometricOpticsRulerNode.js @@ -162,6 +162,7 @@ class GeometricOpticsRulerNode extends RulerNode { } /** + * dispose of the listeners on this ruler * @public */ dispose() { @@ -170,6 +171,7 @@ class GeometricOpticsRulerNode extends RulerNode { } /** + * set the orientation of the ruler * @public */ setOrientation() { @@ -181,6 +183,7 @@ class GeometricOpticsRulerNode extends RulerNode { } /** + * sets the position of the ruler * @public */ setPosition() { diff --git a/js/common/view/GeometricOpticsRulersLayer.js b/js/common/view/GeometricOpticsRulersLayer.js index 3a3de54e..70b1961f 100644 --- a/js/common/view/GeometricOpticsRulersLayer.js +++ b/js/common/view/GeometricOpticsRulersLayer.js @@ -124,6 +124,7 @@ class GeometricOpticRulersLayer extends Node { } /** + * dispose function for the two ruler orientations * @public */ disposeRulers() { diff --git a/js/common/view/GeometricOpticsScreenView.js b/js/common/view/GeometricOpticsScreenView.js index c1713fa6..f537454d 100644 --- a/js/common/view/GeometricOpticsScreenView.js +++ b/js/common/view/GeometricOpticsScreenView.js @@ -309,6 +309,7 @@ class GeometricOpticsScreenView extends ScreenView { } /** + * time stepper * @public */ step( dt ) { diff --git a/js/common/view/SourceObjectNode.js b/js/common/view/SourceObjectNode.js index 4748cf1b..d327989c 100644 --- a/js/common/view/SourceObjectNode.js +++ b/js/common/view/SourceObjectNode.js @@ -227,6 +227,7 @@ class SourceObjectNode extends Node { } /** + * reset this node * @public */ reset() {