예제 #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();
 }