--------------------------------------------------------------------------- component.getLinkObjByNodes()  node間のオブジェクトを取得する ---------------------------------------------------------------------------
328079
function(node1, node2){
		var bx1=node1.obj.bx, by1=node1.obj.by, bx2=node2.obj.bx, by2=node2.obj.by;
		if(bx1>bx2||((bx1===bx2)&&(by1>by2))){ return null;}
		return this.board.getobj(((bx1+bx2)>>1), ((by1+by2)>>1));
	}
1214949
function mapMapNode(node, parent, maps, id)
  {
    var local,
        attrs = __slice.call(node.attributes),
        nodeMaps = [],
        nodeId = uuid(),
        item,
        x = 0,
        len = attrs.length,
        text,
        title,
        mapText,
        i,
        lenn;
      
    for(x;x<len;x++)
    {
      text = attrs[x].value;
      title = attrs[x].name;
      if(title === '__kaleonodebind__')
      {
        mapText = splitText(text);
        item = mapText[0];

        /* create nodemap */
        local = new mapObject({
          local_id: id,
          node_id: nodeId,
          mapIndex: maps.length,
          mapTextIndex: 0,
          text: item,
          mapText: mapText,
          maps: maps,
          type: 'node',
          property: 'nodeName',
          listener: 'nodeName',
          isDirty: false,
          localAttr: 'nodeName',
          node: node,
          values: nodeMaps
        })
        maps.push(local);
        mapText[0] = maps[(maps.length - 1)];
      }
      else if(title === '__kaleoattrsbind__')
      {
        mapAttrName(node, text, nodeMaps, id, nodeId, true);
      }
      else if(title === '__kaleostylebind__')
      {
        mapStyleAttr(node, text, nodeMaps, id, nodeId, true);
      }
      else if(text.match(__matchText))
      {
        mapText = splitText(text);
        lenn = mapText.length;
        i = 0;
        for(i;i<lenn;i++)
        {
          item = mapText[i];
          if(item.match(__matchInsert))
          {
            nodeMaps.push(new mapObject({
              local_id: id,
              node_id: nodeId,
              mapIndex: maps.length,
              mapTextIndex: i,
              text: item,
              mapText: mapText,
              maps: nodeMaps,
              type: 'pointer',
              isInsert: true,
              property: title,
              local: attrs[x],
              localAttr: 'value',
              node: node,
              isAttr: true
            }));
          }
          else if(item.match(__matchText))
          {
            nodeMaps.push(new mapObject({
              local_id: id,
              node_id: nodeId,
              mapIndex: maps.length,
              mapTextIndex: i,
              text: item,
              mapText: mapText,
              maps: nodeMaps,
              type: 'pointer',
              property: title,
              listener: title,
              local: attrs[x],
              localAttr: 'value',
              node: node,
              isAttr: true,
              isPointer: true
            }));
          }
        }
      }
    }
  }
1247400
function () {
        var data = this.data;
        var nodes = this._nodes;

        for (var i = 0, len = nodes.length; i < len; i++) {
            nodes[i].dataIndex = -1;
        }

        for (var i = 0, len = data.count(); i < len; i++) {
            nodes[data.getRawIndex(i)].dataIndex = i;
        }
    }
974236
private void dumpNode(final Node node, final TransformContext transformContext, final StringBuilder builder) {
		if (node == null) {
			return;
		}
		if (node instanceof ASTProperty) {
			ASTProperty prop = (ASTProperty) node;
			if (!StringFunction.SHORT_NAME.equals(prop.toString())) {
				try {
					Object value = Ognl.getValue(prop, transformContext, null);
					builder.append(prop)
							.append(":[")
							.append(value == null ? null
									: ToStringBuilder.reflectionToString(value,
											ToStringStyle.SIMPLE_STYLE))
							.append("],");
				} catch (OgnlException ex) {
					// ダンプ処理でシステムが止まっては困るのでスタックトレースを出して握りつぶす
					ex.printStackTrace();
				}
			}
		} else {
			int childCount = node.jjtGetNumChildren();
			for (int i = 0; i < childCount; i++) {
				Node child = node.jjtGetChild(i);
				dumpNode(child, transformContext, builder);
			}
		}
	}
337418
function propsNode (node) {
  var props = flatmap(Object.keys(node), function (key) {
    if (key == 'type' || key == 'value' || key == 'children') {
      return;
    }

    var value = node[key];

    if (key == 'data') {
      value = JSON.parse(JSON.stringify(value));
    }

    return {
      type: 'Property',
      key: {
        type: 'Identifier',
        name: key
      },
      value: literalNode(value)
    };
  });

  return props.length && {
    type: 'ObjectExpression',
    properties: props
  };
}
302981
@Override
    public boolean isLeaf(Object nodeObj) {
        if (debugger == null) {
            return true;
        }
        VariableNode node = (VariableNode) nodeObj;
        return children(node).length == 0;
    }
