Codec - Dynamically creating a graph from XML and encoding the model into XML, as well as changing the default style for edges in-place.
编码/解码器 可以将graph对象和xml相互转换
http://localhost/mxgraph/javascript/examples/codec.html
...
// Line: 41
// 取得div中的text
var xml = mxUtils.getTextContent(container);
// 解析为xml document
var xmlDocument = mxUtils.parseXml(xml);
// 根节点必须为mxGraphModel
if (xmlDocument.documentElement != null && xmlDocument.documentElement.nodeName == 'mxGraphModel')
{
// 用xml document初始化创建codec
var decoder = new mxCodec(xmlDocument);
// 引用根节点 这里decoder.document = xmlDocument
var node = xmlDocument.documentElement;
...
// Line: 76
// 解析xml 绘制graph图像
decoder.decode(node, graph.getModel());
以上是codec example的核心代码。先有xml,而后创建codec解析绘制。
分享到:
相关推荐
mina-example-2.0.0-M6.jar mina-filter-codec-netty-2.0.0-M6.jar mina-filter-compression-2.0.0-M6.jar mina-integration-beans-2.0.0-M6.jar mina-integration-jmx-2.0.0-M6.jar mina-integration-ognl-2.0.0-M6...
1、lgb模型转换pmml格式
使用SpringBoot2.x集成Netty4.x创建基于TCP/IP协议的服务端和客户端的Demo代码案例 使用了SpringBoot+swaggerUI方式进行测试,客户端可以给服务端发送消息,服务端也可以给已经连上的客户端发送消息,使用了通道保活...
MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2...
maven-example-3.0.0-sources.jar
qeephp 入门 example-todo-2009-06-18.zip下载 qeephp 入门 example-todo-2009-06-18.zip下载
regression-analysis-by-example-5th-edition
华为集群客户端程序,编译执行参加csdn博客https://blog.csdn.net/gdeasy/article/details/103306512
openTCS是开源的AGV开发软件,软件是Java开发,可集成同步Unity一起运行
loopback-example-user-management, 环回用户管理示例 loopback-example-user-management$ git clone git@github.com:strongloop/loopback-example-user-management.git$ cd l
example-cpp-project-源码.rar
example-prometheus-nodejs-master.rar
pmml-lightgbm-example-executable-1.4-SNAPSHOT.jar。 lightgbm模型转pmml文件,可用于java程序调用,实现在线打分功能。 看网站上有人定价为付费,于是开出积分版本,赚点积分,谢谢支持 使用方法: 1. 生产模型...
Anirudh-Munnangi-Forex-Forecasting--A-basic-example-using-neural-networks-archive-refs-heads-master.zip
Oracle Plsql By Example 4Th-代码示例-11g.rar
threejs-example-image-tracking-dynamic-lighting-源码.rar
每个工程示例都包括了该工程的项目文件、源文件、报告文件和生成结果等文件,读者可以用Quartus II或相应的软件直接打开。设计源文件根据设计输入类型分为源代码或原理图等。
netty-codec-4.1.32.Final-sources.jar netty-codec-4.1.32.Final.jar netty-codec-http-4.1.32.Final-sources.jar netty-codec-http-4.1.32.Final.jar netty-codec-http2-4.1.32.Final-sources.jar netty-codec-...
python-nginx-example-app-源码.rar
pso-example-java-master.zip