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


Java Node.getGraph方法代码示例

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


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

示例1: changedVisibility

import y.base.Node; //导入方法依赖的package包/类
@Override
public void changedVisibility(final IViewEdge<?> edge, final boolean visible) {
  if (visible) {
    final Node source = m_sourceNode.getNode();
    final Node target = m_targetNode.getNode();

    // Make sure "all endpoints lie in a graph"
    if ((source.getGraph() == null) || (target.getGraph() == null)) {
      return;
    }

    // Note: "m_graph.reInsertEdge(m_edge)" won't work here, as
    // edges can lose target nodes when group nodes are
    // collapsed
    final HierarchyManager hm = m_graph.getHierarchyManager();
    final Edge yedge = hm.createEdge(source, target);

    m_graph.setRealizer(yedge, m_realizer);

    m_edge = yedge;
  } else if (m_edge.getGraph() == m_graph) {
    m_graph.removeEdge(m_edge);
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:25,代码来源:ZyGraphEdge.java

示例2: bringNodeToFront

import y.base.Node; //导入方法依赖的package包/类
public void bringNodeToFront(final Node node) {
  final Graph2D g = (Graph2D) node.getGraph();
  final NodeRealizer r = g.getRealizer(node);

  if (r.isSelected()) {
    // This does not work properly! Why? NH
    for (final NodeCursor nc = g.selectedNodes(); nc.ok(); nc.next()) {
      m_nodesInDrawingOrder.remove(nc.node());
      m_nodesInDrawingOrder.add(nc.node());
    }
  } else {
    // This seems to work correctly.
    m_nodesInDrawingOrder.remove(node);
    m_nodesInDrawingOrder.add(node);
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:17,代码来源:ZyGraphDefaultRenderer.java

示例3: isAnyParentNodeSelected

import y.base.Node; //导入方法依赖的package包/类
/**
 * Determines whether any of the parent nodes of the given node is selected.
 */
private boolean isAnyParentNodeSelected(final Node n) {
  final Graph2D graph = (Graph2D) n.getGraph();
  final HierarchyManager hierarchy = graph.getHierarchyManager();

  if (hierarchy == null) {
    return false;
  }

  boolean result = false;
  Node parent = hierarchy.getParentNode(n);
  while (parent != null) {
    if (graph.isSelected(parent)) {
      result = true;
      break;
    }
    parent = hierarchy.getParentNode(parent);
  }
  return result;
}
 
开发者ID:google,项目名称:binnavi,代码行数:23,代码来源:ZyGraphLayeredRenderer.java


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