1151975
function initVivaGraph(){
    g = Viva.Graph.graph();
    isPaused = false;

    divGraph = document.getElementById('divGraph');

    $('#divGraph').append("<div id='loadingText' class='hero-body has-text-centered'><h1 class='title'>Loading...</h1></div>");

    console.time("nodesFromMWG");
    graph.indexes(WORLD, TIME, function (indexNames) {
        var defer = graph.newCounter(indexNames.length);
        for (var i = 0; i < indexNames.length; ++i) {
            const indexName = indexNames[i];
            /*graph.getIndexNode(WORLD, TIME, indexName, function (node) {
             console.log(node.toString());
             });*/
            graph.findAll(WORLD, TIME, indexName, function (nodes) {
                // transform every mwg nodes and add them to a global array
                for (var j = 0; j < nodes.length; ++j){
                    addToGlobalNodes(nodes[j]);
                }
                defer.count();
            });
        }

        defer.then(function() {
            console.timeEnd("nodesFromMWG");
            console.time("nodesToVivagraph");
            // add only 'nbNodesToDisplay' nodes to the graph
            var nbNodesToDisplay = (gAllNodes.length > NB_NODES_TO_DISPLAY ? NB_NODES_TO_DISPLAY : gAllNodes.length);
            for (var i = 0; i < nbNodesToDisplay; ++i){
                addNodeToGraph(gAllNodes[i]);
            }
            for (var i = 0; i < gNodesWithRel.length; ++i){
                addRelToGraph(gNodesWithRel[i]);
            }
            gRootNodes = _.difference(gAllNodes, gChildrenNodes);
            createTree();
            var maxChildNodes = getMaxChildNodes();
            console.timeEnd("nodesToVivagraph");

            console.time("rendering+loading");
            graphics = Viva.Graph.View.webglGraphics();
            graphics
                .node(function(node){
                    return Viva.Graph.View.webglSquare(NODE_SIZE, colorsByNodeType[node.data._type]);
                })
                .link(function(link) {
                    return Viva.Graph.View.webglLine(colorsByLinkType[link.data]);
                });

            var events = Viva.Graph.webglInputEvents(graphics, g);

            events.mouseEnter(function (vivagraphNode) {
                /*var nodeUI = graphics.getNodeUI(vivagraphNode.id);
                 nodeUI.color = '0x00BFFFFF';
                 renderer.rerender();*/
            }).mouseLeave(function (vivagraphNode) {
                /* var nodeUI = graphics.getNodeUI(vivagraphNode.id);
                 nodeUI.color = hexColorToWebGLColor(colorsByNodeType[vivagraphNode.data._type]);
                 renderer.rerender();*/
            }).dblClick(function (vivagraphNode) {
                drawNodeContext(vivagraphNode.data._id, NB_HOPS);
            }).click(function (vivagraphNode) {
                highlightNodeWebGL(vivagraphNode.data);
                displayNameDOM(vivagraphNode.data);
                globalFunc.setNodeDetailOnClick(vivagraphNode.data);
            });

            //TODO : slow things really badly
            /*
             graphics.placeNode(function(ui, pos){
             var label = $('.nodeLabel');
             if (label.length){
             var nodePos = layout.getNodePosition(label.attr('id'));
             var domPos = {
             x: nodePos.x,
             y: nodePos.y
             };

             graphics.transformGraphToClientCoordinates(domPos);
             label.css({'left' : domPos.x, 'top' : domPos.y});

             //hide label if it goes out of the divGraph layout
             if (domPos.x < 0 || domPos.y < 0) {
             label.hide();
             } else {
             label.show();
             }
             }
             });
             */

            console.time("loading data in components");
            // Load the necessary stuff (nodes) in the react components
            globalFunc.addNodesInList();
            globalFunc.setTypesInList();
            globalFunc.loadRootNodesInTree();
            globalFunc.loadTree();
            console.timeEnd("loading data in components");

            var springLength = 200;
            var displayedChildNodes = Math.ceil(maxChildNodes / (gAllNodes.length / nbNodesToDisplay));
            var springLengthCoeff = (displayedChildNodes <= 250 ? 1 : displayedChildNodes / 250);
            layout = Viva.Graph.Layout.forceDirected(g, {
                springLength : springLength * springLengthCoeff,
                springCoeff : 0.0008,
                dragCoeff : 0.02
            });

            renderer = Viva.Graph.View.renderer(g, {
                graphics : graphics,
                layout: layout,
                container: divGraph,
                prerender: 50
            });

            $('#loadingText').hide();

            renderer.run();
            console.timeEnd("rendering+loading");

            console.time("table+events");
            createTableLayout();
            initJQueryEvents();
            console.timeEnd("table+events");

            console.timeEnd("all");
        });
    });


}
776312
function processNode(node) {
    if (node.tagName === 'P' || node.tagName === 'DIV' || node.tagName === 'UL' || node.tagName === 'OL' || node.tagName === 'PRE')
      setContent(node, getContent(node), '\n\n', '\n\n');
    else if (node.tagName === 'BR')
      setContent(node, '\n\n');
    else if (node.tagName === 'HR')
      setContent(node, '\n***\n');
    else if (node.tagName === 'H1')
      setContent(node, nltrim(getContent(node)), '\n# ', '\n');
    else if (node.tagName === 'H2') 
      setContent(node, nltrim(getContent(node)), '\n## ', '\n');
    else if (node.tagName === 'H3')
      setContent(node, nltrim(getContent(node)), '\n### ', '\n');
    else if (node.tagName === 'H4') 
      setContent(node, nltrim(getContent(node)), '\n#### ', '\n');
    else if (node.tagName === 'H5') 
      setContent(node, nltrim(getContent(node)), '\n##### ', '\n');
    else if (node.tagName === 'H6')
      setContent(node, nltrim(getContent(node)), '\n###### ', '\n');
    else if (node.tagName === 'B' || node.tagName === 'STRONG')
      setContent(node, nltrim(getContent(node)), '**', '**');
    else if (node.tagName === 'I' || node.tagName === 'EM')
      setContent(node, nltrim(getContent(node)), '_', '_');
    else if (node.tagName === 'A') {
      var href = node.href ? nltrim(node.href) : '', text = nltrim(getContent(node)) || href, title = node.title ? nltrim(node.title) : '';
      if (href.length > 0)
        setContent(node, '[' + text + '](' + href + (title ? ' "' + title + '"' : '') + ')');
      else
        setContent(node, '');
    } else if (node.tagName === 'IMG') {
      var src = node.getAttribute('src') ? nltrim(node.getAttribute('src')) : '', alt = node.alt ? nltrim(node.alt) : '', caption = node.title ? nltrim(node.title) : '';
      if (src.length > 0)
        setContent(node, '![' + alt + '](' + src  + (caption ? ' "' + caption + '"' : '') + ')');
      else
        setContent(node, '');
    } else if (node.tagName === 'BLOCKQUOTE') {
      var block_content = getContent(node);
      if (block_content.length > 0)
        setContent(node, prefixBlock('> ', block_content), '\n\n', '\n\n');
      else
        setContent(node, '');
    } else if (node.tagName === 'CODE') {
      if (node._bfs_parent.tagName === 'PRE' && node._bfs_parent._bfs_parent !== null)
        setContent(node, prefixBlock('    ', getContent(node)));
      else
        setContent(node, nltrim(getContent(node)), '`', '`');
    } else if (node.tagName === 'LI') {
      var list_content = getContent(node);
      if (list_content.length > 0)
        if (node._bfs_parent.tagName === 'OL') 
          setContent(node, trim(prefixBlock('    ', list_content, true)), '1. ', '\n\n');
        else
          setContent(node, trim(prefixBlock('    ', list_content, true)), '- ', '\n\n');
      else
        setContent(node, '');
    } else 
      setContent(node, getContent(node));
  }
