-
Notifications
You must be signed in to change notification settings - Fork 2
/
mxVmlCanvas2D.d.ts
270 lines (237 loc) · 6.51 KB
/
mxVmlCanvas2D.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/**
* Copyright (c) 2006-2015, JGraph Ltd
* Copyright (c) 2006-2015, Gaudenz Alder
*/
/**
*
* Class: mxVmlCanvas2D
*
* Implements a canvas to be used for rendering VML. Here is an example of implementing a
* fallback for SVG images which are not supported in VML-based browsers.
*
* (code)
* var mxVmlCanvas2DImage = mxVmlCanvas2D.prototype.image;
* mxVmlCanvas2D.prototype.image(x, y, w, h, src, aspect, flipH, flipV)
* {
* if (src.substring(src.length - 4, src.length) == '.svg')
* {
* src = 'http://www.jgraph.com/images/mxgraph.gif';
* }
*
* mxVmlCanvas2DImage.apply(this, arguments);
* };
* (end)
*
* To disable anti-aliasing in the output, use the following code.
*
* (code)
* document.createStyleSheet().cssText = mxClient.VML_PREFIX + '\\:*{antialias:false;)}';
* (end)
*
* A description of the public API is available in <mxXmlCanvas2D>. Note that
* there is a known issue in VML where gradients are painted using the outer
* bounding box of rotated shapes, not the actual bounds of the shape. See
* also <text> for plain text label restrictions in shapes for VML.
*/
declare namespace mxgraph {
export class mxVmlCanvas2D extends mxAbstractCanvas2D {
constructor(root: Element);
/**
* Variable: path
*
* Holds the current DOM node.
*/
node: Element;
/**
* Variable: textEnabled
*
* Specifies if text output should be enabledetB. Default is true.
*/
textEnabled: boolean;
/**
* Variable: moveOp
*
* Contains the string used for moving in paths. Default is 'm'.
*/
moveOp: string;
/**
* Variable: lineOp
*
* Contains the string used for moving in paths. Default is 'l'.
*/
lineOp: string;
/**
* Variable: curveOp
*
* Contains the string used for bezier curves. Default is 'c'.
*/
curveOp: string;
/**
* Variable: closeOp
*
* Holds the operator for closing curves. Default is 'x e'.
*/
closeOp: string;
/**
* Variable: rotatedHtmlBackground
*
* Background color for rotated HTML. Default is ''. This can be set to eg.
* white to improve rendering of rotated text in VML for IE9.
*/
rotatedHtmlBackground: string;
/**
* Variable: vmlScale
*
* Specifies the scale used to draw VML shapes.
*/
vmlScale: number;
/**
* Function: createElement
*
* Creates the given element using the document.
*/
createElement(name: string): HTMLElement;
/**
* Function: createVmlElement
*
* Creates a new element using <createElement> and prefixes the given name with
* <mxClient.VML_PREFIX>.
*/
createVmlElement(name: string): HTMLElement;
/**
* Function: addNode
*
* Adds the current node to the <root>.
*/
addNode(filled: boolean, stroked: boolean): void;
/**
* Function: createTransparentFill
*
* Creates a transparent fill.
*/
createTransparentFill(): HTMLElement;
/**
* Function: createFill
*
* Creates a fill for the current state.
*/
createFill(): HTMLElement;
/**
* Function: createStroke
*
* Creates a fill for the current state.
*/
createStroke(): HTMLElement;
/**
* Function: getVmlDashPattern
*
* Returns a VML dash pattern for the current dashPattern.
* See http://msdn.microsoft.com/en-us/library/bb264085(v=vs.85).aspx
*/
getVmlDashStyle(): string;
/**
* Function: createShadow
*
* Creates a shadow for the given node.
*/
createShadow(node: Element, filled: boolean, stroked: boolean): Element;
/**
* Function: createShadowFill
*
* Creates the fill for the shadow.
*/
createShadowFill(): HTMLElement;
/**
* Function: createShadowStroke
*
* Creates the stroke for the shadow.
*/
createShadowStroke(): HTMLElement;
/**
* Function: rotate
*
* Sets the rotation of the canvas. Note that rotation cannot be concatenated.
*/
rotate(theta: number, flipH: boolean, flipV: boolean, cx: number, cy: number): void;
/**
* Function: begin
*
* Extends superclass to create path.
*/
begin(): void;
/**
* Function: quadTo
*
* Replaces quadratic curve with bezier curve in VML.
*/
quadTo(x1: number, y1: number, x2: number, y2: number): void;
/**
* Function: createRect
*
* Sets the glass gradient.
*/
createRect(nodeName: string, x: number, y: number, w: number, h: number): HTMLElement;
/**
* Function: rect
*
* Sets the current path to a rectangle.
*/
rect(x: number, y: number, w: number, h: number): void;
/**
* Function: roundrect
*
* Sets the current path to a rounded rectangle.
*/
roundrect(x: number, y: number, w: number, h: number, dx: number, dy: number): void;
/**
* Function: ellipse
*
* Sets the current path to an ellipse.
*/
ellipse(x: number, y: number, w: number, h: number): void;
/**
* Function: image
*
* Paints an image.
*/
image(x: number, y: number, w: number, h: number, src: string, aspect: boolean, flipH: boolean, flipV: boolean): void;
/**
* Function: createText
*
* Creates the innermost element that contains the HTML text.
*/
createDiv(str: string, align: string, valign: string, overflow: string): HTMLElement;
/**
* Function: text
*
* Paints the given text. Possible values for format are empty string for plain
* text and html for HTML markup. Clipping, text background and border are not
* supported for plain text in VML.
*/
text(x: number, y: number, w: number, h: number, str: string, align: string, valign: string, wrap: string, format: string, overflow: string, clip: string, rotation: number, dir: string): void;
/**
* Function: plainText
*
* Paints the outline of the current path.
*/
plainText(x: number, y: number, w: number, h: number, str: string, align: string, valign: string, wrap: string, overflow: string, clip: string, rotation: number, dir: string): void;
/**
* Function: stroke
*
* Paints the outline of the current path.
*/
stroke(): void;
/**
* Function: fill
*
* Fills the current path.
*/
fill(): void;
/**
* Function: fillAndStroke
*
* Fills and paints the outline of the current path.
*/
fillAndStroke(): void;
}
}