Skip to content

Commit 5bc8301

Browse files
Converted exisiting and added new API annotations for librray methods in JSDoc format.
1 parent d61c8a1 commit 5bc8301

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4173
-4246
lines changed

src.primitives/Controls/FamDiagram/configs/BackgroundAnnotationConfig.js

Lines changed: 93 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -9,119 +9,97 @@
99
<primitives.famdiagram.Config.annotations>
1010
*/
1111
primitives.famdiagram.BackgroundAnnotationConfig = function (arg0) {
12-
var property;
13-
14-
/*
15-
Property: annotationType
16-
Annotation type. All various annotations are defined in annotation collection property of <primitives.famdiagram.Config>.
17-
So this property is needed to define annotation type when we use JavaScript non-prototype objects.
18-
See other annotations as well.
19-
20-
Default:
21-
<primitives.common.AnnotationType.Background>
22-
23-
See Also:
24-
<primitives.famdiagram.Config.annotations>
25-
<primitives.famdiagram.ConnectorAnnotationConfig>
26-
<primitives.famdiagram.ShapeAnnotationConfig>
27-
<primitives.famdiagram.LabelAnnotationConfig>
28-
<primitives.famdiagram.HighlightPathAnnotationConfig>
29-
*/
30-
this.annotationType = primitives.common.AnnotationType.Background;
31-
32-
/*
33-
Property: items
34-
Array of items ids in hierarchy.
35-
See Also:
36-
<primitives.orgdiagram.ItemConfig.id>
37-
*/
38-
this.items = [];
39-
40-
/*
41-
Property: zOrderType
42-
Defines annotation Z order placement relative to chart items. Chart items are drawn in layers on top of each other. We can draw annotations under the items or over them.
43-
If you place annotations over items then you block mouse events of UI elements in them. Browsers don't support mouse events transparentcy consistently.
44-
So in order to avoid mouse events blocking of UI elements in item templates you have to place annotation items under them.
45-
Take into account that chart default buttons are drawn on top of everyhting, so they are never blocked by annotations drawn over items.
46-
47-
Default:
48-
<primitives.common.ZOrderType.Auto>
49-
*/
50-
this.zOrderType = primitives.common.ZOrderType.Auto;
51-
52-
53-
/*
54-
Property: offset
55-
Sets background offset around annotated item.
56-
See also:
57-
<primitives.common.Thickness>
58-
*/
59-
this.offset = new primitives.common.Thickness(18, 18, 18, 18);
60-
61-
/*
62-
Property: lineWidth
63-
Border line width.
64-
*/
65-
this.lineWidth = 2;
66-
67-
/*
68-
Property: opacity
69-
Background color opacity. For applicable shapes only.
70-
*/
71-
this.opacity = 1;
72-
73-
/*
74-
Property: borderColor
75-
Shape border line color.
76-
77-
Default:
78-
null
79-
*/
80-
this.borderColor = null;
81-
82-
/*
83-
Property: fillColor
84-
Fill Color.
85-
86-
Default:
87-
null
88-
*/
89-
this.fillColor = null;
90-
91-
/*
92-
Property: lineType
93-
Connector's line pattern.
94-
95-
Default:
96-
<primitives.common.LineType.Solid>
97-
*/
98-
this.lineType = primitives.common.LineType.Solid;
99-
100-
/*
101-
Property: selectItems
102-
Always show annotated items in normal state. Setting this option is equivalent to adding annotated items to collection of selected items.
103-
104-
Default:
105-
true
106-
107-
See Also:
108-
<primitives.famdiagram.Config.selectedItems>
109-
*/
110-
this.selectItems = false;
111-
112-
switch (arguments.length) {
113-
case 1:
114-
if (arg0 !== null) {
115-
if (arg0 instanceof Array) {
116-
this.items = arg0;
117-
} else if (typeof arg0 == "object") {
118-
for (property in arg0) {
119-
if (arg0.hasOwnProperty(property)) {
120-
this[property] = arg0[property];
121-
}
122-
}
123-
}
124-
}
125-
break;
126-
}
12+
var property;
13+
14+
/**
15+
* Annotation type. All types of annotations objects are added to `annotations` collection property of the control.
16+
* This property is needed to distiguish them when they are defined as JSON objects.
17+
*
18+
* @type {AnnotationType}
19+
*/
20+
this.annotationType = primitives.common.AnnotationType.Background;
21+
22+
/**
23+
* Collection of nodes ids this background annotation is drawn for.
24+
*
25+
* @type {string[]}
26+
*/
27+
this.items = [];
28+
29+
/**
30+
* Sets annotation Z order placement relative to the diagram items. Diagram visual elements are drawn in layers on top of each other.
31+
* If you place annotations over diagram nodes then you block mouse events of UI elements in their templates.
32+
* Browsers don't support mouse events transparentcy consistently yet. So in order to avoid mouse events blocking of UI elements in item
33+
* templates you have to place annotation items under them or explisitly define maximum zindex for controls and make them rendered on top
34+
* of other visual elements. The control takes this into account and renders buttons panel on top of everyhting,
35+
* so they are never blocked by annotations drawn in front of diagram nodes.
36+
*
37+
* @type {ZOrderType}
38+
*/
39+
this.zOrderType = primitives.common.ZOrderType.Auto;
40+
41+
42+
/**
43+
* Sets background offset around annotated items.
44+
*
45+
* @type {Thickness}
46+
*/
47+
this.offset = new primitives.common.Thickness(18, 18, 18, 18);
48+
49+
/**
50+
* Border line width
51+
*
52+
* @type {number}
53+
*/
54+
this.lineWidth = 2;
55+
56+
/**
57+
* Background color opacity.
58+
*
59+
* @type {number}
60+
*/
61+
this.opacity = 1;
62+
63+
/**
64+
* Shape border line color
65+
*
66+
* @type {string}
67+
*/
68+
this.borderColor = null;
69+
70+
/**
71+
* Fill Color.
72+
*
73+
* @type {string}
74+
*/
75+
this.fillColor = null;
76+
77+
/**
78+
* Border line type
79+
*
80+
* @type {LineType}
81+
*/
82+
this.lineType = primitives.common.LineType.Solid;
83+
84+
/**
85+
* If true then annotated nodes are shown full size regardless of controls autofit mode and available screen space.
86+
* @type {boolean}
87+
*/
88+
this.selectItems = false;
89+
90+
switch (arguments.length) {
91+
case 1:
92+
if (arg0 !== null) {
93+
if (arg0 instanceof Array) {
94+
this.items = arg0;
95+
} else if (typeof arg0 == "object") {
96+
for (property in arg0) {
97+
if (arg0.hasOwnProperty(property)) {
98+
this[property] = arg0[property];
99+
}
100+
}
101+
}
102+
}
103+
break;
104+
}
127105
};
Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,58 @@
1-
/*
2-
Class: primitives.famdiagram.ButtonConfig
3-
Options class. Custom user button options class.
4-
Buttons displayed on the right side of items.
5-
See jQuery UI Button options description for details.
6-
In order to receive button click event make binding
7-
to <primitives.famdiagram.Config.onButtonClick>.
8-
9-
See Also:
10-
<primitives.famdiagram.Config.buttons>
11-
*/
1+
/**
2+
* @class ButtonConfig
3+
* @classdesc The buttons panel on the side of the diagram nodes is one of controls default easy to use features.
4+
* This gives you the possibility to try and see how context buttons work being placed inside of diagram layout.
5+
* This object provides configuration properties for buttons rendered using HTML buttons elements.
6+
*
7+
* Please, pay attention that diagram visual element are rendered in layers on top of each other, so buttons panel
8+
* is rendered as the very last layer of the diagram, so its mouse events are never blocked by any other visual elements.
9+
*
10+
* See `onButtonClick` event handler in control's configuration object.
11+
*
12+
* @param {string} name Name
13+
* @param {string} icon Icon
14+
* @param {string} tooltip Tooltip
15+
*/
1216
primitives.famdiagram.ButtonConfig = function (name, icon, tooltip) {
13-
/*
14-
Property: name
15-
It should be unique string name of the button.
16-
It is needed to distinguish click events from different butons.
17-
*/
18-
this.name = name;
17+
/**
18+
* Button name. It is needed for `onButtonClick` event handler.
19+
*
20+
* @type {string}
21+
*/
22+
this.name = name;
1923

20-
/*
21-
Property: icon
22-
Name of icon used in jQuery UI.
23-
*/
24-
this.icon = icon;
25-
/*
26-
Property: text
27-
Whether to show any text -when set to false (display no text),
28-
icon must be enabled, otherwise it'll be ignored.
29-
*/
30-
this.text = false;
31-
/*
32-
Property: label
33-
Text to show on the button.
34-
*/
35-
this.label = null;
36-
/*
37-
Property: tooltip
38-
Button tooltip content. Tooltip is based on jQuery UI tooltip widget, so it should be part of jQuery UI distribution in order to make this property work.
39-
*/
40-
this.tooltip = tooltip;
41-
/*
42-
Property: size
43-
Size of the button of type <primitives.common.Size>.
44-
*/
45-
this.size = new primitives.common.Size(16, 16);
24+
/**
25+
* Name of icon used in jQuery UI.
26+
*
27+
* @type {string}
28+
*/
29+
this.icon = icon;
30+
31+
/**
32+
* If true show button text
33+
* @type {boolean}
34+
*/
35+
this.text = false;
36+
37+
/**
38+
* Text to show on the button.
39+
*
40+
* @type {string}
41+
*/
42+
this.label = null;
43+
44+
/**
45+
* Button tooltip content. Tooltip is rendered using jQuery UI tooltip widget, so it should be part of jQuery UI distribution
46+
* in order to make this property work.
47+
*
48+
* @type {string}
49+
*/
50+
this.tooltip = tooltip;
51+
52+
/**
53+
* Button size
54+
*
55+
* @type {Size}
56+
*/
57+
this.size = new primitives.common.Size(16, 16);
4658
};

0 commit comments

Comments
 (0)