forked from jgraph/mxgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOldImageExportTest.java
More file actions
34 lines (24 loc) · 919 Bytes
/
OldImageExportTest.java
File metadata and controls
34 lines (24 loc) · 919 Bytes
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
package com.mxgraph.test;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import org.w3c.dom.Document;
import com.mxgraph.io.mxCodec;
import com.mxgraph.util.mxCellRenderer;
import com.mxgraph.util.mxUtils;
import com.mxgraph.util.mxXmlUtils;
import com.mxgraph.view.mxGraph;
public class OldImageExportTest
{
public static void main(String[] args) throws IOException
{
System.out.println("Parsing graphmodel.xml");
Document doc = mxXmlUtils.parseXml(mxUtils.readFile(mxImageExportTest.class.getResource("/com/mxgraph/test/graphmodel.xml")
.getPath()));
mxGraph graph = new mxGraph();
mxCodec codec = new mxCodec(doc);
codec.decode(doc.getDocumentElement(), graph.getModel());
ImageIO.write(mxCellRenderer.createBufferedImage(graph, null, 1, null, true, null), "png", new File("oldimageexport.png"));
System.out.println("Writing oldimageexport.png");
}
}