예제 #1
0
 protected void sortVertices() {
   layerPartition =
       new DefaultLayerPartition(digraph, rankFunction, vertexShape, subgraphPartition);
   layerPartition.breadthFirstSort();
   int crossingCount = layerPartition.countCrossings();
   Map orderSnapshot = layerPartition.makeOrderSnapshot();
   boolean lastIsBest = true;
   for (int i = 0; i < sortIterationCount; i++) {
     if (i % 2 == 0) layerPartition.sortDownByMedian();
     else layerPartition.sortUpByMedian();
     int newCrossingCount = layerPartition.countCrossings();
     if (newCrossingCount < crossingCount) {
       crossingCount = newCrossingCount;
       orderSnapshot = layerPartition.makeOrderSnapshot();
       lastIsBest = true;
     } else if (newCrossingCount > crossingCount) lastIsBest = false;
   }
   if (!lastIsBest) layerPartition.restoreOrder(orderSnapshot);
   layerPartition.refreshIndices();
 }
예제 #2
0
  protected void positionVertices() {
    layerPartition.setAlternatePendulumTraversals(false);
    layerPartition.setHorizontalSpacing(horizontalSpacing);
    layerPartition.setVerticalSpacing(verticalSpacing);
    layerPartition.setVerticalAlignment(verticalAligment);
    layerPartition.setRubberForceThreshold(1.0);

    layerPartition.createSubgraphPartition();
    //    layerPartition.printLayers();
    layerPartition.positionDummies();
    layerPartition.setDummyFixed(true);
    layerPartition.balancePendulum(100);
    layerPartition.balanceRubberBends(100);
    layerPartition.positionLayers();
    layerPartition.updateGeometry(vertexShape, areaBounds);
  }
예제 #3
0
 protected void positionArcs() {
   arcGeometry = layerPartition.positionArcs();
 }