Lines 155-160
Link Here
|
155 |
} |
155 |
} |
156 |
|
156 |
|
157 |
private NodeMapping createNodeMapping(Node nodeDef, EClass domainMetaElement, DiagramLabel labelDef, EAttribute editFeature, EReference containmentFeature) { |
157 |
private NodeMapping createNodeMapping(Node nodeDef, EClass domainMetaElement, DiagramLabel labelDef, EAttribute editFeature, EReference containmentFeature) { |
|
|
158 |
return createNodeMapping(nodeDef, domainMetaElement, labelDef, editFeature, containmentFeature, true); |
159 |
} |
160 |
|
161 |
protected final NodeMapping createNodeMapping(Node nodeDef, EClass domainMetaElement, DiagramLabel labelDef, EAttribute editFeature, EReference containmentFeature, boolean addTopNodeReference) { |
158 |
NodeMapping nme = GMFMapFactory.eINSTANCE.createNodeMapping(); |
162 |
NodeMapping nme = GMFMapFactory.eINSTANCE.createNodeMapping(); |
159 |
nme.setDiagramNode(nodeDef); |
163 |
nme.setDiagramNode(nodeDef); |
160 |
nme.setDomainMetaElement(domainMetaElement); |
164 |
nme.setDomainMetaElement(domainMetaElement); |
Lines 166-178
Link Here
|
166 |
} |
170 |
} |
167 |
// FIXME nme.setTool(GMFMapFactory.eINSTANCE.createCreationTool()); |
171 |
// FIXME nme.setTool(GMFMapFactory.eINSTANCE.createCreationTool()); |
168 |
setupNodeMapping(nme); |
172 |
setupNodeMapping(nme); |
169 |
TopNodeReference tnr = GMFMapFactory.eINSTANCE.createTopNodeReference(); |
173 |
|
170 |
tnr.setOwnedChild(nme); |
174 |
if (addTopNodeReference){ |
171 |
tnr.setContainmentFeature(containmentFeature); |
175 |
TopNodeReference tnr = GMFMapFactory.eINSTANCE.createTopNodeReference(); |
172 |
myMap.getNodes().add(tnr); |
176 |
tnr.setOwnedChild(nme); |
|
|
177 |
tnr.setContainmentFeature(containmentFeature); |
178 |
myMap.getNodes().add(tnr); |
179 |
} |
173 |
return nme; |
180 |
return nme; |
174 |
} |
181 |
} |
175 |
|
182 |
|
176 |
protected void addCreationConstraints(LinkMapping linkMapping, String sourceConstraint, String endConstraint) { |
183 |
protected void addCreationConstraints(LinkMapping linkMapping, String sourceConstraint, String endConstraint) { |
177 |
LinkConstraints constraints = GMFMapFactory.eINSTANCE.createLinkConstraints(); |
184 |
LinkConstraints constraints = GMFMapFactory.eINSTANCE.createLinkConstraints(); |
178 |
Constraint source = GMFMapFactory.eINSTANCE.createConstraint(); |
185 |
Constraint source = GMFMapFactory.eINSTANCE.createConstraint(); |