Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 333:1be15ac758b4
rename value in lostNodeConnection, add comment.
author | oc |
---|---|
date | Wed, 04 Feb 2015 17:57:22 +0900 |
parents | 6a6653b67bd7 |
children | dff2f92ae3ff |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeManagement.java |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeManagement.java Wed Feb 04 17:46:09 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeManagement.java Wed Feb 04 17:57:22 2015 +0900 @@ -117,14 +117,15 @@ if (nodeList.size() < deadNode.getTreeNum()+1) { return; } - TreeVNCNode newparent = nodeList.get(deadNode.getTreeNum()); - TreeVNCNode grandfather = getParentNode(newparent.getTreeNum()); - connectTo(grandfather, newparent); - + TreeVNCNode newNode = nodeList.get(deadNode.getTreeNum()); + TreeVNCNode parentNode = getParentNode(newNode.getTreeNum()); + // new node connect to parent node. + connectTo(parentNode, newNode); + // if children node exist, children connect to new node. for(int i=0; i < treebranch; i++) { - TreeVNCNode child = getChildNode(newparent, i); + TreeVNCNode child = getChildNode(newNode, i); if (child != null) { - connectTo(newparent, child); + connectTo(newNode, child); } } }