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


Java CanonicMultiStageLayouter类代码示例

本文整理汇总了Java中y.layout.CanonicMultiStageLayouter的典型用法代码示例。如果您正苦于以下问题:Java CanonicMultiStageLayouter类的具体用法?Java CanonicMultiStageLayouter怎么用?Java CanonicMultiStageLayouter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createIncrementalHierarchicalLayouter

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
public static CanonicMultiStageLayouter createIncrementalHierarchicalLayouter(
    final boolean orthogonalEdgeRooting, final long minLayerDist, final long minNodeDist,
    final HierarchicOrientation orientation) {
  final IncrementalHierarchicLayouter layouter = new IncrementalHierarchicLayouter();

  final OrientationLayouter ol = (OrientationLayouter) layouter.getOrientationLayouter();
  ol.setOrientation(orientation == HierarchicOrientation.HORIZONTAL
      ? OrientationLayouter.TOP_TO_BOTTOM : OrientationLayouter.LEFT_TO_RIGHT);

  layouter.setMinimumLayerDistance(minLayerDist);
  layouter.setNodeToNodeDistance(minNodeDist);
  layouter.setEdgeToEdgeDistance(25);
  layouter.setNodeToEdgeDistance(25);

  layouter.setBackloopRoutingEnabled(true);
  layouter.setSelfLoopLayouterEnabled(true);
  // layouter.setParallelEdgeLayouterEnabled(true);
  layouter.setOrthogonallyRouted(orthogonalEdgeRooting);

  return layouter;
}
 
开发者ID:google,项目名称:binnavi,代码行数:22,代码来源:ZyGraphLayouter.java

示例2: createOrthoLayouter

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
public static CanonicMultiStageLayouter createOrthoLayouter(final OrthogonalStyle style,
    final long gridSize, final boolean isVerticalOrientation) {
  Preconditions.checkArgument(gridSize > 0, "Internal Error: Grid size can not be 0 or lower.");
  Preconditions.checkNotNull(style, "Internal Error: Layout style can't be null");

  final OrthogonalLayouter layouter = new OrthogonalLayouter();

  layouter.setLayoutStyle(style == OrthogonalStyle.NORMAL ? OrthogonalLayouter.NORMAL_STYLE
      : OrthogonalLayouter.NORMAL_TREE_STYLE);

  final OrientationLayouter ol = (OrientationLayouter) layouter.getOrientationLayouter();
  ol.setOrientation(isVerticalOrientation ? OrientationLayouter.TOP_TO_BOTTOM
      : OrientationLayouter.LEFT_TO_RIGHT);
  layouter.setGrid((int) gridSize);

  return layouter;
}
 
开发者ID:google,项目名称:binnavi,代码行数:18,代码来源:ZyGraphLayouter.java

