mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
[JSDoc] Add annotations
Bulk-add JSDoc annotations, WTD-1482.
This commit is contained in:
@ -34,6 +34,7 @@ define(
|
||||
* Fixed Position view. It arranges frames according to saved
|
||||
* configuration and provides methods for updating these based on
|
||||
* mouse movement.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param {Scope} $scope the controller's Angular scope
|
||||
*/
|
||||
@ -290,6 +291,7 @@ define(
|
||||
* Get the size of the grid, in pixels. The returned array
|
||||
* is in the form `[x, y]`.
|
||||
* @returns {number[]} the grid size
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
getGridSize: function () {
|
||||
return gridSize;
|
||||
@ -298,6 +300,7 @@ define(
|
||||
* Get an array of elements in this panel; these are
|
||||
* decorated proxies for both selection and display.
|
||||
* @returns {Array} elements in this panel
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
getElements: function () {
|
||||
return elementProxies;
|
||||
@ -306,6 +309,7 @@ define(
|
||||
* Check if the element is currently selected, or (if no
|
||||
* argument is supplied) get the currently selected element.
|
||||
* @returns {boolean} true if selected
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
selected: function (element) {
|
||||
return selection && ((arguments.length > 0) ?
|
||||
@ -314,10 +318,12 @@ define(
|
||||
/**
|
||||
* Set the active user selection in this view.
|
||||
* @param element the element to select
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
select: select,
|
||||
/**
|
||||
* Clear the current user selection.
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
clearSelection: function () {
|
||||
if (selection) {
|
||||
@ -329,6 +335,7 @@ define(
|
||||
/**
|
||||
* Get drag handles.
|
||||
* @returns {Array} drag handles for the current selection
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
handles: function () {
|
||||
return handles;
|
||||
@ -336,6 +343,7 @@ define(
|
||||
/**
|
||||
* Get the handle to handle dragging to reposition an element.
|
||||
* @returns {FixedDragHandle} the drag handle
|
||||
* @memberof platform/features/layout.FixedController#
|
||||
*/
|
||||
moveHandle: function () {
|
||||
return moveHandle;
|
||||
@ -347,3 +355,4 @@ define(
|
||||
return FixedController;
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -33,6 +33,7 @@ define(
|
||||
/**
|
||||
* Template-displayable drag handle for an element in fixed
|
||||
* position mode.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
*/
|
||||
function FixedDragHandle(elementHandle, gridSize, update, commit) {
|
||||
@ -91,22 +92,26 @@ define(
|
||||
/**
|
||||
* Get a CSS style to position this drag handle.
|
||||
* @returns CSS style object (for `ng-style`)
|
||||
* @memberof platform/features/layout.FixedDragHandle#
|
||||
*/
|
||||
style: getStyle,
|
||||
/**
|
||||
* Start a drag gesture. This should be called when a drag
|
||||
* begins to track initial state.
|
||||
* @memberof platform/features/layout.FixedDragHandle#
|
||||
*/
|
||||
startDrag: startDrag,
|
||||
/**
|
||||
* Continue a drag gesture; update x/y positions.
|
||||
* @param {number[]} delta x/y pixel difference since drag
|
||||
* started
|
||||
* @memberof platform/features/layout.FixedDragHandle#
|
||||
*/
|
||||
continueDrag: continueDrag,
|
||||
/**
|
||||
* End a drag gesture. This should be callled when a drag
|
||||
* concludes to trigger commit of changes.
|
||||
* @memberof platform/features/layout.FixedDragHandle#
|
||||
*/
|
||||
endDrag: endDrag
|
||||
};
|
||||
@ -114,4 +119,4 @@ define(
|
||||
|
||||
return FixedDragHandle;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -28,6 +28,7 @@ define(
|
||||
|
||||
/**
|
||||
* Proxy for configuring a fixed position view via the toolbar.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param {Function} addElementCallback callback to invoke when
|
||||
* elements are created
|
||||
@ -41,6 +42,7 @@ define(
|
||||
return {
|
||||
/**
|
||||
* Add a new visual element to this view.
|
||||
* @memberof platform/features/layout.FixedProxy#
|
||||
*/
|
||||
add: function (type) {
|
||||
// Place a configured element into the view configuration
|
||||
@ -64,4 +66,4 @@ define(
|
||||
|
||||
return FixedProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -29,12 +29,15 @@ define(
|
||||
/**
|
||||
* Defines composition policy for Display Layout objects.
|
||||
* They cannot contain folders.
|
||||
* @constructor
|
||||
* @memberof platform/features/layout
|
||||
*/
|
||||
function LayoutCompositionPolicy() {
|
||||
return {
|
||||
/**
|
||||
* Is the type identified by the candidate allowed to
|
||||
* contain the type described by the context?
|
||||
* @memberof platform/features/layout.LayoutCompositionPolicy#
|
||||
*/
|
||||
allow: function (candidate, context) {
|
||||
var isFolderInLayout =
|
||||
@ -50,3 +53,4 @@ define(
|
||||
return LayoutCompositionPolicy;
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -35,6 +35,7 @@ define(
|
||||
* Layout view. It arranges frames according to saved configuration
|
||||
* and provides methods for updating these based on mouse
|
||||
* movement.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param {Scope} $scope the controller's Angular scope
|
||||
*/
|
||||
@ -178,6 +179,7 @@ define(
|
||||
* @param {string} id the object identifier
|
||||
* @returns {Object.<string, string>} an object with
|
||||
* appropriate left, width, etc fields for positioning
|
||||
* @memberof platform/features/layout.LayoutController#
|
||||
*/
|
||||
getFrameStyle: function (id) {
|
||||
// Called in a loop, so just look up; the "positions"
|
||||
@ -203,6 +205,7 @@ define(
|
||||
* in the frame being manipulated
|
||||
* @param {number[]} posFactor the position factor
|
||||
* @param {number[]} dimFactor the dimensions factor
|
||||
* @memberof platform/features/layout.LayoutController#
|
||||
*/
|
||||
startDrag: function (id, posFactor, dimFactor) {
|
||||
activeDragId = id;
|
||||
@ -218,6 +221,7 @@ define(
|
||||
* @param {number[]} delta the offset, in pixels,
|
||||
* of the current pointer position, relative
|
||||
* to its position when the drag started
|
||||
* @memberof platform/features/layout.LayoutController#
|
||||
*/
|
||||
continueDrag: function (delta) {
|
||||
if (activeDrag) {
|
||||
@ -229,6 +233,7 @@ define(
|
||||
/**
|
||||
* End the active drag gesture. This will update the
|
||||
* view configuration.
|
||||
* @memberof platform/features/layout.LayoutController#
|
||||
*/
|
||||
endDrag: function () {
|
||||
// Write to configuration; this is watched and
|
||||
@ -254,3 +259,4 @@ define(
|
||||
return LayoutController;
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -50,6 +50,8 @@ define(
|
||||
* @param {number[]} posFactor the position factor
|
||||
* @param {number[]} dimFactor the dimensions factor
|
||||
* @param {number[]} the size of each grid element, in pixels
|
||||
* @constructor
|
||||
* @memberof platform/features/layout
|
||||
*/
|
||||
function LayoutDrag(rawPosition, posFactor, dimFactor, gridSize) {
|
||||
// Convert a delta from pixel coordinates to grid coordinates,
|
||||
@ -103,6 +105,7 @@ define(
|
||||
* according to the factors supplied in the constructor.
|
||||
* @param {number[]} pixelDelta the offset from the
|
||||
* original position, in pixels
|
||||
* @memberof platform/features/layout.LayoutDrag#
|
||||
*/
|
||||
getAdjustedPosition: getAdjustedPosition
|
||||
};
|
||||
@ -111,4 +114,4 @@ define(
|
||||
return LayoutDrag;
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -38,6 +38,7 @@ define(
|
||||
* in certain ranges; specifically, to keep x/y positions
|
||||
* non-negative in a fixed position view.
|
||||
*
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param {Object} object the object to get/set values upon
|
||||
* @param {string} key the property to get/set
|
||||
@ -56,4 +57,4 @@ define(
|
||||
|
||||
return AccessorMutator;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -34,6 +34,7 @@ define(
|
||||
* Note that arguments here are meant to match those expected
|
||||
* by `Array.prototype.map`
|
||||
*
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the fixed position element, as stored in its
|
||||
* configuration
|
||||
@ -50,6 +51,7 @@ define(
|
||||
* @memberof BoxProxy
|
||||
* @param {string} fill the new fill color
|
||||
* @returns {string} the fill color
|
||||
* @memberof platform/features/layout.BoxProxy#
|
||||
*/
|
||||
proxy.fill = new AccessorMutator(element, 'fill');
|
||||
|
||||
@ -58,4 +60,4 @@ define(
|
||||
|
||||
return BoxProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -85,6 +85,7 @@ define(
|
||||
* The ElementFactory creates new instances of elements for the
|
||||
* fixed position view, prompting for user input where necessary.
|
||||
* @param {DialogService} dialogService service to request user input
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
*/
|
||||
function ElementFactory(dialogService) {
|
||||
@ -94,6 +95,7 @@ define(
|
||||
* @param {string} type the type of element to create
|
||||
* @returns {Promise|object} the created element, or a promise
|
||||
* for that element
|
||||
* @memberof platform/features/layout.ElementFactory#
|
||||
*/
|
||||
createElement: function (type) {
|
||||
var initialState = INITIAL_STATES[type] || {};
|
||||
@ -112,4 +114,4 @@ define(
|
||||
|
||||
return ElementFactory;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -34,4 +34,4 @@ define(
|
||||
"fixed.text": TextProxy
|
||||
};
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -48,6 +48,7 @@ define(
|
||||
* Note that arguments here are meant to match those expected
|
||||
* by `Array.prototype.map`
|
||||
*
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the fixed position element, as stored in its
|
||||
* configuration
|
||||
@ -60,6 +61,7 @@ define(
|
||||
return {
|
||||
/**
|
||||
* The element as stored in the view configuration.
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
element: element,
|
||||
/**
|
||||
@ -67,6 +69,7 @@ define(
|
||||
* Units are in fixed position grid space.
|
||||
* @param {number} [x] the new x position (if setting)
|
||||
* @returns {number} the x position
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
x: new AccessorMutator(element, 'x', clamp),
|
||||
/**
|
||||
@ -74,12 +77,14 @@ define(
|
||||
* Units are in fixed position grid space.
|
||||
* @param {number} [y] the new y position (if setting)
|
||||
* @returns {number} the y position
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
y: new AccessorMutator(element, 'y', clamp),
|
||||
/**
|
||||
* Get and/or set the stroke color of this element.
|
||||
* @param {string} [stroke] the new stroke color (if setting)
|
||||
* @returns {string} the stroke color
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
stroke: new AccessorMutator(element, 'stroke'),
|
||||
/**
|
||||
@ -87,6 +92,7 @@ define(
|
||||
* Units are in fixed position grid space.
|
||||
* @param {number} [w] the new width (if setting)
|
||||
* @returns {number} the width
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
width: new AccessorMutator(element, 'width'),
|
||||
/**
|
||||
@ -94,12 +100,14 @@ define(
|
||||
* Units are in fixed position grid space.
|
||||
* @param {number} [h] the new height (if setting)
|
||||
* @returns {number} the height
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
height: new AccessorMutator(element, 'height'),
|
||||
/**
|
||||
* Change the display order of this element.
|
||||
* @param {string} o where to move this element;
|
||||
* one of "top", "up", "down", or "bottom"
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
order: function (o) {
|
||||
var delta = ORDERS[o] || 0,
|
||||
@ -120,6 +128,7 @@ define(
|
||||
},
|
||||
/**
|
||||
* Remove this element from the fixed position view.
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
remove: function () {
|
||||
if (elements[index] === element) {
|
||||
@ -129,6 +138,7 @@ define(
|
||||
/**
|
||||
* Get handles to control specific features of this element,
|
||||
* e.g. corner size.
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
handles: function () {
|
||||
return handles;
|
||||
@ -138,4 +148,4 @@ define(
|
||||
|
||||
return ElementProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -32,6 +32,7 @@ define(
|
||||
* Note that arguments here are meant to match those expected
|
||||
* by `Array.prototype.map`
|
||||
*
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the fixed position element, as stored in its
|
||||
* configuration
|
||||
@ -45,6 +46,7 @@ define(
|
||||
* Get and/or set the displayed text of this element.
|
||||
* @param {string} [text] the new text (if setting)
|
||||
* @returns {string} the text
|
||||
* @memberof platform/features/layout.ImageProxy#
|
||||
*/
|
||||
proxy.url = new AccessorMutator(element, 'url');
|
||||
|
||||
@ -53,4 +55,4 @@ define(
|
||||
|
||||
return ImageProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -30,6 +30,7 @@ define(
|
||||
* This is used to support drag handles for line elements
|
||||
* in a fixed position view. Field names for opposite ends
|
||||
* are provided to avoid zero-length lines.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the line element
|
||||
* @param {string} xProperty field which stores x position
|
||||
@ -43,6 +44,7 @@ define(
|
||||
* Get/set the x position of the lower-right corner
|
||||
* of the handle-controlled element, changing size
|
||||
* as necessary.
|
||||
* @memberof platform/features/layout.LineHandle#
|
||||
*/
|
||||
x: function (value) {
|
||||
if (arguments.length > 0) {
|
||||
@ -60,6 +62,7 @@ define(
|
||||
* Get/set the y position of the lower-right corner
|
||||
* of the handle-controlled element, changing size
|
||||
* as necessary.
|
||||
* @memberof platform/features/layout.LineHandle#
|
||||
*/
|
||||
y: function (value) {
|
||||
if (arguments.length > 0) {
|
||||
@ -79,4 +82,4 @@ define(
|
||||
return LineHandle;
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -29,6 +29,7 @@ define(
|
||||
/**
|
||||
* Selection/diplay proxy for line elements of a fixed position
|
||||
* view.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the fixed position element, as stored in its
|
||||
* configuration
|
||||
@ -46,6 +47,7 @@ define(
|
||||
* Get the top-left x coordinate, in grid space, of
|
||||
* this line's bounding box.
|
||||
* @returns {number} the x coordinate
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.x = function (v) {
|
||||
var x = Math.min(element.x, element.x2),
|
||||
@ -61,6 +63,7 @@ define(
|
||||
* Get the top-left y coordinate, in grid space, of
|
||||
* this line's bounding box.
|
||||
* @returns {number} the y coordinate
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.y = function (v) {
|
||||
var y = Math.min(element.y, element.y2),
|
||||
@ -76,6 +79,7 @@ define(
|
||||
* Get the width, in grid space, of
|
||||
* this line's bounding box.
|
||||
* @returns {number} the width
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.width = function () {
|
||||
return Math.max(Math.abs(element.x - element.x2), 1);
|
||||
@ -85,6 +89,7 @@ define(
|
||||
* Get the height, in grid space, of
|
||||
* this line's bounding box.
|
||||
* @returns {number} the height
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.height = function () {
|
||||
return Math.max(Math.abs(element.y - element.y2), 1);
|
||||
@ -95,6 +100,7 @@ define(
|
||||
* the top-left corner, of the first point in this line
|
||||
* segment.
|
||||
* @returns {number} the x position of the first point
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.x1 = function () {
|
||||
return element.x - proxy.x();
|
||||
@ -105,6 +111,7 @@ define(
|
||||
* the top-left corner, of the first point in this line
|
||||
* segment.
|
||||
* @returns {number} the y position of the first point
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.y1 = function () {
|
||||
return element.y - proxy.y();
|
||||
@ -115,6 +122,7 @@ define(
|
||||
* the top-left corner, of the second point in this line
|
||||
* segment.
|
||||
* @returns {number} the x position of the second point
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.x2 = function () {
|
||||
return element.x2 - proxy.x();
|
||||
@ -125,6 +133,7 @@ define(
|
||||
* the top-left corner, of the second point in this line
|
||||
* segment.
|
||||
* @returns {number} the y position of the second point
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.y2 = function () {
|
||||
return element.y2 - proxy.y();
|
||||
@ -134,6 +143,7 @@ define(
|
||||
* Get element handles for changing the position of end
|
||||
* points of this line.
|
||||
* @returns {LineHandle[]} line handles for both end points
|
||||
* @memberof platform/features/layout.LineProxy#
|
||||
*/
|
||||
proxy.handles = function () {
|
||||
return handles;
|
||||
@ -144,4 +154,4 @@ define(
|
||||
|
||||
return LineProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -29,6 +29,7 @@ define(
|
||||
* Handle for changing width/height properties of an element.
|
||||
* This is used to support drag handles for different
|
||||
* element types in a fixed position view.
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
*/
|
||||
function ResizeHandle(element, minWidth, minHeight) {
|
||||
@ -41,6 +42,7 @@ define(
|
||||
* Get/set the x position of the lower-right corner
|
||||
* of the handle-controlled element, changing size
|
||||
* as necessary.
|
||||
* @memberof platform/features/layout.ResizeHandle#
|
||||
*/
|
||||
x: function (value) {
|
||||
if (arguments.length > 0) {
|
||||
@ -55,6 +57,7 @@ define(
|
||||
* Get/set the y position of the lower-right corner
|
||||
* of the handle-controlled element, changing size
|
||||
* as necessary.
|
||||
* @memberof platform/features/layout.ResizeHandle#
|
||||
*/
|
||||
y: function (value) {
|
||||
if (arguments.length > 0) {
|
||||
@ -71,4 +74,4 @@ define(
|
||||
return ResizeHandle;
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -35,6 +35,7 @@ define(
|
||||
* Note that arguments here are meant to match those expected
|
||||
* by `Array.prototype.map`
|
||||
*
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the fixed position element, as stored in its
|
||||
* configuration
|
||||
@ -70,4 +71,4 @@ define(
|
||||
|
||||
return TelemetryProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
@ -32,6 +32,7 @@ define(
|
||||
* Note that arguments here are meant to match those expected
|
||||
* by `Array.prototype.map`
|
||||
*
|
||||
* @memberof platform/features/layout
|
||||
* @constructor
|
||||
* @param element the fixed position element, as stored in its
|
||||
* configuration
|
||||
@ -45,6 +46,7 @@ define(
|
||||
* Get and/or set the text color of this element.
|
||||
* @param {string} [color] the new text color (if setting)
|
||||
* @returns {string} the text color
|
||||
* @memberof platform/features/layout.TextProxy#
|
||||
*/
|
||||
proxy.color = new AccessorMutator(element, 'color');
|
||||
|
||||
@ -52,6 +54,7 @@ define(
|
||||
* Get and/or set the displayed text of this element.
|
||||
* @param {string} [text] the new text (if setting)
|
||||
* @returns {string} the text
|
||||
* @memberof platform/features/layout.TextProxy#
|
||||
*/
|
||||
proxy.text = new AccessorMutator(element, 'text');
|
||||
|
||||
@ -60,4 +63,4 @@ define(
|
||||
|
||||
return TextProxy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
Reference in New Issue
Block a user