Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
96 lines (74 loc) · 2.16 KB

File metadata and controls

96 lines (74 loc) · 2.16 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
/**
* Copyright (c) 2007-2012, JGraph Ltd
*/
package com.mxgraph.util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
* Contains various DOM API helper methods for use with mxGraph.
*/
public class mxDomUtils
{
/**
* Returns a new, empty DOM document.
*
* @return Returns a new DOM document.
*/
public static Document createDocument()
{
return mxXmlUtils.getDocumentBuilder().newDocument();
}
/**
* Creates a new SVG document for the given width and height.
*/
public static Document createSvgDocument(int width, int height)
{
Document document = createDocument();
Element root = document.createElement("svg");
String w = String.valueOf(width);
String h = String.valueOf(height);
root.setAttribute("width", w);
root.setAttribute("height", h);
root.setAttribute("viewBox", "0 0 " + w + " " + h);
root.setAttribute("version", "1.1");
root.setAttribute("xmlns", mxConstants.NS_SVG);
root.setAttribute("xmlns:xlink", mxConstants.NS_XLINK);
document.appendChild(root);
return document;
}
/**
*
*/
public static Document createVmlDocument()
{
Document document = createDocument();
Element root = document.createElement("html");
root.setAttribute("xmlns:v", "urn:schemas-microsoft-com:vml");
root.setAttribute("xmlns:o", "urn:schemas-microsoft-com:office:office");
document.appendChild(root);
Element head = document.createElement("head");
Element style = document.createElement("style");
style.setAttribute("type", "text/css");
style.appendChild(document.createTextNode(
"<!-- v\\:* {behavior: url(#default#VML);} -->"));
head.appendChild(style);
root.appendChild(head);
Element body = document.createElement("body");
root.appendChild(body);
return document;
}
/**
* Returns a document with a HTML node containing a HEAD and BODY node.
*/
public static Document createHtmlDocument()
{
Document document = createDocument();
Element root = document.createElement("html");
document.appendChild(root);
Element head = document.createElement("head");
root.appendChild(head);
Element body = document.createElement("body");
root.appendChild(body);
return document;
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.