diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-09-22 19:44:45 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-09-22 19:44:45 +0000 |
commit | 9f4dbf871c06cb8657c43204cd7fc1650f44bdf2 (patch) | |
tree | 7dab1d2ac9b72f268f89395392f1c79d8116c106 /sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java | |
parent | 9f1b3ecdad8b8ac6d305744e2a1d17cf3ef383d6 (diff) |
Fix the dimension calculation based on the layout
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1174345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java')
-rwxr-xr-x | sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java | 139 |
1 files changed, 9 insertions, 130 deletions
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java index bd0a71431f..1520b0ae83 100755 --- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java +++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/CompositeEntity.java @@ -65,20 +65,8 @@ public class CompositeEntity extends Entity { } public void build() { - int h = 0; - int w = 0; - - for (ComponentEntity ent : componentList) { - - if (ent.getLevel() > maxInternalLevel) { - maxInternalLevel = ent.getLevel(); - h += (ent.getHeight() + Constant.COMPONENT_DEFAULT_HEIGHT); - } - if (ent.getLane() > maxInternalLane) { - maxInternalLane = ent.getLane(); - w += (ent.getWidth() + Constant.COMPONENT_DEFAULT_WIDTH); - } - } + int h = height; + int w = width; // Find the services height int size1 = services.size(); @@ -183,121 +171,12 @@ public class CompositeEntity extends Entity { return fileNameSuffix; } - // public int getNoOfRefs(){ - // return references.size(); - // } - // - // public int getNoOfSers(){ - // return services.size(); - // } - // - // public int getNoOfProps(){ - // return properties.size(); - // } - // - // public int getNoOfAdjacentUnits(){ - // return adjacentEntities.size(); - // } - // - // /** - // * Put a value to referenceToServiceMap - // * @param ref - // * @param ser - // * @return successfully added or not - // */ - // //assumption there can not be two services for the same reference - // public boolean addToRefToSerMap(String ref, String ser){ - // //ref = ref.toLowerCase(); - // //ser = ser.toLowerCase(); - // - // if (referenceToServiceMap.containsKey(ref)) - // return false; - // - // referenceToServiceMap.put(ref, ser); - // return true; - // } - // - // /** - // * Retrieve a service name for a given reference - // * @param ref - // * @return service name - // */ - // public String getSerOfRef(String ref){ - // //ref = ref.toLowerCase(); - // - // if (!referenceToServiceMap.containsKey(ref)) - // return null; - // - // return referenceToServiceMap.get(ref); - // } - // - // public void addAService(String serName){ - // //serName = serName.toLowerCase(); - // services.add(serName); - // - // } - // - // public void addAReference(String refName){ - // //refName = refName.toLowerCase(); - // references.add(refName); - // - // } - // - // public void addAProperty(String propName){ - // //propName = propName.toLowerCase(); - // properties.add(propName); - // - // } - // - // public void addAnAdjacentEntity(String x){ - //// System.out.println("eee "+x); - // adjacentEntities.add(x); - // - // } - // - // public void addAnConnectedEntity(String x){ - //// System.out.println("eee "+x); - // adjacentEntities.add(x); - // - // } - // - // public HashMap<String, String> getReferenceToServiceMap() { - // return referenceToServiceMap; - // } - // public void setReferenceToServiceMap( - // HashMap<String, String> referenceToServiceMap) { - // this.referenceToServiceMap = referenceToServiceMap; - // } - // public ArrayList<String> getProperties() { - // return properties; - // } - // public void setProperties(ArrayList<String> properties) { - // this.properties = properties; - // } - // public HashSet<String> getAdjacentEntities() { - // return adjacentEntities; - // } - // public void setAdjacentEntities(HashSet<String> adjacentEntities) { - // this.adjacentEntities = adjacentEntities; - // } - // public void setServices(ArrayList<String> services) { - // this.services = services; - // } - // - // public ArrayList<String> getServices() { - // return services; - // } - // - // public ArrayList<String> getReferences() { - // return references; - // } - - // public void setConnectedEntities(HashSet<String> connectedEntities) { - // this.connectedEntities = connectedEntities; - // } - // - // public HashSet<String> getConnectedEntities() { - // return connectedEntities; - // } + public void setMaxInternalLevel(int maxInternalLevel) { + this.maxInternalLevel = maxInternalLevel; + } + + public void setMaxInternalLane(int maxInternalLane) { + this.maxInternalLane = maxInternalLane; + } } |