diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-05-30 08:37:45 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-05-30 08:37:45 +0200 |
| commit | b086f57f56bf0eb9dab9cf321a0f69aaaae84347 (patch) | |
| tree | 8e6e26e8b7eed6abad7a17b093bdbb55c5e6b1ba /src/main/java/com/c2kernel/collection/AggregationDescription.java | |
| parent | 22088ae8d2d5ff390518dbe1c4372325ffb3a647 (diff) | |
Initial Maven Conversion
Diffstat (limited to 'src/main/java/com/c2kernel/collection/AggregationDescription.java')
| -rw-r--r-- | src/main/java/com/c2kernel/collection/AggregationDescription.java | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/main/java/com/c2kernel/collection/AggregationDescription.java b/src/main/java/com/c2kernel/collection/AggregationDescription.java new file mode 100644 index 0000000..a046871 --- /dev/null +++ b/src/main/java/com/c2kernel/collection/AggregationDescription.java @@ -0,0 +1,59 @@ +package com.c2kernel.collection;
+
+/**
+ * @version $Revision: 1.34 $ $Date: 2004/03/23 09:29:41 $
+ * @author $Author: abranson $
+ */
+
+import com.c2kernel.graph.model.Vertex;
+import com.c2kernel.property.PropertyDescriptionList;
+import com.c2kernel.property.PropertyUtility;
+import com.c2kernel.utils.Logger;
+
+public class AggregationDescription extends Aggregation implements CollectionDescription<AggregationMember>
+{
+
+ public AggregationDescription()
+ {
+ setName("AggregationDescription");
+ }
+
+ public AggregationDescription(String name)
+ {
+ setName(name);
+ }
+
+
+ @Override
+ public Aggregation newInstance()
+ {
+ AggregationInstance newInstance = new AggregationInstance(getName());
+ newInstance.setURLInfo(getURLInfo());
+ //for each desc member
+ for (int i=0; i<size(); i++)
+ {
+ AggregationMember mem = mMembers.list.get(i);
+ //get the propdesc of the member item
+ PropertyDescriptionList pdList = PropertyUtility.getPropertyDescriptionOutcome(mem.getEntityKey());
+ if (pdList!=null)
+ {
+ //create the new props of the member object
+ try {
+ Vertex v = getLayout().getVertexById(mem.getID());
+ newInstance.addMember(-1, PropertyUtility.createProperty(pdList), pdList.getClassProps(),v.getCentrePoint(),v.getWidth(),v.getHeight());
+ } catch (MembershipException e) {
+ // won't happen as we're not assigning an entity
+ }
+ }
+ else
+ {
+ Logger.error("AggregationDescription::newInstance() There is no PropertyDescription. Cannot instantiate. " + mem.getEntityKey());
+ return null;
+ }
+
+
+ }
+
+ return newInstance;
+ }
+}
|