655252
private void displayNode(JspWriter out, ViewNode node, String url_Path, int level, int width) throws IOException {

		// ----------------------------------------显示节点本身信息，如节点名称等开始
		String encodedNodeKey = URLEncoder.encode(node.getKey(), "UTF-8");
		String action = replace(nodeAction, "${key}", encodedNodeKey);
		StringBuilder url = new StringBuilder(url_Path);
		url.append(action);
		if (nodeAction.indexOf("?") < 0)
			url.append("?");
		else
			url.append("&");
		url.append("key=").append(node.getKey());
		String treeNodeAction = url.toString();

		url = new StringBuilder(url_Path);
		url.append(treeAction);
		if (treeAction.indexOf("?") < 0)
			url.append("?");
		else
			url.append("&");
		url.append("select=").append(node.getKey());
		String updateNodeAction = url.toString();

		// Render the label for this node (if any)
		out.print("    <td colspan=\"");
		out.print(width - level + 1);
		out.print("\">");

		// 这里省略了icon

		if (node.getLabel() != null) {
			String labelStyle = null;
			if (node.isSelected())
				labelStyle = CSS_STYLE_SELECTED;
			else if (!node.isSelected())
				labelStyle = CSS_STYLE_UN_SELECTED;
			if (treeNodeAction != null) {
				// Note the leading space so that the text has some space
				// between it and any preceding images
				out.print(" <a href=\"");
				out.print(treeNodeAction);
				out.print("\"");
				if (target != null) {
					out.print(" target=\"");
					out.print(target);
					out.print("\"");
				}
				if (labelStyle != null) {
					out.print(" class=\"");
					out.print(labelStyle);
					out.print("\"");
				}
				// to refresh the tree in the same 'self' frame
				out.print(" onclick=\"");
				out.print("self.location.href='" + updateNodeAction + "'");
				out.print("\"");
				out.print(">");
			} else if (labelStyle != null) {
				out.print("<span class=\"");
				out.print(labelStyle);
				out.print("\">");
			}
			out.print(node.getLabel());
			if (treeNodeAction != null)
				out.print("</a>");
			else if (labelStyle != null)
				out.print("</span>");
		}

		out.println("</td>");

		// ----------------------------------------显示节点本身信息，如节点名称等结束

	}
