maxGraph/java/docs/com/mxgraph/reader/package-summary.html

239 lines
9.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_101) on Wed Apr 12 16:32:19 CEST 2017 -->
<title>com.mxgraph.reader (mxGraph 3.7.2 API Specification)</title>
<meta name="date" content="2017-04-12">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.mxgraph.reader (mxGraph 3.7.2 API Specification)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><p><b>mxGraph 3.7.2</b></p></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/mxgraph/model/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../com/mxgraph/shape/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/mxgraph/reader/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;com.mxgraph.reader</h1>
<div class="docSummary">
<div class="block">This package contains the classes required to turn an encoded mxGraphView
into an image using SAX and without having to create a graph model.</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../com/mxgraph/reader/mxDomOutputParser.IElementHandler.html" title="interface in com.mxgraph.reader">mxDomOutputParser.IElementHandler</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../com/mxgraph/reader/mxSaxOutputHandler.IElementHandler.html" title="interface in com.mxgraph.reader">mxSaxOutputHandler.IElementHandler</a></td>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../com/mxgraph/reader/mxDomOutputParser.html" title="class in com.mxgraph.reader">mxDomOutputParser</a></td>
<td class="colLast">
<div class="block">public static void main(String[] args)
{
try
{
String filename = Test.class.getResource(
"/com/mxgraph/online/exported.xml").getPath();
String xml = mxUtils.readFile(filename);
System.out.println("xml=" + xml);
Document doc = mxUtils.parseXml(xml);
Element root = doc.getDocumentElement();
int width = Integer.parseInt(root.getAttribute("width"));
int height = Integer.parseInt(root.getAttribute("height"));
System.out.println("width=" + width + " height=" + height);
BufferedImage img = mxUtils.createBufferedImage(width, height,
Color.WHITE);
Graphics2D g2 = img.createGraphics();
mxUtils.setAntiAlias(g2, true, true);
mxDomOutputParser reader = new mxDomOutputParser(
new mxGraphicsExportCanvas(g2));
reader.read((Element) root.getFirstChild().getNextSibling());
ImageIO.write(img, "PNG", new File(
"C:\\Users\\Gaudenz\\Desktop\\test.png"));
}
catch (Exception e)
{
e.printStackTrace();
}
}
// -------------
Document doc = mxUtils.parseXml(xml);
Element root = doc.getDocumentElement();
mxDomOutputParser reader = new mxDomOutputParser(canvas);
reader.read(root.getFirstChild());</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../com/mxgraph/reader/mxGraphViewImageReader.html" title="class in com.mxgraph.reader">mxGraphViewImageReader</a></td>
<td class="colLast">
<div class="block">A converter that renders display XML data onto a graphics canvas.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../com/mxgraph/reader/mxGraphViewReader.html" title="class in com.mxgraph.reader">mxGraphViewReader</a></td>
<td class="colLast">
<div class="block">An abstract converter that renders display XML data onto a canvas.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../com/mxgraph/reader/mxSaxOutputHandler.html" title="class in com.mxgraph.reader">mxSaxOutputHandler</a></td>
<td class="colLast">
<div class="block">XMLReader reader = SAXParserFactory.newInstance().newSAXParser()
.getXMLReader();
reader.setContentHandler(new mxSaxExportHandler(
new mxGraphicsExportCanvas(g2)));
reader.parse(new InputSource(new StringReader(xml)));</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package com.mxgraph.reader Description">Package com.mxgraph.reader Description</h2>
<div class="block">This package contains the classes required to turn an encoded mxGraphView
into an image using SAX and without having to create a graph model.</div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><p><b>mxGraph 3.7.2</b></p></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/mxgraph/model/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../com/mxgraph/shape/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/mxgraph/reader/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><font size=1>Copyright (c) 2010 <a href="http://www.mxgraph.com/"
target="_blank">Gaudenz Alder, David Benson</a>. All rights reserved.</font></small></p>
</body>
</html>