Пример #1
0
  public void doLayout(
      TLayoutType layoutType,
      boolean isAllElementsLayouted,
      boolean isAnimated,
      int xOffset,
      int yOffset,
      final int xGap,
      final int yGap) {
    if (layoutType.equals(TLayoutType.SPRING_LAYOUT_TYPE)) {
      layouter.start();
    } else if (layoutType.equals(TLayoutType.RANDOM_LAYOUT_TYPE)) {
      layouter.stop();
      layouter.random(0, 600);
    } else {
      layouter.stop();

      graph.doLayout(
          isAllElementsLayouted
              ? graph.getDataBox().getAllElements().iterator()
              : graph.getDataBox().getSelectionModel().getAllSelectedElement().iterator(),
          layoutType.getType(),
          isAnimated,
          null,
          xOffset,
          yOffset,
          new Generator() {
            public Object generate(Object object) {
              Element element = (Element) object;
              if (element instanceof Group) {
                return null;
              }

              return new Dimension(xGap, yGap);
            }
          });
    }
  }
Пример #2
0
 public void setUpdateDuration(int updateDuration) {
   layouter.setUpdateDuration(updateDuration);
 }
Пример #3
0
 public int getUpdateDuration() {
   return layouter.getUpdateDuration();
 }
Пример #4
0
 public void setStepSize(int stepSize) {
   layouter.setStepSize(stepSize);
 }
Пример #5
0
 public int getStepSize() {
   return layouter.getStepSize();
 }
Пример #6
0
 public void setForceSize(int forceSize) {
   layouter.setForceSize(forceSize);
 }
Пример #7
0
 public int getForceSize() {
   return layouter.getForceSize();
 }
Пример #8
0
 public void stop() {
   layouter.stop();
 }
Пример #9
0
 public void start() {
   layouter.start();
 }