From 254ee6f47eebfc00462c10756a92066e82cc1a96 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 21 Jun 2011 15:46:02 +0200 Subject: Initial commit --- .../gui/model/AggregationVertexFactory.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 source/com/c2kernel/collection/gui/model/AggregationVertexFactory.java (limited to 'source/com/c2kernel/collection/gui/model/AggregationVertexFactory.java') diff --git a/source/com/c2kernel/collection/gui/model/AggregationVertexFactory.java b/source/com/c2kernel/collection/gui/model/AggregationVertexFactory.java new file mode 100755 index 0000000..d99ef3c --- /dev/null +++ b/source/com/c2kernel/collection/gui/model/AggregationVertexFactory.java @@ -0,0 +1,44 @@ +package com.c2kernel.collection.gui.model; + +import java.awt.Point; + +import com.c2kernel.collection.Aggregation; +import com.c2kernel.collection.MembershipException; +import com.c2kernel.graph.model.GraphModelManager; +import com.c2kernel.graph.model.GraphPoint; +import com.c2kernel.graph.model.TypeNameAndConstructionInfo; +import com.c2kernel.graph.model.VertexFactory; +import com.c2kernel.utils.CastorHashMap; +import com.c2kernel.utils.Logger; + + +public class AggregationVertexFactory implements VertexFactory +{ + private Aggregation mAggregation = null; + + + public void setCreationContext(Object aggregation) + { + if (aggregation != null && aggregation instanceof Aggregation) + mAggregation = (Aggregation)aggregation; + } + + + public void create + ( + GraphModelManager graphModelManager, + Point location, + TypeNameAndConstructionInfo typeNameAndConstructionInfo + ) + { + if (typeNameAndConstructionInfo.mInfo.equals("AggregationMember")) { + try { + mAggregation.addMember(-1, new CastorHashMap(), "", new GraphPoint(location.x, location.y), 40, 40); + } catch (MembershipException ex) { + Logger.error(ex); + Logger.exceptionDialog(ex); + } + } + } +} + -- cgit v1.2.3