Skip to content

Commit

Permalink
Canvas lib JSDoc cleanup
Browse files Browse the repository at this point in the history
Enyo-DCO-1.1-Signed-Off-By: Jim Tang (jim.tang@lge.com)
  • Loading branch information
Jim Tang committed Aug 20, 2014
1 parent fa3aaf8 commit 032dcb1
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 53 deletions.
28 changes: 16 additions & 12 deletions Canvas.js
@@ -1,11 +1,11 @@
(function (enyo, scope) {

/**
* _enyo.Canvas_ is a control that generates a <canvas> HTML tag. It may
* contain other canvas components derived not from {@link enyo.Control},
* but from {@link enyo.canvas.Control}. These components are not
* true controls in the sense of being DOM elements; they are, instead, shapes
* drawn into the canvas.
* {@link enyo.Canvas} is a control that generates a <canvas> HTML tag.
* It may contain other canvas components derived not from {@link enyo.Control},
* but from {@link enyo.canvas.Control}. These components are not true controls
* in the sense of being DOM elements; they are, instead, shapes drawn into the
* canvas.
*
* @ui
* @class enyo.Canvas
Expand All @@ -31,7 +31,7 @@
tag: 'canvas',

/**
* Hash containing the default height (500) and width (500) for the canvas
* Hash containing the default height `(500)` and width `(500)` for the canvas.
*
* @see {@link enyo.Control#attributes}
* @public
Expand All @@ -49,7 +49,7 @@
defaultKind: 'enyo.canvas.Control',

/**
* Canvas tags do not have any content
* Canvas tags do not have any content.
*
* @private
*/
Expand All @@ -71,8 +71,10 @@
},

/*
* addChild and removeChild of Control kind assumes children are Controls.
* CanvasControls are not, so we use UiComponent's version, the superkind of Control
* The `addChild()` method of {@link enyo.Control} assumes that the child
* being added is an instance of `enyo.Control`. Because CanvasControls are
* not instances of `enyo.Control`, we instead call the `addChild()` method
* on {@link enyo.UiComponent}, the superkind of `enyo.Control`.
*
* @private
*/
Expand All @@ -81,8 +83,10 @@
},

/*
* addChild and removeChild of Control kind assumes children are Controls.
* CanvasControls are not, so we use UiComponent's version, the superkind of Control
* The `removeChild()` method of {@link enyo.Control} assumes that the child
* being removed is an instance of `enyo.Control`. Because CanvasControls are
* not instances of `enyo.Control`, we instead call the `removeChild()` method
* on {@link enyo.UiComponent}, the superkind of `enyo.Control`.
*
* @private
*/
Expand All @@ -91,7 +95,7 @@
},

/**
* Iterates over its children and renders each onto the canvas
* Iterates over the canvas's children, rendering each onto the canvas.
*
* @private
*/
Expand Down
10 changes: 5 additions & 5 deletions CanvasControl.js
Expand Up @@ -4,20 +4,20 @@
* Fires when this control is to be rendered.
*
* @event enyo.canvas.Control#event:onRender
* @param {Context} context - Active canvas context.
* @param {Context} context - The active canvas context.
* @public
*/

