当前位置: 首页>>代码示例>>Java>>正文


Java Node.outEdges方法代码示例

本文整理汇总了Java中y.base.Node.outEdges方法的典型用法代码示例。如果您正苦于以下问题:Java Node.outEdges方法的具体用法?Java Node.outEdges怎么用?Java Node.outEdges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在y.base.Node的用法示例。


在下文中一共展示了Node.outEdges方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EdgeCursorProxyIterator

import y.base.Node; //导入方法依赖的package包/类
EdgeCursorProxyIterator(final Node node, final boolean incoming) {
  if (incoming) {
    m_edgecursor = node.inEdges();
  } else {
    m_edgecursor = node.outEdges();
  }
  if (m_edgecursor.ok()) {
    m_hasNext = true;
    m_edgecursor.toLast();
    m_last = (Edge) m_edgecursor.current();
    m_edgecursor.toFirst();
  } else {
    m_hasNext = false;
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:16,代码来源:CReilInstructionGraph.java

示例2: closeGroup

import y.base.Node; //导入方法依赖的package包/类
/**
 * Closes a group node.
 * 
 * @param graph The graph the group node belongs to.
 * @param groupNode The group node to be closed.
 */
public static void closeGroup(final Graph2D graph, final Node groupNode) {
  Preconditions.checkNotNull(graph, "Error: Graph argument can not be null");
  Preconditions.checkNotNull(groupNode, "Error: Group node argument can not be null");

  final HierarchyManager hierarchy = graph.getHierarchyManager();

  final double w = graph.getWidth(groupNode);
  final double h = graph.getHeight(groupNode);

  final NodeList groupNodes = new NodeList();
  groupNodes.add(groupNode);

  graph.firePreEvent();
  for (final NodeCursor nc = groupNodes.nodes(); nc.ok(); nc.next()) {
    hierarchy.closeGroup(nc.node());
  }
  graph.firePostEvent();

  // if the node size has changed, delete source ports of out-edges
  // and target ports of in-edges to ensure that all edges still connect
  // to the node
  if ((w != graph.getWidth(groupNode)) || (h != graph.getHeight(groupNode))) {
    for (final EdgeCursor ec = groupNode.outEdges(); ec.ok(); ec.next()) {
      graph.setSourcePointRel(ec.edge(), YPoint.ORIGIN);
    }
    for (final EdgeCursor ec = groupNode.inEdges(); ec.ok(); ec.next()) {
      graph.setTargetPointRel(ec.edge(), YPoint.ORIGIN);
    }
  }

  graph.updateViews();

}
 
开发者ID:google,项目名称:binnavi,代码行数:40,代码来源:YHelpers.java

示例3: openFolder

import y.base.Node; //导入方法依赖的package包/类
/**
 * Opens a folder node.
 * 
 * @param graph The graph the folder node belongs to.
 * @param folderNode The folder node to be opened.
 */
public static void openFolder(final Graph2D graph, final Node folderNode) {
  Preconditions.checkNotNull(graph, "Error: Graph argument can not be null");
  Preconditions.checkNotNull(folderNode, "Error: Folder node argument can not be null");

  final HierarchyManager hierarchy = graph.getHierarchyManager();

  final double w = graph.getWidth(folderNode);
  final double h = graph.getHeight(folderNode);

  final NodeList folderNodes = new NodeList();
  folderNodes.add(folderNode);

  graph.firePreEvent();

  for (final NodeCursor nc = folderNodes.nodes(); nc.ok(); nc.next()) {
    // get original location of folder node
    final Graph2D innerGraph = (Graph2D) hierarchy.getInnerGraph(nc.node());
    final YPoint folderP = graph.getLocation(nc.node());
    final NodeList innerNodes = new NodeList(innerGraph.nodes());

    hierarchy.openFolder(nc.node());

    // get new location of group node
    final Rectangle2D.Double gBox = graph.getRealizer(nc.node()).getBoundingBox();
    // move grouped nodes to former location of folder node
    LayoutTool.moveSubgraph(graph, innerNodes.nodes(), folderP.x - gBox.x, folderP.y - gBox.y);
  }
  graph.firePostEvent();

  graph.unselectAll();
  for (final NodeCursor nc = folderNodes.nodes(); nc.ok(); nc.next()) {
    graph.setSelected(nc.node(), true);
  }

  // if the node size has changed, delete source ports of out-edges
  // and target ports of in-edges to ensure that all edges still connect
  // to the node
  if ((w != graph.getWidth(folderNode)) || (h != graph.getHeight(folderNode))) {
    for (final EdgeCursor ec = folderNode.outEdges(); ec.ok(); ec.next()) {
      graph.setSourcePointRel(ec.edge(), YPoint.ORIGIN);
    }
    for (final EdgeCursor ec = folderNode.inEdges(); ec.ok(); ec.next()) {
      graph.setTargetPointRel(ec.edge(), YPoint.ORIGIN);
    }
  }

  graph.updateViews();
}
 
开发者ID:google,项目名称:binnavi,代码行数:55,代码来源:YHelpers.java


注:本文中的y.base.Node.outEdges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。