diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/LayoutBuilder.java')
-rwxr-xr-x | sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/LayoutBuilder.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/LayoutBuilder.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/LayoutBuilder.java index a34e9e83b0..d67dee1629 100755 --- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/LayoutBuilder.java +++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/LayoutBuilder.java @@ -35,7 +35,8 @@ public class LayoutBuilder { private int totalLevel; private int totalLane; - private Entity[][] grid; + private int totalHeight; + private int totalWidth; private int[][] graph; @@ -94,7 +95,7 @@ public class LayoutBuilder { sortEntities(); // Build the grid for entities - grid = new Entity[totalLane + 1][totalLevel + 1]; + Entity[][] grid = new Entity[totalLane + 1][totalLevel + 1]; int[] height = new int[totalLevel + 1]; int[] width = new int[totalLane + 1]; @@ -116,6 +117,9 @@ public class LayoutBuilder { height[j] += height[j - 1]; } + totalWidth = width[totalLane]; + totalHeight = height[totalLevel]; + for (int i = 0; i < totalLane + 1; i++) { for (int j = 0; j < totalLevel + 1; j++) { Entity ent = grid[i][j]; @@ -273,4 +277,20 @@ public class LayoutBuilder { } } + public int getTotalLevel() { + return totalLevel; + } + + public int getTotalLane() { + return totalLane; + } + + public int getTotalHeight() { + return totalHeight; + } + + public int getTotalWidth() { + return totalWidth; + } + } |