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

230 lines
9.0 KiB
HTML
Raw Normal View History

2012-05-21 20:32:26 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2014-04-01 11:30:48 +00:00
<!-- NewPage -->
<html lang="en">
<head>
2015-03-05 09:43:42 +00:00
<!-- Generated by javadoc (version 1.7.0_51) on Thu Mar 05 04:25:15 EST 2015 -->
<title>com.mxgraph.reader (mxGraph 3.1.3.0 API Specification)</title>
<meta name="date" content="2015-03-05">
2014-04-01 11:30:48 +00:00
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
2012-05-21 20:32:26 +00:00
if (location.href.indexOf('is-external=true') == -1) {
2015-03-05 09:43:42 +00:00
parent.document.title="com.mxgraph.reader (mxGraph 3.1.3.0 API Specification)";
2012-05-21 20:32:26 +00:00
}
2014-04-01 11:30:48 +00:00
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
2012-05-21 20:32:26 +00:00
<!-- ========= START OF TOP NAVBAR ======= -->
2014-04-01 11:30:48 +00:00
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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>
2015-03-05 09:43:42 +00:00
<div class="aboutLanguage"><em><p><b>mxGraph 3.1.3.0</b></p></em></div>
2014-04-01 11:30:48 +00:00
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/mxgraph/model/package-summary.html">Prev Package</a></li>
<li><a href="../../../com/mxgraph/shape/package-summary.html">Next 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 Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
2012-05-21 20:32:26 +00:00
if(window==top) {
2014-04-01 11:30:48 +00:00
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
2012-05-21 20:32:26 +00:00
}
//-->
2014-04-01 11:30:48 +00:00
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
2012-05-21 20:32:26 +00:00
<!-- ========= END OF TOP NAVBAR ========= -->
2014-04-01 11:30:48 +00:00
<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="packageSummary" 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="packageSummary" 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)
2012-05-21 20:32:26 +00:00
{
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);
2014-04-01 11:30:48 +00:00
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()
2012-05-21 20:32:26 +00:00
.getXMLReader();
reader.setContentHandler(new mxSaxExportHandler(
new mxGraphicsExportCanvas(g2)));
2014-04-01 11:30:48 +00:00
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>
2012-05-21 20:32:26 +00:00
<!-- ======= START OF BOTTOM NAVBAR ====== -->
2014-04-01 11:30:48 +00:00
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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>
2015-03-05 09:43:42 +00:00
<div class="aboutLanguage"><em><p><b>mxGraph 3.1.3.0</b></p></em></div>
2014-04-01 11:30:48 +00:00
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/mxgraph/model/package-summary.html">Prev Package</a></li>
<li><a href="../../../com/mxgraph/shape/package-summary.html">Next 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 Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
2012-05-21 20:32:26 +00:00
if(window==top) {
2014-04-01 11:30:48 +00:00
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
2012-05-21 20:32:26 +00:00
}
//-->
2014-04-01 11:30:48 +00:00
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
2012-05-21 20:32:26 +00:00
<!-- ======== END OF BOTTOM NAVBAR ======= -->
2014-04-01 11:30:48 +00:00
<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>