/**
* _enyo.canvas.Control_ is the base kind for items that live inside an
* {@link enyo.canvas.Control} is the base kind for items that live inside an
* {@link enyo.Canvas} control.
*
* If you're using this kind directly, you may implement an _onRender_ event
* If you're using this kind directly, you may implement an `onRender` event
* handler in the owner to handle drawing into the canvas.
*
* If you're deriving a new kind based on this one, override the
* `[renderSelf()]{@link enyo.canvas.Control#renderSelf}` method and use that for your
* drawing code.
* [renderSelf()]{@link enyo.canvas.Control#renderSelf} method and use that for
* your drawing code.
*
*
* @class enyo.canvas.Control
Expand Down
5 changes: 3 additions & 2 deletions Circle.js
@@ -1,8 +1,9 @@
(function (enyo, scope) {

/**
* _enyo.canvas.Circle_ is a canvas control that draws a circle fitting the
* parameters specified by {@link enyo.canvas.Control#bounds}.
* {@link enyo.canvas.Circle} is a canvas control that draws a circle fitting
* the parameters specified by the [bounds]{@link enyo.canvas.Control#bounds}
* property on {@link enyo.canvas.Control}.
*
* @class enyo.canvas.Circle
* @extends enyo.canvas.Shape
Expand Down
7 changes: 4 additions & 3 deletions Image.js
@@ -1,8 +1,9 @@
(function (enyo, scope) {

/**
* _enyo.canvas.Image_ is a canvas control that draws an image, stretched to
* fit the rectangle specified by {@link enyo.canvas.Control#bounds}.
* {@link enyo.canvas.Image} is a canvas control that draws an image, stretched
* to fit the rectangle specified by the [bounds]{@link enyo.canvas.Image#bounds}
* property.
*
* @class enyo.canvas.Image
* @extends enyo.canvas.Control
Expand All @@ -27,7 +28,7 @@
*/
published: {
/**
* Source URL for the image
* Source URL for the image.
*
* @type {String}
* @default ''
Expand Down
31 changes: 18 additions & 13 deletions Line.js
@@ -1,22 +1,27 @@
(function (enyo, scope) {

/**
* Bounds hash for {@link enyo.canvas.Line#bounds}
* Used to set parameters for drawing a line.
*
* @typedef {enyo.canvas.Line~Bounds}
* @type {Object}
* @property {String} Style - Stroke style
* @property {Number} width - Line width
* @property {String} cap - Line cap
* @property {Number} start_x - X coordinate of start of line
* @property {Number} start_y - Y coordinate of start of line
* @property {Number} finish_x - X coordinate of finish of line
* @property {Number} finish_y - Y coordinate of finish of line
* @typedef {Object} enyo.canvas.Line~Bounds
* @property {String} Style - Stroke style.
* @property {Number} width - Line width.
* @property {String} cap - Line cap.
* @property {Number} start_x - x-coordinate of start of line.
* @property {Number} start_y - y-coordinate of start of line.
* @property {Number} finish_x - x-coordinate of finish of line.
* @property {Number} finish_y - y-coordinate of finish of line.
* @public
*/

/**
* _enyo.canvas.Line_ is a canvas control that draws a line according to the
* parameters specified by {@link enyo.canvas.Line#bounds}.
* {@link enyo.canvas.Line} is a canvas control that draws a line according to
* the parameters specified by the [bounds]{@link enyo.canvas.Line#bounds}
* property.
*
* @class enyo.canvas.Line
* @extends enyo.canvas.Shape
* @public
*/
enyo.kind(
/** @lends enyo.canvas.Line.prototype */ {
Expand All @@ -37,7 +42,7 @@
*/
published: {
/**
* Bounds of line
* Bounds of the line.
*
* @type {enyo.canvas.Line~Bounds}
* @default null
Expand Down
7 changes: 4 additions & 3 deletions Rectangle.js
@@ -1,8 +1,9 @@
(function (enyo, scope) {

/**
* _enyo.canvas.Rectangle_ is a canvas control that draws a rectangle fitting
* the parameters specified by {@link enyo.canvas.Control#bounds}.
* {@link enyo.canvas.Rectangle} is a canvas control that draws a rectangle
* fitting the parameters specified by the [bounds]{@link enyo.canvas.Control#bounds}
* property.
*
* @class enyo.canvas.Rectangle
* @extends enyo.canvas.Shape
Expand All @@ -27,7 +28,7 @@
*/
published: {
/**
* if true, clear the area of the rectangle instead of drawing it
* If `true`, clears the area of the rectangle instead of drawing it.
*
* @type {Boolean}
* @default false
Expand Down
23 changes: 12 additions & 11 deletions Shape.js
@@ -1,15 +1,15 @@
(function (enyo, scope) {

/**
* _enyo.canvas.Shape_ is the base kind for shapes that can be drawn into the
* {@link enyo.canvas.Shape} is the base kind for shapes that can be drawn into the
* canvas. It doesn't have a default rendering, but an event handler may call its
* `[draw()]{@link enyo.canvas.Shape#draw}` method.
* [draw()]{@link enyo.canvas.Shape#draw} method.
*
* Kinds derived from this one should provide their own implementation of
* `[renderSelf()]{@link enyo.canvas.Control#renderSelf}`. If more complex operations
* [renderSelf()]{@link enyo.canvas.Control#renderSelf}. If more complex operations
* are needed for filled mode or outline mode, override the
* `[fill()]{@link enyo.canvas.Shape#fill}` method or the
* `[outline()]{@link enyo.canvas.Shape#outline}` method, respectively.
* [fill()]{@link enyo.canvas.Shape#fill} method or the
* [outline()]{@link enyo.canvas.Shape#outline} method, respectively.
*
* @class enyo.canvas.Shape
* @extends enyo.canvas.Control
Expand All @@ -34,7 +34,7 @@
*/
published: {
/**
* Color used to draw the interior of the shape
* Color used to draw the interior of the shape.
*
* @type {String}
* @default 'red'
Expand All @@ -43,7 +43,7 @@
color: 'red',

/**
* Color used to draw the outline of the shape
* Color used to draw the outline of the shape.
*
* @type {String}
* @default ''
Expand All @@ -67,11 +67,12 @@
},

/**
* Draws the shape by invoking its `fill()` or `outline()` method. Usually
* invoked by the derived shape's `renderSelf()` method in response to the
* rendering of the canvas control's parent.
* Draws the shape by invoking its [fill()]{@link enyo.canvas.Shape#fill} or
* [outline()]{@link enyo.canvas.Shape#outline} method. Usually
* invoked by the derived shape's [renderSelf()]{@link enyo.canvas.Shape#renderSelf}
* method in response to the rendering of the canvas control's parent.
*
* @param {Context} context - Canvas context
* @param {Context} context - The canvas context.
* @public
*/
draw: function (context) {
Expand Down
8 changes: 4 additions & 4 deletions Text.js
@@ -1,7 +1,7 @@
(function (enyo, scope) {

/**
* _enyo.canvas.Text_ is a canvas control that draws a text string.
* {@link enyo.canvas.Text} is a canvas control that draws a text string.
*
* @class enyo.canvas.Text
* @extends enyo.canvas.Shape
Expand All @@ -26,7 +26,7 @@
*/
published: {
/**
* The text to draw
* The text to draw.
*
* @type {String}
* @default ''
Expand All @@ -35,7 +35,7 @@
text: '',

/**
* CSS font specification used to select a font for drawing
* CSS font specification used to select a font for drawing.
*
* @type {String}
* @default '12pt Arial'
Expand All @@ -45,7 +45,7 @@

/**
* Text alignment within the rectangle specified by the
* {@link enyo.canvas.Control#bounds} property
* [bounds]{@link enyo.canvas.Control#bounds} property.
*
* @type {String}
* @default 'left'
Expand Down

0 comments on commit 032dcb1

Please sign in to comment.