package com.mxgraph.io; import com.mxgraph.model.mxGraphModel.mxChildChange; import com.mxgraph.model.mxICell; import java.util.Map; import java.util.Set; import org.w3c.dom.Element; import org.w3c.dom.Node; public class mxChildChangeCodec extends mxObjectCodec { public mxChildChangeCodec() { this(new mxGraphModel.mxChildChange(), new String[] { "model", "child", "previousIndex" }, new String[] { "parent", "previous" }, null); } public mxChildChangeCodec(Object paramObject, String[] paramArrayOfString1, String[] paramArrayOfString2, Map paramMap) { super(paramObject, paramArrayOfString1, paramArrayOfString2, paramMap); } public boolean isReference(Object paramObject1, String paramString, Object paramObject2, boolean paramBoolean) { if ((paramString.equals("child")) && (paramObject1 instanceof mxGraphModel.mxChildChange) && (((((mxGraphModel.mxChildChange)paramObject1).getPrevious() != null) || (!(paramBoolean))))) return true; return this.idrefs.contains(paramString); } public Node afterEncode(mxCodec parammxCodec, Object paramObject, Node paramNode) { if (paramObject instanceof mxGraphModel.mxChildChange) { mxGraphModel.mxChildChange localmxChildChange = (mxGraphModel.mxChildChange)paramObject; Object localObject = localmxChildChange.getChild(); if (isReference(paramObject, "child", localObject, true)) mxCodec.setAttribute(paramNode, "child", parammxCodec.getId(localObject)); else parammxCodec.encodeCell((mxICell)localObject, paramNode, true); } return paramNode; } public Node beforeDecode(mxCodec parammxCodec, Node paramNode, Object paramObject) { if (paramObject instanceof mxGraphModel.mxChildChange) { mxGraphModel.mxChildChange localmxChildChange = (mxGraphModel.mxChildChange)paramObject; Object localObject; if ((paramNode.getFirstChild() != null) && (paramNode.getFirstChild().getNodeType() == 1)) { paramNode = paramNode.cloneNode(true); localObject = paramNode.getFirstChild(); localmxChildChange.setChild(parammxCodec.decodeCell((Node)localObject, false)); Node localNode = ((Node)localObject).getNextSibling(); ((Node)localObject).getParentNode().removeChild((Node)localObject); for (localObject = localNode; localObject != null; localObject = localNode) { localNode = ((Node)localObject).getNextSibling(); if (((Node)localObject).getNodeType() == 1) { String str = ((Element)localObject).getAttribute("id"); if (parammxCodec.lookup(str) == null) parammxCodec.decodeCell((Node)localObject, true); } ((Node)localObject).getParentNode().removeChild((Node)localObject); } } else { localObject = ((Element)paramNode).getAttribute("child"); localmxChildChange.setChild((mxICell)parammxCodec.getObject((String)localObject)); } } return ((Node)paramNode); } public Object afterDecode(mxCodec parammxCodec, Node paramNode, Object paramObject) { if (paramObject instanceof mxGraphModel.mxChildChange) { mxGraphModel.mxChildChange localmxChildChange = (mxGraphModel.mxChildChange)paramObject; ((mxICell)localmxChildChange.getChild()).setParent((mxICell)localmxChildChange.getPrevious()); localmxChildChange.setPrevious(localmxChildChange.getParent()); localmxChildChange.setPreviousIndex(localmxChildChange.getIndex()); } return paramObject; } } /* Location: C:\Users\platform-001\Desktop\新建文件夹 (2)\jgraphx.jar * Qualified Name: com.mxgraph.io.mxChildChangeCodec * JD-Core Version: 0.5.3 */