1354442
function() {
        var str = this[UID] + ': not bound to a node',
            node = this._node,
            attrs, id, className;

        if (node) {
            attrs = node.attributes;
            id = (attrs && attrs.id) ? node.getAttribute('id') : null;
            className = (attrs && attrs.className) ? node.getAttribute('className') : null;
            str = node[NODE_NAME];

            if (id) {
                str += '#' + id; 
            }

            if (className) {
                str += '.' + className.replace(' ', '.'); 
            }

            // TODO: add yuid?
            str += ' ' + this[UID];
        }
        return str;
    }
606476
@Override
    public Object getChild(Object nodeObj, int i) {
        if (debugger == null) {
            return null;
        }
        VariableNode node = (VariableNode) nodeObj;
        return children(node)[i];
    }
1009147
function getCodeFromNode(node, renameSources, options) {
    const code_map = getCodeMap(node);
    const rename = renameSources;
    const objMap = code_map.map.toJSON();
    let i, n;

    if (rename) {
        if ('string' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename + objMap.sources[i];
            }
        } else if ('function' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename(objMap.sources[i]);
            }
        } else {
            console.warn('unexpected type of rename: ' + typeof rename);
        }
    }

    return node.toString() +
        convert.fromObject(objMap)
            .toComment(options)
            .replace(/charset=utf-8;/gm, '')
            .replace('data:application/json;', 'data:application/json;charset=utf-8;') + '\n';
}
166626
function tokenizeByLine (element, index, array) {
    parser.line = index + 1
    parser.column = 1

    var paragraphNode = parser.createParentNode('Paragraph')

    // 空行ではない場合
    if (element !== '') {
      // 半角括弧を全角括弧に変換
      var str = new Jaco(element).toWideJapneseSymbol().toString()

      // 改行ノードをParagraphNodeに追加する
      parser.add(parser.createTextNode('Text', str), paragraphNode)
    }

    // 改行ノードをParagraphNodeに追加する
    parser.add(parser.createTextNode('WhiteSpace', '\n'), paragraphNode)

    // ParagraphNodeをRoodNodeに追加
    parser.add(paragraphNode, rootNode)
  }
192040
function getNextVisibleNode(self) {
        var children = self.get('children'), n, parent;
        if (self.get('expanded') && children.length) {
            return children[0];
        }    // 没有展开或者根本没有儿子节点
             // 深度遍历的下一个
        // 没有展开或者根本没有儿子节点
        // 深度遍历的下一个
        n = self.next();
        parent = self;
        while (!n && (parent = parent.get('parent'))) {
            n = parent.next();
        }
        return n;
    }
1368824
function getChildLNode(node) {
    if (node.tNode.child) {
        var viewData = node.tNode.type === 2 /* View */ ? node.data : node.view;
        return readElementValue(viewData[node.tNode.child.index]);
    }
    return null;
}
861715
function _getLinks(node) {
  var links = [];

  node.ifForEach('inEdgeIds', function (inEdge) {
    var edge = _data.edges.get(inEdge);
    edge.setProperties({
      sourceId: edge.get('inputVertexName'),
      targetId: edge.get('outputVertexName')
    });
    links.push(edge);
  });

  if(node.type === types.INPUT) {
    links.push(Ember.Object.create({
      sourceId: node.get('id'),
      targetId: node.get('vertex.id')
    }));
  }
  else if(node.type === types.OUTPUT) {
    links.push(Ember.Object.create({
      sourceId: node.get('vertex.id'),
      targetId: node.get('id')
    }));
  }

  return links;
}
1091122
function getNodeFromCode(code) {
    if (convert.mapFileCommentRegex.test(code)) {
        try {
            return SourceNode.fromStringWithSourceMap(
                convertCode2Script(code),
                new SourceMapConsumer(convert.fromComment(code).toObject())
            );
        } catch (error) {
            console.error('getNodeFromCode() error: ' + error);
            const node = new SourceNode();
            node.add(convertCode2Script(code));
            return node;
        }
    } else {
        const node = new SourceNode();
        node.add(convertCode2Script(code));
        return node;
    }
}