1 | /* |
2 | * Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.part; |
5 | |
6 | import java.util.Collection; |
7 | import java.util.Collections; |
8 | import java.util.Iterator; |
9 | import java.util.LinkedList; |
10 | import java.util.List; |
11 | import java.util.Map; |
12 | |
13 | import org.eclipse.emf.ecore.EObject; |
14 | import org.eclipse.emf.ecore.EStructuralFeature; |
15 | import org.eclipse.emf.ecore.resource.Resource; |
16 | import org.eclipse.emf.ecore.util.EcoreUtil; |
17 | import org.eclipse.gmf.runtime.notation.View; |
18 | |
19 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyConnector; |
20 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyContext; |
21 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyEventConnector; |
22 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyInfrastructureConnector; |
23 | import de.uka.ipd.sdq.pcm.core.composition.ComposedStructure; |
24 | import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage; |
25 | import de.uka.ipd.sdq.pcm.core.composition.ProvidedDelegationConnector; |
26 | import de.uka.ipd.sdq.pcm.core.composition.RequiredDelegationConnector; |
27 | import de.uka.ipd.sdq.pcm.core.entity.ComposedProvidingRequiringEntity; |
28 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyConnectorEditPart; |
29 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyContextEditPart; |
30 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyEventConnectorEditPart; |
31 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyInfrastructureConnectorEditPart; |
32 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntity2EditPart; |
33 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentEditPart; |
34 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntityEditPart; |
35 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.InfrastructureProvidedRoleEditPart; |
36 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.InfrastructureRequiredRoleEditPart; |
37 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationProvidedRole2EditPart; |
38 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationProvidedRoleEditPart; |
39 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationRequiredRole2EditPart; |
40 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationRequiredRoleEditPart; |
41 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ProvidedDelegationConnectorEditPart; |
42 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.RequiredDelegationConnectorEditPart; |
43 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.SinkRoleEditPart; |
44 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.SourceRoleEditPart; |
45 | import de.uka.ipd.sdq.pcm.gmf.composite.providers.PalladioComponentModelElementTypes; |
46 | import de.uka.ipd.sdq.pcm.repository.InfrastructureProvidedRole; |
47 | import de.uka.ipd.sdq.pcm.repository.InfrastructureRequiredRole; |
48 | import de.uka.ipd.sdq.pcm.repository.OperationProvidedRole; |
49 | import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole; |
50 | import de.uka.ipd.sdq.pcm.repository.ProvidedRole; |
51 | import de.uka.ipd.sdq.pcm.repository.RepositoryComponent; |
52 | import de.uka.ipd.sdq.pcm.repository.RequiredRole; |
53 | import de.uka.ipd.sdq.pcm.repository.SinkRole; |
54 | import de.uka.ipd.sdq.pcm.repository.SourceRole; |
55 | |
56 | /** |
57 | * @generated |
58 | */ |
59 | public class PalladioComponentModelDiagramUpdater { |
60 | |
61 | /** |
62 | * @generated |
63 | */ |
64 | public static List getSemanticChildren(View view) { |
65 | switch (PalladioComponentModelVisualIDRegistry.getVisualID(view)) { |
66 | case ComposedProvidingRequiringEntity2EditPart.VISUAL_ID: |
67 | return getComposedProvidingRequiringEntity_2002SemanticChildren(view); |
68 | case AssemblyContextEditPart.VISUAL_ID: |
69 | return getAssemblyContext_3006SemanticChildren(view); |
70 | case ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentEditPart.VISUAL_ID: |
71 | return getComposedProvidingRequiringEntityCompositeStructureInnerCompartment_7002SemanticChildren(view); |
72 | case ComposedProvidingRequiringEntityEditPart.VISUAL_ID: |
73 | return getComposedProvidingRequiringEntity_1000SemanticChildren(view); |
74 | } |
75 | return Collections.EMPTY_LIST; |
76 | } |
77 | |
78 | /** |
79 | * @generated |
80 | */ |
81 | public static List getComposedProvidingRequiringEntity_2002SemanticChildren( |
82 | View view) { |
83 | if (!view.isSetElement()) { |
84 | return Collections.EMPTY_LIST; |
85 | } |
86 | ComposedProvidingRequiringEntity modelElement = (ComposedProvidingRequiringEntity) view |
87 | .getElement(); |
88 | List result = new LinkedList(); |
89 | for (Iterator it = modelElement |
90 | .getProvidedRoles_InterfaceProvidingEntity().iterator(); it |
91 | .hasNext();) { |
92 | ProvidedRole childElement = (ProvidedRole) it.next(); |
93 | int visualID = PalladioComponentModelVisualIDRegistry |
94 | .getNodeVisualID(view, childElement); |
95 | if (visualID == OperationProvidedRole2EditPart.VISUAL_ID) { |
96 | result.add(new PalladioComponentModelNodeDescriptor( |
97 | childElement, visualID)); |
98 | continue; |
99 | } |
100 | } |
101 | for (Iterator it = modelElement |
102 | .getRequiredRoles_InterfaceRequiringEntity().iterator(); it |
103 | .hasNext();) { |
104 | RequiredRole childElement = (RequiredRole) it.next(); |
105 | int visualID = PalladioComponentModelVisualIDRegistry |
106 | .getNodeVisualID(view, childElement); |
107 | if (visualID == OperationRequiredRole2EditPart.VISUAL_ID) { |
108 | result.add(new PalladioComponentModelNodeDescriptor( |
109 | childElement, visualID)); |
110 | continue; |
111 | } |
112 | } |
113 | return result; |
114 | } |
115 | |
116 | /** |
117 | * Get the list of semantic children for an AssemblyContext. |
118 | * |
119 | * This method is overridden, because it is has to return the |
120 | * provided and required roles of the component encapsulated by the |
121 | * AssemblyContext and not the direct children of the context. |
122 | * |
123 | * TODO: This method contains duplicated semantic to the AssemblyContextCanonicalEditPolicy |
124 | * The CononicalEditPolicy method might include a call to this one and because of this |
125 | * it has to be checked if the generated not in the AssemblyContextCanonicalEditPolicy could be removed |
126 | * |
127 | * @generated not |
128 | */ |
129 | public static List getAssemblyContext_3006SemanticChildren(View view) { |
130 | if (!view.isSetElement()) { |
131 | return Collections.EMPTY_LIST; |
132 | } |
133 | AssemblyContext modelElement = (AssemblyContext) view.getElement(); |
134 | // Manual navigation to the associated component is required |
135 | RepositoryComponent component = modelElement |
136 | .getEncapsulatedComponent__AssemblyContext(); |
137 | |
138 | // check if the component is really set for this assembly context. otherwise, it will break |
139 | if (component == null) { |
140 | return Collections.EMPTY_LIST; |
141 | } |
142 | |
143 | List result = new LinkedList(); |
144 | for (Iterator it = component |
145 | .getProvidedRoles_InterfaceProvidingEntity().iterator(); it |
146 | .hasNext();) { |
147 | ProvidedRole childElement = (ProvidedRole) it.next(); |
148 | int visualID = PalladioComponentModelVisualIDRegistry |
149 | .getNodeVisualID(view, childElement); |
150 | if (visualID == OperationProvidedRoleEditPart.VISUAL_ID) { |
151 | result.add(new PalladioComponentModelNodeDescriptor( |
152 | childElement, visualID)); |
153 | continue; |
154 | } |
155 | } |
156 | for (Iterator it = component |
157 | .getRequiredRoles_InterfaceRequiringEntity().iterator(); it |
158 | .hasNext();) { |
159 | RequiredRole childElement = (RequiredRole) it.next(); |
160 | int visualID = PalladioComponentModelVisualIDRegistry |
161 | .getNodeVisualID(view, childElement); |
162 | if (visualID == OperationRequiredRoleEditPart.VISUAL_ID) { |
163 | result.add(new PalladioComponentModelNodeDescriptor( |
164 | childElement, visualID)); |
165 | continue; |
166 | } |
167 | } |
168 | return result; |
169 | } |
170 | |
171 | /** |
172 | * @generated |
173 | */ |
174 | public static List getComposedProvidingRequiringEntityCompositeStructureInnerCompartment_7002SemanticChildren( |
175 | View view) { |
176 | if (false == view.eContainer() instanceof View) { |
177 | return Collections.EMPTY_LIST; |
178 | } |
179 | View containerView = (View) view.eContainer(); |
180 | if (!containerView.isSetElement()) { |
181 | return Collections.EMPTY_LIST; |
182 | } |
183 | ComposedProvidingRequiringEntity modelElement = (ComposedProvidingRequiringEntity) containerView |
184 | .getElement(); |
185 | List result = new LinkedList(); |
186 | for (Iterator it = modelElement |
187 | .getProvidedRoles_InterfaceProvidingEntity().iterator(); it |
188 | .hasNext();) { |
189 | ProvidedRole childElement = (ProvidedRole) it.next(); |
190 | int visualID = PalladioComponentModelVisualIDRegistry |
191 | .getNodeVisualID(view, childElement); |
192 | if (visualID == AssemblyContextEditPart.VISUAL_ID) { |
193 | result.add(new PalladioComponentModelNodeDescriptor( |
194 | childElement, visualID)); |
195 | continue; |
196 | } |
197 | } |
198 | return result; |
199 | } |
200 | |
201 | /** |
202 | * @generated |
203 | */ |
204 | public static List getComposedProvidingRequiringEntity_1000SemanticChildren( |
205 | View view) { |
206 | if (!view.isSetElement()) { |
207 | return Collections.EMPTY_LIST; |
208 | } |
209 | ComposedProvidingRequiringEntity modelElement = (ComposedProvidingRequiringEntity) view |
210 | .getElement(); |
211 | List result = new LinkedList(); |
212 | Resource resource = modelElement.eResource(); |
213 | for (Iterator semanticIterator = getPhantomNodesIterator(resource); semanticIterator |
214 | .hasNext();) { |
215 | EObject childElement = (EObject) semanticIterator.next(); |
216 | if (childElement == modelElement) { |
217 | continue; |
218 | } |
219 | if (PalladioComponentModelVisualIDRegistry.getNodeVisualID(view, |
220 | childElement) == ComposedProvidingRequiringEntity2EditPart.VISUAL_ID) { |
221 | result.add(new PalladioComponentModelNodeDescriptor( |
222 | childElement, |
223 | ComposedProvidingRequiringEntity2EditPart.VISUAL_ID)); |
224 | continue; |
225 | } |
226 | } |
227 | return result; |
228 | } |
229 | |
230 | /** |
231 | * @generated |
232 | */ |
233 | private static Iterator getPhantomNodesIterator(Resource resource) { |
234 | return resource.getAllContents(); |
235 | } |
236 | |
237 | /** |
238 | * @generated |
239 | */ |
240 | public static List getContainedLinks(View view) { |
241 | switch (PalladioComponentModelVisualIDRegistry.getVisualID(view)) { |
242 | case ComposedProvidingRequiringEntityEditPart.VISUAL_ID: |
243 | return getComposedProvidingRequiringEntity_1000ContainedLinks(view); |
244 | case ComposedProvidingRequiringEntity2EditPart.VISUAL_ID: |
245 | return getComposedProvidingRequiringEntity_2002ContainedLinks(view); |
246 | case AssemblyContextEditPart.VISUAL_ID: |
247 | return getAssemblyContext_3006ContainedLinks(view); |
248 | case OperationProvidedRoleEditPart.VISUAL_ID: |
249 | return getOperationProvidedRole_3007ContainedLinks(view); |
250 | case OperationRequiredRoleEditPart.VISUAL_ID: |
251 | return getOperationRequiredRole_3008ContainedLinks(view); |
252 | case SourceRoleEditPart.VISUAL_ID: |
253 | return getSourceRole_3013ContainedLinks(view); |
254 | case SinkRoleEditPart.VISUAL_ID: |
255 | return getSinkRole_3014ContainedLinks(view); |
256 | case InfrastructureProvidedRoleEditPart.VISUAL_ID: |
257 | return getInfrastructureProvidedRole_3015ContainedLinks(view); |
258 | case InfrastructureRequiredRoleEditPart.VISUAL_ID: |
259 | return getInfrastructureRequiredRole_3016ContainedLinks(view); |
260 | case OperationProvidedRole2EditPart.VISUAL_ID: |
261 | return getOperationProvidedRole_3011ContainedLinks(view); |
262 | case OperationRequiredRole2EditPart.VISUAL_ID: |
263 | return getOperationRequiredRole_3012ContainedLinks(view); |
264 | case AssemblyConnectorEditPart.VISUAL_ID: |
265 | return getAssemblyConnector_4004ContainedLinks(view); |
266 | case AssemblyEventConnectorEditPart.VISUAL_ID: |
267 | return getAssemblyEventConnector_4007ContainedLinks(view); |
268 | case RequiredDelegationConnectorEditPart.VISUAL_ID: |
269 | return getRequiredDelegationConnector_4005ContainedLinks(view); |
270 | case ProvidedDelegationConnectorEditPart.VISUAL_ID: |
271 | return getProvidedDelegationConnector_4006ContainedLinks(view); |
272 | case AssemblyInfrastructureConnectorEditPart.VISUAL_ID: |
273 | return getAssemblyInfrastructureConnector_4008ContainedLinks(view); |
274 | } |
275 | return Collections.EMPTY_LIST; |
276 | } |
277 | |
278 | /** |
279 | * @generated |
280 | */ |
281 | public static List getIncomingLinks(View view) { |
282 | switch (PalladioComponentModelVisualIDRegistry.getVisualID(view)) { |
283 | case ComposedProvidingRequiringEntity2EditPart.VISUAL_ID: |
284 | return getComposedProvidingRequiringEntity_2002IncomingLinks(view); |
285 | case AssemblyContextEditPart.VISUAL_ID: |
286 | return getAssemblyContext_3006IncomingLinks(view); |
287 | case OperationProvidedRoleEditPart.VISUAL_ID: |
288 | return getOperationProvidedRole_3007IncomingLinks(view); |
289 | case OperationRequiredRoleEditPart.VISUAL_ID: |
290 | return getOperationRequiredRole_3008IncomingLinks(view); |
291 | case SourceRoleEditPart.VISUAL_ID: |
292 | return getSourceRole_3013IncomingLinks(view); |
293 | case SinkRoleEditPart.VISUAL_ID: |
294 | return getSinkRole_3014IncomingLinks(view); |
295 | case InfrastructureProvidedRoleEditPart.VISUAL_ID: |
296 | return getInfrastructureProvidedRole_3015IncomingLinks(view); |
297 | case InfrastructureRequiredRoleEditPart.VISUAL_ID: |
298 | return getInfrastructureRequiredRole_3016IncomingLinks(view); |
299 | case OperationProvidedRole2EditPart.VISUAL_ID: |
300 | return getOperationProvidedRole_3011IncomingLinks(view); |
301 | case OperationRequiredRole2EditPart.VISUAL_ID: |
302 | return getOperationRequiredRole_3012IncomingLinks(view); |
303 | case AssemblyConnectorEditPart.VISUAL_ID: |
304 | return getAssemblyConnector_4004IncomingLinks(view); |
305 | case AssemblyEventConnectorEditPart.VISUAL_ID: |
306 | return getAssemblyEventConnector_4007IncomingLinks(view); |
307 | case RequiredDelegationConnectorEditPart.VISUAL_ID: |
308 | return getRequiredDelegationConnector_4005IncomingLinks(view); |
309 | case ProvidedDelegationConnectorEditPart.VISUAL_ID: |
310 | return getProvidedDelegationConnector_4006IncomingLinks(view); |
311 | case AssemblyInfrastructureConnectorEditPart.VISUAL_ID: |
312 | return getAssemblyInfrastructureConnector_4008IncomingLinks(view); |
313 | } |
314 | return Collections.EMPTY_LIST; |
315 | } |
316 | |
317 | /** |
318 | * @generated |
319 | */ |
320 | public static List getOutgoingLinks(View view) { |
321 | switch (PalladioComponentModelVisualIDRegistry.getVisualID(view)) { |
322 | case ComposedProvidingRequiringEntity2EditPart.VISUAL_ID: |
323 | return getComposedProvidingRequiringEntity_2002OutgoingLinks(view); |
324 | case AssemblyContextEditPart.VISUAL_ID: |
325 | return getAssemblyContext_3006OutgoingLinks(view); |
326 | case OperationProvidedRoleEditPart.VISUAL_ID: |
327 | return getOperationProvidedRole_3007OutgoingLinks(view); |
328 | case OperationRequiredRoleEditPart.VISUAL_ID: |
329 | return getOperationRequiredRole_3008OutgoingLinks(view); |
330 | case SourceRoleEditPart.VISUAL_ID: |
331 | return getSourceRole_3013OutgoingLinks(view); |
332 | case SinkRoleEditPart.VISUAL_ID: |
333 | return getSinkRole_3014OutgoingLinks(view); |
334 | case InfrastructureProvidedRoleEditPart.VISUAL_ID: |
335 | return getInfrastructureProvidedRole_3015OutgoingLinks(view); |
336 | case InfrastructureRequiredRoleEditPart.VISUAL_ID: |
337 | return getInfrastructureRequiredRole_3016OutgoingLinks(view); |
338 | case OperationProvidedRole2EditPart.VISUAL_ID: |
339 | return getOperationProvidedRole_3011OutgoingLinks(view); |
340 | case OperationRequiredRole2EditPart.VISUAL_ID: |
341 | return getOperationRequiredRole_3012OutgoingLinks(view); |
342 | case AssemblyConnectorEditPart.VISUAL_ID: |
343 | return getAssemblyConnector_4004OutgoingLinks(view); |
344 | case AssemblyEventConnectorEditPart.VISUAL_ID: |
345 | return getAssemblyEventConnector_4007OutgoingLinks(view); |
346 | case RequiredDelegationConnectorEditPart.VISUAL_ID: |
347 | return getRequiredDelegationConnector_4005OutgoingLinks(view); |
348 | case ProvidedDelegationConnectorEditPart.VISUAL_ID: |
349 | return getProvidedDelegationConnector_4006OutgoingLinks(view); |
350 | case AssemblyInfrastructureConnectorEditPart.VISUAL_ID: |
351 | return getAssemblyInfrastructureConnector_4008OutgoingLinks(view); |
352 | } |
353 | return Collections.EMPTY_LIST; |
354 | } |
355 | |
356 | /** |
357 | * @generated |
358 | */ |
359 | public static List getComposedProvidingRequiringEntity_1000ContainedLinks( |
360 | View view) { |
361 | ComposedProvidingRequiringEntity modelElement = (ComposedProvidingRequiringEntity) view |
362 | .getElement(); |
363 | List result = new LinkedList(); |
364 | result |
365 | .addAll(getContainedTypeModelFacetLinks_AssemblyConnector_4004(modelElement)); |
366 | result |
367 | .addAll(getContainedTypeModelFacetLinks_AssemblyEventConnector_4007(modelElement)); |
368 | result |
369 | .addAll(getContainedTypeModelFacetLinks_RequiredDelegationConnector_4005(modelElement)); |
370 | result |
371 | .addAll(getContainedTypeModelFacetLinks_ProvidedDelegationConnector_4006(modelElement)); |
372 | result |
373 | .addAll(getContainedTypeModelFacetLinks_AssemblyInfrastructureConnector_4008(modelElement)); |
374 | return result; |
375 | } |
376 | |
377 | /** |
378 | * @generated |
379 | */ |
380 | public static List getComposedProvidingRequiringEntity_2002ContainedLinks( |
381 | View view) { |
382 | ComposedProvidingRequiringEntity modelElement = (ComposedProvidingRequiringEntity) view |
383 | .getElement(); |
384 | List result = new LinkedList(); |
385 | result |
386 | .addAll(getContainedTypeModelFacetLinks_AssemblyConnector_4004(modelElement)); |
387 | result |
388 | .addAll(getContainedTypeModelFacetLinks_AssemblyEventConnector_4007(modelElement)); |
389 | result |
390 | .addAll(getContainedTypeModelFacetLinks_RequiredDelegationConnector_4005(modelElement)); |
391 | result |
392 | .addAll(getContainedTypeModelFacetLinks_ProvidedDelegationConnector_4006(modelElement)); |
393 | result |
394 | .addAll(getContainedTypeModelFacetLinks_AssemblyInfrastructureConnector_4008(modelElement)); |
395 | return result; |
396 | } |
397 | |
398 | /** |
399 | * @generated |
400 | */ |
401 | public static List getAssemblyContext_3006ContainedLinks(View view) { |
402 | return Collections.EMPTY_LIST; |
403 | } |
404 | |
405 | /** |
406 | * @generated |
407 | */ |
408 | public static List getOperationProvidedRole_3007ContainedLinks(View view) { |
409 | return Collections.EMPTY_LIST; |
410 | } |
411 | |
412 | /** |
413 | * @generated |
414 | */ |
415 | public static List getOperationRequiredRole_3008ContainedLinks(View view) { |
416 | return Collections.EMPTY_LIST; |
417 | } |
418 | |
419 | /** |
420 | * @generated |
421 | */ |
422 | public static List getSourceRole_3013ContainedLinks(View view) { |
423 | return Collections.EMPTY_LIST; |
424 | } |
425 | |
426 | /** |
427 | * @generated |
428 | */ |
429 | public static List getSinkRole_3014ContainedLinks(View view) { |
430 | return Collections.EMPTY_LIST; |
431 | } |
432 | |
433 | /** |
434 | * @generated |
435 | */ |
436 | public static List getInfrastructureProvidedRole_3015ContainedLinks( |
437 | View view) { |
438 | return Collections.EMPTY_LIST; |
439 | } |
440 | |
441 | /** |
442 | * @generated |
443 | */ |
444 | public static List getInfrastructureRequiredRole_3016ContainedLinks( |
445 | View view) { |
446 | return Collections.EMPTY_LIST; |
447 | } |
448 | |
449 | /** |
450 | * @generated |
451 | */ |
452 | public static List getOperationProvidedRole_3011ContainedLinks(View view) { |
453 | return Collections.EMPTY_LIST; |
454 | } |
455 | |
456 | /** |
457 | * @generated |
458 | */ |
459 | public static List getOperationRequiredRole_3012ContainedLinks(View view) { |
460 | return Collections.EMPTY_LIST; |
461 | } |
462 | |
463 | /** |
464 | * @generated |
465 | */ |
466 | public static List getAssemblyConnector_4004ContainedLinks(View view) { |
467 | return Collections.EMPTY_LIST; |
468 | } |
469 | |
470 | /** |
471 | * @generated |
472 | */ |
473 | public static List getAssemblyEventConnector_4007ContainedLinks(View view) { |
474 | return Collections.EMPTY_LIST; |
475 | } |
476 | |
477 | /** |
478 | * @generated |
479 | */ |
480 | public static List getRequiredDelegationConnector_4005ContainedLinks( |
481 | View view) { |
482 | return Collections.EMPTY_LIST; |
483 | } |
484 | |
485 | /** |
486 | * @generated |
487 | */ |
488 | public static List getProvidedDelegationConnector_4006ContainedLinks( |
489 | View view) { |
490 | return Collections.EMPTY_LIST; |
491 | } |
492 | |
493 | /** |
494 | * @generated |
495 | */ |
496 | public static List getAssemblyInfrastructureConnector_4008ContainedLinks( |
497 | View view) { |
498 | return Collections.EMPTY_LIST; |
499 | } |
500 | |
501 | /** |
502 | * @generated |
503 | */ |
504 | public static List getComposedProvidingRequiringEntity_2002IncomingLinks( |
505 | View view) { |
506 | return Collections.EMPTY_LIST; |
507 | } |
508 | |
509 | /** |
510 | * @generated |
511 | */ |
512 | public static List getAssemblyContext_3006IncomingLinks(View view) { |
513 | return Collections.EMPTY_LIST; |
514 | } |
515 | |
516 | /** |
517 | * @generated |
518 | */ |
519 | public static List getOperationProvidedRole_3007IncomingLinks(View view) { |
520 | OperationProvidedRole modelElement = (OperationProvidedRole) view |
521 | .getElement(); |
522 | Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() |
523 | .getResourceSet().getResources()); |
524 | List result = new LinkedList(); |
525 | result.addAll(getIncomingTypeModelFacetLinks_AssemblyConnector_4004( |
526 | modelElement, crossReferences)); |
527 | result |
528 | .addAll(getIncomingTypeModelFacetLinks_ProvidedDelegationConnector_4006( |
529 | modelElement, crossReferences)); |
530 | return result; |
531 | } |
532 | |
533 | /** |
534 | * @generated |
535 | */ |
536 | public static List getOperationRequiredRole_3008IncomingLinks(View view) { |
537 | OperationRequiredRole modelElement = (OperationRequiredRole) view |
538 | .getElement(); |
539 | Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() |
540 | .getResourceSet().getResources()); |
541 | List result = new LinkedList(); |
542 | result |
543 | .addAll(getIncomingTypeModelFacetLinks_RequiredDelegationConnector_4005( |
544 | modelElement, crossReferences)); |
545 | return result; |
546 | } |
547 | |
548 | /** |
549 | * @generated |
550 | */ |
551 | public static List getSourceRole_3013IncomingLinks(View view) { |
552 | return Collections.EMPTY_LIST; |
553 | } |
554 | |
555 | /** |
556 | * @generated |
557 | */ |
558 | public static List getSinkRole_3014IncomingLinks(View view) { |
559 | SinkRole modelElement = (SinkRole) view.getElement(); |
560 | Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() |
561 | .getResourceSet().getResources()); |
562 | List result = new LinkedList(); |
563 | result |
564 | .addAll(getIncomingTypeModelFacetLinks_AssemblyEventConnector_4007( |
565 | modelElement, crossReferences)); |
566 | return result; |
567 | } |
568 | |
569 | /** |
570 | * @generated |
571 | */ |
572 | public static List getInfrastructureProvidedRole_3015IncomingLinks(View view) { |
573 | InfrastructureProvidedRole modelElement = (InfrastructureProvidedRole) view |
574 | .getElement(); |
575 | Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() |
576 | .getResourceSet().getResources()); |
577 | List result = new LinkedList(); |
578 | result |
579 | .addAll(getIncomingTypeModelFacetLinks_AssemblyInfrastructureConnector_4008( |
580 | modelElement, crossReferences)); |
581 | return result; |
582 | } |
583 | |
584 | /** |
585 | * @generated |
586 | */ |
587 | public static List getInfrastructureRequiredRole_3016IncomingLinks(View view) { |
588 | return Collections.EMPTY_LIST; |
589 | } |
590 | |
591 | /** |
592 | * @generated |
593 | */ |
594 | public static List getOperationProvidedRole_3011IncomingLinks(View view) { |
595 | OperationProvidedRole modelElement = (OperationProvidedRole) view |
596 | .getElement(); |
597 | Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() |
598 | .getResourceSet().getResources()); |
599 | List result = new LinkedList(); |
600 | result.addAll(getIncomingTypeModelFacetLinks_AssemblyConnector_4004( |
601 | modelElement, crossReferences)); |
602 | result |
603 | .addAll(getIncomingTypeModelFacetLinks_ProvidedDelegationConnector_4006( |
604 | modelElement, crossReferences)); |
605 | return result; |
606 | } |
607 | |
608 | /** |
609 | * @generated |
610 | */ |
611 | public static List getOperationRequiredRole_3012IncomingLinks(View view) { |
612 | OperationRequiredRole modelElement = (OperationRequiredRole) view |
613 | .getElement(); |
614 | Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() |
615 | .getResourceSet().getResources()); |
616 | List result = new LinkedList(); |
617 | result |
618 | .addAll(getIncomingTypeModelFacetLinks_RequiredDelegationConnector_4005( |
619 | modelElement, crossReferences)); |
620 | return result; |
621 | } |
622 | |
623 | /** |
624 | * @generated |
625 | */ |
626 | public static List getAssemblyConnector_4004IncomingLinks(View view) { |
627 | return Collections.EMPTY_LIST; |
628 | } |
629 | |
630 | /** |
631 | * @generated |
632 | */ |
633 | public static List getAssemblyEventConnector_4007IncomingLinks(View view) { |
634 | return Collections.EMPTY_LIST; |
635 | } |
636 | |
637 | /** |
638 | * @generated |
639 | */ |
640 | public static List getRequiredDelegationConnector_4005IncomingLinks( |
641 | View view) { |
642 | return Collections.EMPTY_LIST; |
643 | } |
644 | |
645 | /** |
646 | * @generated |
647 | */ |
648 | public static List getProvidedDelegationConnector_4006IncomingLinks( |
649 | View view) { |
650 | return Collections.EMPTY_LIST; |
651 | } |
652 | |
653 | /** |
654 | * @generated |
655 | */ |
656 | public static List getAssemblyInfrastructureConnector_4008IncomingLinks( |
657 | View view) { |
658 | return Collections.EMPTY_LIST; |
659 | } |
660 | |
661 | /** |
662 | * @generated |
663 | */ |
664 | public static List getComposedProvidingRequiringEntity_2002OutgoingLinks( |
665 | View view) { |
666 | return Collections.EMPTY_LIST; |
667 | } |
668 | |
669 | /** |
670 | * @generated |
671 | */ |
672 | public static List getAssemblyContext_3006OutgoingLinks(View view) { |
673 | return Collections.EMPTY_LIST; |
674 | } |
675 | |
676 | /** |
677 | * @generated |
678 | */ |
679 | public static List getOperationProvidedRole_3007OutgoingLinks(View view) { |
680 | OperationProvidedRole modelElement = (OperationProvidedRole) view |
681 | .getElement(); |
682 | List result = new LinkedList(); |
683 | result |
684 | .addAll(getOutgoingTypeModelFacetLinks_ProvidedDelegationConnector_4006(modelElement)); |
685 | return result; |
686 | } |
687 | |
688 | /** |
689 | * @generated |
690 | */ |
691 | public static List getOperationRequiredRole_3008OutgoingLinks(View view) { |
692 | OperationRequiredRole modelElement = (OperationRequiredRole) view |
693 | .getElement(); |
694 | List result = new LinkedList(); |
695 | result |
696 | .addAll(getOutgoingTypeModelFacetLinks_AssemblyConnector_4004(modelElement)); |
697 | result |
698 | .addAll(getOutgoingTypeModelFacetLinks_RequiredDelegationConnector_4005(modelElement)); |
699 | return result; |
700 | } |
701 | |
702 | /** |
703 | * @generated |
704 | */ |
705 | public static List getSourceRole_3013OutgoingLinks(View view) { |
706 | SourceRole modelElement = (SourceRole) view.getElement(); |
707 | List result = new LinkedList(); |
708 | result |
709 | .addAll(getOutgoingTypeModelFacetLinks_AssemblyEventConnector_4007(modelElement)); |
710 | return result; |
711 | } |
712 | |
713 | /** |
714 | * @generated |
715 | */ |
716 | public static List getSinkRole_3014OutgoingLinks(View view) { |
717 | return Collections.EMPTY_LIST; |
718 | } |
719 | |
720 | /** |
721 | * @generated |
722 | */ |
723 | public static List getInfrastructureProvidedRole_3015OutgoingLinks(View view) { |
724 | return Collections.EMPTY_LIST; |
725 | } |
726 | |
727 | /** |
728 | * @generated |
729 | */ |
730 | public static List getInfrastructureRequiredRole_3016OutgoingLinks(View view) { |
731 | InfrastructureRequiredRole modelElement = (InfrastructureRequiredRole) view |
732 | .getElement(); |
733 | List result = new LinkedList(); |
734 | result |
735 | .addAll(getOutgoingTypeModelFacetLinks_AssemblyInfrastructureConnector_4008(modelElement)); |
736 | return result; |
737 | } |
738 | |
739 | /** |
740 | * @generated |
741 | */ |
742 | public static List getOperationProvidedRole_3011OutgoingLinks(View view) { |
743 | OperationProvidedRole modelElement = (OperationProvidedRole) view |
744 | .getElement(); |
745 | List result = new LinkedList(); |
746 | result |
747 | .addAll(getOutgoingTypeModelFacetLinks_ProvidedDelegationConnector_4006(modelElement)); |
748 | return result; |
749 | } |
750 | |
751 | /** |
752 | * @generated |
753 | */ |
754 | public static List getOperationRequiredRole_3012OutgoingLinks(View view) { |
755 | OperationRequiredRole modelElement = (OperationRequiredRole) view |
756 | .getElement(); |
757 | List result = new LinkedList(); |
758 | result |
759 | .addAll(getOutgoingTypeModelFacetLinks_AssemblyConnector_4004(modelElement)); |
760 | result |
761 | .addAll(getOutgoingTypeModelFacetLinks_RequiredDelegationConnector_4005(modelElement)); |
762 | return result; |
763 | } |
764 | |
765 | /** |
766 | * @generated |
767 | */ |
768 | public static List getAssemblyConnector_4004OutgoingLinks(View view) { |
769 | return Collections.EMPTY_LIST; |
770 | } |
771 | |
772 | /** |
773 | * @generated |
774 | */ |
775 | public static List getAssemblyEventConnector_4007OutgoingLinks(View view) { |
776 | return Collections.EMPTY_LIST; |
777 | } |
778 | |
779 | /** |
780 | * @generated |
781 | */ |
782 | public static List getRequiredDelegationConnector_4005OutgoingLinks( |
783 | View view) { |
784 | return Collections.EMPTY_LIST; |
785 | } |
786 | |
787 | /** |
788 | * @generated |
789 | */ |
790 | public static List getProvidedDelegationConnector_4006OutgoingLinks( |
791 | View view) { |
792 | return Collections.EMPTY_LIST; |
793 | } |
794 | |
795 | /** |
796 | * @generated |
797 | */ |
798 | public static List getAssemblyInfrastructureConnector_4008OutgoingLinks( |
799 | View view) { |
800 | return Collections.EMPTY_LIST; |
801 | } |
802 | |
803 | /** |
804 | * @generated |
805 | */ |
806 | private static Collection getContainedTypeModelFacetLinks_AssemblyConnector_4004( |
807 | ComposedStructure container) { |
808 | Collection result = new LinkedList(); |
809 | for (Iterator links = container.getConnectors__ComposedStructure() |
810 | .iterator(); links.hasNext();) { |
811 | EObject linkObject = (EObject) links.next(); |
812 | if (false == linkObject instanceof AssemblyConnector) { |
813 | continue; |
814 | } |
815 | AssemblyConnector link = (AssemblyConnector) linkObject; |
816 | if (AssemblyConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
817 | .getLinkWithClassVisualID(link)) { |
818 | continue; |
819 | } |
820 | OperationProvidedRole dst = link |
821 | .getProvidedRole_AssemblyConnector(); |
822 | OperationRequiredRole src = link |
823 | .getRequiredRole_AssemblyConnector(); |
824 | result.add(new PalladioComponentModelLinkDescriptor(src, dst, link, |
825 | PalladioComponentModelElementTypes.AssemblyConnector_4004, |
826 | AssemblyConnectorEditPart.VISUAL_ID)); |
827 | } |
828 | return result; |
829 | } |
830 | |
831 | /** |
832 | * @generated |
833 | */ |
834 | private static Collection getContainedTypeModelFacetLinks_AssemblyEventConnector_4007( |
835 | ComposedStructure container) { |
836 | Collection result = new LinkedList(); |
837 | for (Iterator links = container.getConnectors__ComposedStructure() |
838 | .iterator(); links.hasNext();) { |
839 | EObject linkObject = (EObject) links.next(); |
840 | if (false == linkObject instanceof AssemblyEventConnector) { |
841 | continue; |
842 | } |
843 | AssemblyEventConnector link = (AssemblyEventConnector) linkObject; |
844 | if (AssemblyEventConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
845 | .getLinkWithClassVisualID(link)) { |
846 | continue; |
847 | } |
848 | SinkRole dst = link.getSinkRole__AssemblyEventConnector(); |
849 | SourceRole src = link.getSourceRole__AssemblyEventConnector(); |
850 | result |
851 | .add(new PalladioComponentModelLinkDescriptor( |
852 | src, |
853 | dst, |
854 | link, |
855 | PalladioComponentModelElementTypes.AssemblyEventConnector_4007, |
856 | AssemblyEventConnectorEditPart.VISUAL_ID)); |
857 | } |
858 | return result; |
859 | } |
860 | |
861 | /** |
862 | * @generated |
863 | */ |
864 | private static Collection getContainedTypeModelFacetLinks_RequiredDelegationConnector_4005( |
865 | ComposedStructure container) { |
866 | Collection result = new LinkedList(); |
867 | for (Iterator links = container.getConnectors__ComposedStructure() |
868 | .iterator(); links.hasNext();) { |
869 | EObject linkObject = (EObject) links.next(); |
870 | if (false == linkObject instanceof RequiredDelegationConnector) { |
871 | continue; |
872 | } |
873 | RequiredDelegationConnector link = (RequiredDelegationConnector) linkObject; |
874 | if (RequiredDelegationConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
875 | .getLinkWithClassVisualID(link)) { |
876 | continue; |
877 | } |
878 | OperationRequiredRole dst = link |
879 | .getOuterRequiredRole_RequiredDelegationConnector(); |
880 | OperationRequiredRole src = link |
881 | .getInnerRequiredRole_RequiredDelegationConnector(); |
882 | result |
883 | .add(new PalladioComponentModelLinkDescriptor( |
884 | src, |
885 | dst, |
886 | link, |
887 | PalladioComponentModelElementTypes.RequiredDelegationConnector_4005, |
888 | RequiredDelegationConnectorEditPart.VISUAL_ID)); |
889 | } |
890 | return result; |
891 | } |
892 | |
893 | /** |
894 | * @generated |
895 | */ |
896 | private static Collection getContainedTypeModelFacetLinks_ProvidedDelegationConnector_4006( |
897 | ComposedStructure container) { |
898 | Collection result = new LinkedList(); |
899 | for (Iterator links = container.getConnectors__ComposedStructure() |
900 | .iterator(); links.hasNext();) { |
901 | EObject linkObject = (EObject) links.next(); |
902 | if (false == linkObject instanceof ProvidedDelegationConnector) { |
903 | continue; |
904 | } |
905 | ProvidedDelegationConnector link = (ProvidedDelegationConnector) linkObject; |
906 | if (ProvidedDelegationConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
907 | .getLinkWithClassVisualID(link)) { |
908 | continue; |
909 | } |
910 | OperationProvidedRole dst = link |
911 | .getInnerProvidedRole_ProvidedDelegationConnector(); |
912 | OperationProvidedRole src = link |
913 | .getOuterProvidedRole_ProvidedDelegationConnector(); |
914 | result |
915 | .add(new PalladioComponentModelLinkDescriptor( |
916 | src, |
917 | dst, |
918 | link, |
919 | PalladioComponentModelElementTypes.ProvidedDelegationConnector_4006, |
920 | ProvidedDelegationConnectorEditPart.VISUAL_ID)); |
921 | } |
922 | return result; |
923 | } |
924 | |
925 | /** |
926 | * @generated |
927 | */ |
928 | private static Collection getContainedTypeModelFacetLinks_AssemblyInfrastructureConnector_4008( |
929 | ComposedStructure container) { |
930 | Collection result = new LinkedList(); |
931 | for (Iterator links = container.getConnectors__ComposedStructure() |
932 | .iterator(); links.hasNext();) { |
933 | EObject linkObject = (EObject) links.next(); |
934 | if (false == linkObject instanceof AssemblyInfrastructureConnector) { |
935 | continue; |
936 | } |
937 | AssemblyInfrastructureConnector link = (AssemblyInfrastructureConnector) linkObject; |
938 | if (AssemblyInfrastructureConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
939 | .getLinkWithClassVisualID(link)) { |
940 | continue; |
941 | } |
942 | InfrastructureProvidedRole dst = link |
943 | .getProvidedRole__AssemblyInfrastructureConnector(); |
944 | InfrastructureRequiredRole src = link |
945 | .getRequiredRole__AssemblyInfrastructureConnector(); |
946 | result |
947 | .add(new PalladioComponentModelLinkDescriptor( |
948 | src, |
949 | dst, |
950 | link, |
951 | PalladioComponentModelElementTypes.AssemblyInfrastructureConnector_4008, |
952 | AssemblyInfrastructureConnectorEditPart.VISUAL_ID)); |
953 | } |
954 | return result; |
955 | } |
956 | |
957 | /** |
958 | * @generated |
959 | */ |
960 | private static Collection getIncomingTypeModelFacetLinks_AssemblyConnector_4004( |
961 | OperationProvidedRole target, Map crossReferences) { |
962 | Collection result = new LinkedList(); |
963 | Collection settings = (Collection) crossReferences.get(target); |
964 | for (Iterator it = settings.iterator(); it.hasNext();) { |
965 | EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it |
966 | .next(); |
967 | if (setting.getEStructuralFeature() != CompositionPackage.eINSTANCE |
968 | .getAssemblyConnector_ProvidedRole_AssemblyConnector() |
969 | || false == setting.getEObject() instanceof AssemblyConnector) { |
970 | continue; |
971 | } |
972 | AssemblyConnector link = (AssemblyConnector) setting.getEObject(); |
973 | if (AssemblyConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
974 | .getLinkWithClassVisualID(link)) { |
975 | continue; |
976 | } |
977 | OperationRequiredRole src = link |
978 | .getRequiredRole_AssemblyConnector(); |
979 | result.add(new PalladioComponentModelLinkDescriptor(src, target, |
980 | link, |
981 | PalladioComponentModelElementTypes.AssemblyConnector_4004, |
982 | AssemblyConnectorEditPart.VISUAL_ID)); |
983 | } |
984 | return result; |
985 | } |
986 | |
987 | /** |
988 | * @generated |
989 | */ |
990 | private static Collection getIncomingTypeModelFacetLinks_AssemblyEventConnector_4007( |
991 | SinkRole target, Map crossReferences) { |
992 | Collection result = new LinkedList(); |
993 | Collection settings = (Collection) crossReferences.get(target); |
994 | for (Iterator it = settings.iterator(); it.hasNext();) { |
995 | EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it |
996 | .next(); |
997 | if (setting.getEStructuralFeature() != CompositionPackage.eINSTANCE |
998 | .getAssemblyEventConnector_SinkRole__AssemblyEventConnector() |
999 | || false == setting.getEObject() instanceof AssemblyEventConnector) { |
1000 | continue; |
1001 | } |
1002 | AssemblyEventConnector link = (AssemblyEventConnector) setting |
1003 | .getEObject(); |
1004 | if (AssemblyEventConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1005 | .getLinkWithClassVisualID(link)) { |
1006 | continue; |
1007 | } |
1008 | SourceRole src = link.getSourceRole__AssemblyEventConnector(); |
1009 | result |
1010 | .add(new PalladioComponentModelLinkDescriptor( |
1011 | src, |
1012 | target, |
1013 | link, |
1014 | PalladioComponentModelElementTypes.AssemblyEventConnector_4007, |
1015 | AssemblyEventConnectorEditPart.VISUAL_ID)); |
1016 | } |
1017 | return result; |
1018 | } |
1019 | |
1020 | /** |
1021 | * @generated |
1022 | */ |
1023 | private static Collection getIncomingTypeModelFacetLinks_RequiredDelegationConnector_4005( |
1024 | OperationRequiredRole target, Map crossReferences) { |
1025 | Collection result = new LinkedList(); |
1026 | Collection settings = (Collection) crossReferences.get(target); |
1027 | for (Iterator it = settings.iterator(); it.hasNext();) { |
1028 | EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it |
1029 | .next(); |
1030 | if (setting.getEStructuralFeature() != CompositionPackage.eINSTANCE |
1031 | .getRequiredDelegationConnector_OuterRequiredRole_RequiredDelegationConnector() |
1032 | || false == setting.getEObject() instanceof RequiredDelegationConnector) { |
1033 | continue; |
1034 | } |
1035 | RequiredDelegationConnector link = (RequiredDelegationConnector) setting |
1036 | .getEObject(); |
1037 | if (RequiredDelegationConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1038 | .getLinkWithClassVisualID(link)) { |
1039 | continue; |
1040 | } |
1041 | OperationRequiredRole src = link |
1042 | .getInnerRequiredRole_RequiredDelegationConnector(); |
1043 | result |
1044 | .add(new PalladioComponentModelLinkDescriptor( |
1045 | src, |
1046 | target, |
1047 | link, |
1048 | PalladioComponentModelElementTypes.RequiredDelegationConnector_4005, |
1049 | RequiredDelegationConnectorEditPart.VISUAL_ID)); |
1050 | } |
1051 | return result; |
1052 | } |
1053 | |
1054 | /** |
1055 | * @generated |
1056 | */ |
1057 | private static Collection getIncomingTypeModelFacetLinks_ProvidedDelegationConnector_4006( |
1058 | OperationProvidedRole target, Map crossReferences) { |
1059 | Collection result = new LinkedList(); |
1060 | Collection settings = (Collection) crossReferences.get(target); |
1061 | for (Iterator it = settings.iterator(); it.hasNext();) { |
1062 | EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it |
1063 | .next(); |
1064 | if (setting.getEStructuralFeature() != CompositionPackage.eINSTANCE |
1065 | .getProvidedDelegationConnector_InnerProvidedRole_ProvidedDelegationConnector() |
1066 | || false == setting.getEObject() instanceof ProvidedDelegationConnector) { |
1067 | continue; |
1068 | } |
1069 | ProvidedDelegationConnector link = (ProvidedDelegationConnector) setting |
1070 | .getEObject(); |
1071 | if (ProvidedDelegationConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1072 | .getLinkWithClassVisualID(link)) { |
1073 | continue; |
1074 | } |
1075 | OperationProvidedRole src = link |
1076 | .getOuterProvidedRole_ProvidedDelegationConnector(); |
1077 | result |
1078 | .add(new PalladioComponentModelLinkDescriptor( |
1079 | src, |
1080 | target, |
1081 | link, |
1082 | PalladioComponentModelElementTypes.ProvidedDelegationConnector_4006, |
1083 | ProvidedDelegationConnectorEditPart.VISUAL_ID)); |
1084 | } |
1085 | return result; |
1086 | } |
1087 | |
1088 | /** |
1089 | * @generated |
1090 | */ |
1091 | private static Collection getIncomingTypeModelFacetLinks_AssemblyInfrastructureConnector_4008( |
1092 | InfrastructureProvidedRole target, Map crossReferences) { |
1093 | Collection result = new LinkedList(); |
1094 | Collection settings = (Collection) crossReferences.get(target); |
1095 | for (Iterator it = settings.iterator(); it.hasNext();) { |
1096 | EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it |
1097 | .next(); |
1098 | if (setting.getEStructuralFeature() != CompositionPackage.eINSTANCE |
1099 | .getAssemblyInfrastructureConnector_ProvidedRole__AssemblyInfrastructureConnector() |
1100 | || false == setting.getEObject() instanceof AssemblyInfrastructureConnector) { |
1101 | continue; |
1102 | } |
1103 | AssemblyInfrastructureConnector link = (AssemblyInfrastructureConnector) setting |
1104 | .getEObject(); |
1105 | if (AssemblyInfrastructureConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1106 | .getLinkWithClassVisualID(link)) { |
1107 | continue; |
1108 | } |
1109 | InfrastructureRequiredRole src = link |
1110 | .getRequiredRole__AssemblyInfrastructureConnector(); |
1111 | result |
1112 | .add(new PalladioComponentModelLinkDescriptor( |
1113 | src, |
1114 | target, |
1115 | link, |
1116 | PalladioComponentModelElementTypes.AssemblyInfrastructureConnector_4008, |
1117 | AssemblyInfrastructureConnectorEditPart.VISUAL_ID)); |
1118 | } |
1119 | return result; |
1120 | } |
1121 | |
1122 | /** |
1123 | * @generated |
1124 | */ |
1125 | private static Collection getOutgoingTypeModelFacetLinks_AssemblyConnector_4004( |
1126 | OperationRequiredRole source) { |
1127 | ComposedStructure container = null; |
1128 | // Find container element for the link. |
1129 | // Climb up by containment hierarchy starting from the source |
1130 | // and return the first element that is instance of the container class. |
1131 | for (EObject element = source; element != null && container == null; element = element |
1132 | .eContainer()) { |
1133 | if (element instanceof ComposedStructure) { |
1134 | container = (ComposedStructure) element; |
1135 | } |
1136 | } |
1137 | if (container == null) { |
1138 | return Collections.EMPTY_LIST; |
1139 | } |
1140 | Collection result = new LinkedList(); |
1141 | for (Iterator links = container.getConnectors__ComposedStructure() |
1142 | .iterator(); links.hasNext();) { |
1143 | EObject linkObject = (EObject) links.next(); |
1144 | if (false == linkObject instanceof AssemblyConnector) { |
1145 | continue; |
1146 | } |
1147 | AssemblyConnector link = (AssemblyConnector) linkObject; |
1148 | if (AssemblyConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1149 | .getLinkWithClassVisualID(link)) { |
1150 | continue; |
1151 | } |
1152 | OperationProvidedRole dst = link |
1153 | .getProvidedRole_AssemblyConnector(); |
1154 | OperationRequiredRole src = link |
1155 | .getRequiredRole_AssemblyConnector(); |
1156 | if (src != source) { |
1157 | continue; |
1158 | } |
1159 | result.add(new PalladioComponentModelLinkDescriptor(src, dst, link, |
1160 | PalladioComponentModelElementTypes.AssemblyConnector_4004, |
1161 | AssemblyConnectorEditPart.VISUAL_ID)); |
1162 | } |
1163 | return result; |
1164 | } |
1165 | |
1166 | /** |
1167 | * @generated |
1168 | */ |
1169 | private static Collection getOutgoingTypeModelFacetLinks_AssemblyEventConnector_4007( |
1170 | SourceRole source) { |
1171 | ComposedStructure container = null; |
1172 | // Find container element for the link. |
1173 | // Climb up by containment hierarchy starting from the source |
1174 | // and return the first element that is instance of the container class. |
1175 | for (EObject element = source; element != null && container == null; element = element |
1176 | .eContainer()) { |
1177 | if (element instanceof ComposedStructure) { |
1178 | container = (ComposedStructure) element; |
1179 | } |
1180 | } |
1181 | if (container == null) { |
1182 | return Collections.EMPTY_LIST; |
1183 | } |
1184 | Collection result = new LinkedList(); |
1185 | for (Iterator links = container.getConnectors__ComposedStructure() |
1186 | .iterator(); links.hasNext();) { |
1187 | EObject linkObject = (EObject) links.next(); |
1188 | if (false == linkObject instanceof AssemblyEventConnector) { |
1189 | continue; |
1190 | } |
1191 | AssemblyEventConnector link = (AssemblyEventConnector) linkObject; |
1192 | if (AssemblyEventConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1193 | .getLinkWithClassVisualID(link)) { |
1194 | continue; |
1195 | } |
1196 | SinkRole dst = link.getSinkRole__AssemblyEventConnector(); |
1197 | SourceRole src = link.getSourceRole__AssemblyEventConnector(); |
1198 | if (src != source) { |
1199 | continue; |
1200 | } |
1201 | result |
1202 | .add(new PalladioComponentModelLinkDescriptor( |
1203 | src, |
1204 | dst, |
1205 | link, |
1206 | PalladioComponentModelElementTypes.AssemblyEventConnector_4007, |
1207 | AssemblyEventConnectorEditPart.VISUAL_ID)); |
1208 | } |
1209 | return result; |
1210 | } |
1211 | |
1212 | /** |
1213 | * @generated |
1214 | */ |
1215 | private static Collection getOutgoingTypeModelFacetLinks_RequiredDelegationConnector_4005( |
1216 | OperationRequiredRole source) { |
1217 | ComposedStructure container = null; |
1218 | // Find container element for the link. |
1219 | // Climb up by containment hierarchy starting from the source |
1220 | // and return the first element that is instance of the container class. |
1221 | for (EObject element = source; element != null && container == null; element = element |
1222 | .eContainer()) { |
1223 | if (element instanceof ComposedStructure) { |
1224 | container = (ComposedStructure) element; |
1225 | } |
1226 | } |
1227 | if (container == null) { |
1228 | return Collections.EMPTY_LIST; |
1229 | } |
1230 | Collection result = new LinkedList(); |
1231 | for (Iterator links = container.getConnectors__ComposedStructure() |
1232 | .iterator(); links.hasNext();) { |
1233 | EObject linkObject = (EObject) links.next(); |
1234 | if (false == linkObject instanceof RequiredDelegationConnector) { |
1235 | continue; |
1236 | } |
1237 | RequiredDelegationConnector link = (RequiredDelegationConnector) linkObject; |
1238 | if (RequiredDelegationConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1239 | .getLinkWithClassVisualID(link)) { |
1240 | continue; |
1241 | } |
1242 | OperationRequiredRole dst = link |
1243 | .getOuterRequiredRole_RequiredDelegationConnector(); |
1244 | OperationRequiredRole src = link |
1245 | .getInnerRequiredRole_RequiredDelegationConnector(); |
1246 | if (src != source) { |
1247 | continue; |
1248 | } |
1249 | result |
1250 | .add(new PalladioComponentModelLinkDescriptor( |
1251 | src, |
1252 | dst, |
1253 | link, |
1254 | PalladioComponentModelElementTypes.RequiredDelegationConnector_4005, |
1255 | RequiredDelegationConnectorEditPart.VISUAL_ID)); |
1256 | } |
1257 | return result; |
1258 | } |
1259 | |
1260 | /** |
1261 | * @generated |
1262 | */ |
1263 | private static Collection getOutgoingTypeModelFacetLinks_ProvidedDelegationConnector_4006( |
1264 | OperationProvidedRole source) { |
1265 | ComposedStructure container = null; |
1266 | // Find container element for the link. |
1267 | // Climb up by containment hierarchy starting from the source |
1268 | // and return the first element that is instance of the container class. |
1269 | for (EObject element = source; element != null && container == null; element = element |
1270 | .eContainer()) { |
1271 | if (element instanceof ComposedStructure) { |
1272 | container = (ComposedStructure) element; |
1273 | } |
1274 | } |
1275 | if (container == null) { |
1276 | return Collections.EMPTY_LIST; |
1277 | } |
1278 | Collection result = new LinkedList(); |
1279 | for (Iterator links = container.getConnectors__ComposedStructure() |
1280 | .iterator(); links.hasNext();) { |
1281 | EObject linkObject = (EObject) links.next(); |
1282 | if (false == linkObject instanceof ProvidedDelegationConnector) { |
1283 | continue; |
1284 | } |
1285 | ProvidedDelegationConnector link = (ProvidedDelegationConnector) linkObject; |
1286 | if (ProvidedDelegationConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1287 | .getLinkWithClassVisualID(link)) { |
1288 | continue; |
1289 | } |
1290 | OperationProvidedRole dst = link |
1291 | .getInnerProvidedRole_ProvidedDelegationConnector(); |
1292 | OperationProvidedRole src = link |
1293 | .getOuterProvidedRole_ProvidedDelegationConnector(); |
1294 | if (src != source) { |
1295 | continue; |
1296 | } |
1297 | result |
1298 | .add(new PalladioComponentModelLinkDescriptor( |
1299 | src, |
1300 | dst, |
1301 | link, |
1302 | PalladioComponentModelElementTypes.ProvidedDelegationConnector_4006, |
1303 | ProvidedDelegationConnectorEditPart.VISUAL_ID)); |
1304 | } |
1305 | return result; |
1306 | } |
1307 | |
1308 | /** |
1309 | * @generated |
1310 | */ |
1311 | private static Collection getOutgoingTypeModelFacetLinks_AssemblyInfrastructureConnector_4008( |
1312 | InfrastructureRequiredRole source) { |
1313 | ComposedStructure container = null; |
1314 | // Find container element for the link. |
1315 | // Climb up by containment hierarchy starting from the source |
1316 | // and return the first element that is instance of the container class. |
1317 | for (EObject element = source; element != null && container == null; element = element |
1318 | .eContainer()) { |
1319 | if (element instanceof ComposedStructure) { |
1320 | container = (ComposedStructure) element; |
1321 | } |
1322 | } |
1323 | if (container == null) { |
1324 | return Collections.EMPTY_LIST; |
1325 | } |
1326 | Collection result = new LinkedList(); |
1327 | for (Iterator links = container.getConnectors__ComposedStructure() |
1328 | .iterator(); links.hasNext();) { |
1329 | EObject linkObject = (EObject) links.next(); |
1330 | if (false == linkObject instanceof AssemblyInfrastructureConnector) { |
1331 | continue; |
1332 | } |
1333 | AssemblyInfrastructureConnector link = (AssemblyInfrastructureConnector) linkObject; |
1334 | if (AssemblyInfrastructureConnectorEditPart.VISUAL_ID != PalladioComponentModelVisualIDRegistry |
1335 | .getLinkWithClassVisualID(link)) { |
1336 | continue; |
1337 | } |
1338 | InfrastructureProvidedRole dst = link |
1339 | .getProvidedRole__AssemblyInfrastructureConnector(); |
1340 | InfrastructureRequiredRole src = link |
1341 | .getRequiredRole__AssemblyInfrastructureConnector(); |
1342 | if (src != source) { |
1343 | continue; |
1344 | } |
1345 | result |
1346 | .add(new PalladioComponentModelLinkDescriptor( |
1347 | src, |
1348 | dst, |
1349 | link, |
1350 | PalladioComponentModelElementTypes.AssemblyInfrastructureConnector_4008, |
1351 | AssemblyInfrastructureConnectorEditPart.VISUAL_ID)); |
1352 | } |
1353 | return result; |
1354 | } |
1355 | |
1356 | } |