示例3: recalculatePorts

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
public static void recalculatePorts(final CanonicMultiStageLayouter layouter,
    final Graph2D graph) {
  // Effect: Ensures that ports are drawn onto node borders, and not onto the node center. (Only
  // Circular layout!)
  // Justification: Circular layout uses as the standard port the center of the node, this will be
  // corrected by
  // calling the following function.
  // Exclusion: Port of nodes with non rectangle shapes, have to be additionally recalculated.

  if (layouter instanceof CircularLayouter) {
    // Port correction
    LayoutTool.clipEdgesOnBB(graph);

    // Recalculate ports (necessary for circular proximity nodes)
    final PortCalculator pc = new PortCalculator();
    final NodeRealizerIntersectionCalculator nrics =
        new NodeRealizerIntersectionCalculator(graph, true);
    graph.addDataProvider(IntersectionCalculator.SOURCE_INTERSECTION_CALCULATOR_DPKEY, nrics);
    final NodeRealizerIntersectionCalculator nrict =
        new NodeRealizerIntersectionCalculator(graph, false);
    graph.addDataProvider(IntersectionCalculator.TARGET_INTERSECTION_CALCULATOR_DPKEY, nrict);

    pc.doLayout(graph);
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:26,代码来源:LayoutFunctions.java

示例4: getCircularLayout

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
/**
 * Creates a circular layouter from the current settings.
 * 
 * @param settings The settings object to create the layouter from.
 * 
 * @return The created layouter.
 */
public static CanonicMultiStageLayouter getCircularLayout(final ZyGraphLayoutSettings settings) {
  Preconditions.checkNotNull(settings, "IE00894: Settings argument can not be null");

  final CircularStyle style = settings.getCircularSettings().getStyle();
  final long minNodeDist = settings.getCircularSettings().getMinimumNodeDistance();

  return ZyGraphLayouter.createCircularLayouter(style, minNodeDist);
}
 
开发者ID:google,项目名称:binnavi,代码行数:16,代码来源:ZyLayoutCreator.java

示例5: getHierarchicLayout

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
/**
 * Creates a hierarchic layouter from the current settings.
 * 
 * @param settings The settings object to create the layouter from.
 * 
 * @return The created layouter.
 */
public static CanonicMultiStageLayouter getHierarchicLayout(final ZyGraphLayoutSettings settings) {
  Preconditions.checkNotNull(settings, "IE00895: Settings argument can not be null");

  final HierarchicStyle style = settings.getHierarchicalSettings().getStyle();
  final long minLayerDist = settings.getHierarchicalSettings().getMinimumLayerDistance();
  final long minNodeDist = settings.getHierarchicalSettings().getMinimumNodeDistance();
  final long minEdgeDist = settings.getHierarchicalSettings().getMinimumEdgeDistance();
  final long minNodeEdgeDist = settings.getHierarchicalSettings().getMinimumNodeEdgeDistance();
  final HierarchicOrientation orientation = settings.getHierarchicalSettings().getOrientation();

  return ZyGraphLayouter.createHierarchicalLayouter(style, minLayerDist, minNodeDist,
      minEdgeDist, minNodeEdgeDist, orientation);
}
 
开发者ID:google,项目名称:binnavi,代码行数:21,代码来源:ZyLayoutCreator.java

示例6: getOrthogonalLayout

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
/**
 * Creates an orthogonal layouter from the current settings.
 * 
 * @param settings The settings object to create the layouter from.
 * 
 * @return The created layouter.
 */
public static CanonicMultiStageLayouter getOrthogonalLayout(final ZyGraphLayoutSettings settings) {
  Preconditions.checkNotNull(settings, "IE00896: Settings argument can not be null");

  final OrthogonalStyle style = settings.getOrthogonalSettings().getStyle();
  final long gridSize = settings.getOrthogonalSettings().getMinimumNodeDistance();

  return ZyGraphLayouter.createOrthoLayouter(style, gridSize, true);
}
 
开发者ID:google,项目名称:binnavi,代码行数:16,代码来源:ZyLayoutCreator.java

示例7: createCircularLayouter

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
public static CanonicMultiStageLayouter createCircularLayouter(final CircularStyle style,
    final long minNodeDist) {
  Preconditions.checkNotNull(style, "Internal Error: Layout style can't be null");
  Preconditions.checkArgument(minNodeDist >= 0,
      "Internal Error: Minimum node distance can't be negative");

  final CircularLayouter layouter = new CircularLayouter();

  switch (style) {
    case COMPACT:
      layouter.setLayoutStyle(CircularLayouter.BCC_COMPACT);
      break;
    case ISOLATED:
      layouter.setLayoutStyle(CircularLayouter.BCC_ISOLATED);
      break;
    case SINGLE_CIRCLE:
      layouter.setLayoutStyle(CircularLayouter.SINGLE_CYCLE);
      break;
    default:
      throw new IllegalStateException("Internal Error: Unknown layout style");
  }

  layouter.setPartitionLayoutStyle(CircularLayouter.PARTITION_LAYOUTSTYLE_CYCLIC);

  final SingleCycleLayouter cycleLayouter = layouter.getSingleCycleLayouter();
  cycleLayouter.setAutomaticRadius(true);

  cycleLayouter.setMinimalNodeDistance((int) minNodeDist);
  final BalloonLayouter bl = layouter.getBalloonLayouter();
  bl.setMinimalEdgeLength((int) minNodeDist);

  bl.setAllowOverlaps(false);

  return layouter;
}
 
开发者ID:google,项目名称:binnavi,代码行数:36,代码来源:ZyGraphLayouter.java

示例8: layout

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
/**
 * Layouts the ANTIBODY graph.
 * 
 * @param abstractGraph
 * @param abstractGraphLayouter instance of {@link AbstractGraphService#createLayouter()} or {@code null} to create a
 *          new instance.
 */
public static void layout(Graph2D abstractGraph, CanonicMultiStageLayouter abstractGraphLayouter) {
  if (abstractGraphLayouter == null) {
    abstractGraphLayouter = createLayouter();
  }
  final Graph2DLayoutExecutor layoutExecutor = new Graph2DLayoutExecutor();
  layoutExecutor.doLayout(abstractGraph, abstractGraphLayouter);
}
 
开发者ID:PistoiaHELM,项目名称:HELMAntibodyEditor,代码行数:15,代码来源:AbstractGraphLayoutService.java

示例9: setCurrentLayouter

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
/**
 * Sets the current layouter.
 *
 * @param layouter The new layouter.
 */
private void setCurrentLayouter(final CanonicMultiStageLayouter layouter) {
  m_currentLayouter =
      Preconditions.checkNotNull(layouter, "IE02249: Layouter argument can't be null");
}
 
开发者ID:google,项目名称:binnavi,代码行数:10,代码来源:ZyGraphLayoutSettings.java

示例10: getCurrentLayouter

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
/**
 * Returns the current layouter.
 *
 * @return The current layouter.
 */
@Override
public CanonicMultiStageLayouter getCurrentLayouter() {
  return m_currentLayouter;
}
 
开发者ID:google,项目名称:binnavi,代码行数:10,代码来源:ZyGraphLayoutSettings.java

示例11: getCurrentLayouter

import y.layout.CanonicMultiStageLayouter; //导入依赖的package包/类
CanonicMultiStageLayouter getCurrentLayouter(); 
开发者ID:google,项目名称:binnavi,代码行数:2,代码来源:ILayoutSettings.java


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