1 | /* |
2 | * Copyright 2006 SDQ Research Group, University of Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.seff.edit.parts; |
5 | |
6 | import java.util.ArrayList; |
7 | import java.util.List; |
8 | |
9 | import org.eclipse.draw2d.GridData; |
10 | import org.eclipse.draw2d.GridLayout; |
11 | import org.eclipse.draw2d.IFigure; |
12 | import org.eclipse.draw2d.MarginBorder; |
13 | import org.eclipse.draw2d.RoundedRectangle; |
14 | import org.eclipse.draw2d.Shape; |
15 | import org.eclipse.draw2d.StackLayout; |
16 | import org.eclipse.draw2d.geometry.Dimension; |
17 | import org.eclipse.gef.EditPart; |
18 | import org.eclipse.gef.EditPolicy; |
19 | import org.eclipse.gef.Request; |
20 | import org.eclipse.gef.commands.Command; |
21 | import org.eclipse.gef.editpolicies.LayoutEditPolicy; |
22 | import org.eclipse.gef.editpolicies.NonResizableEditPolicy; |
23 | import org.eclipse.gef.requests.CreateRequest; |
24 | import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; |
25 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; |
26 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; |
27 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; |
28 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
29 | import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; |
30 | import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; |
31 | import org.eclipse.gmf.runtime.emf.type.core.IElementType; |
32 | import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; |
33 | import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; |
34 | import org.eclipse.gmf.runtime.notation.View; |
35 | import org.eclipse.swt.SWT; |
36 | import org.eclipse.swt.graphics.Color; |
37 | |
38 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.CollectionIteratorAction2CanonicalEditPolicy; |
39 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.CollectionIteratorAction2ItemSemanticEditPolicy; |
40 | import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelVisualIDRegistry; |
41 | import de.uka.ipd.sdq.pcm.gmf.seff.providers.PalladioComponentModelElementTypes; |
42 | |
43 | /** |
44 | * @generated |
45 | */ |
46 | public class CollectionIteratorAction2EditPart extends ShapeNodeEditPart { |
47 | |
48 | /** |
49 | * @generated |
50 | */ |
51 | public static final int VISUAL_ID = 3013; |
52 | |
53 | /** |
54 | * @generated |
55 | */ |
56 | protected IFigure contentPane; |
57 | |
58 | /** |
59 | * @generated |
60 | */ |
61 | protected IFigure primaryShape; |
62 | |
63 | /** |
64 | * @generated |
65 | */ |
66 | public CollectionIteratorAction2EditPart(View view) { |
67 | super(view); |
68 | } |
69 | |
70 | /** |
71 | * @generated |
72 | */ |
73 | protected void createDefaultEditPolicies() { |
74 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
75 | new CreationEditPolicy()); |
76 | super.createDefaultEditPolicies(); |
77 | installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, |
78 | new CollectionIteratorAction2ItemSemanticEditPolicy()); |
79 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
80 | new DragDropEditPolicy()); |
81 | installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, |
82 | new CollectionIteratorAction2CanonicalEditPolicy()); |
83 | installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); |
84 | // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies |
85 | // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); |
86 | } |
87 | |
88 | /** |
89 | * @generated |
90 | */ |
91 | protected LayoutEditPolicy createLayoutEditPolicy() { |
92 | LayoutEditPolicy lep = new LayoutEditPolicy() { |
93 | |
94 | protected EditPolicy createChildEditPolicy(EditPart child) { |
95 | EditPolicy result = child |
96 | .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); |
97 | if (result == null) { |
98 | result = new NonResizableEditPolicy(); |
99 | } |
100 | return result; |
101 | } |
102 | |
103 | protected Command getMoveChildrenCommand(Request request) { |
104 | return null; |
105 | } |
106 | |
107 | protected Command getCreateCommand(CreateRequest request) { |
108 | return null; |
109 | } |
110 | }; |
111 | return lep; |
112 | } |
113 | |
114 | /** |
115 | * @generated |
116 | */ |
117 | protected IFigure createNodeShape() { |
118 | CollectionIteratorFigure figure = new CollectionIteratorFigure(); |
119 | return primaryShape = figure; |
120 | } |
121 | |
122 | /** |
123 | * @generated |
124 | */ |
125 | public CollectionIteratorFigure getPrimaryShape() { |
126 | return (CollectionIteratorFigure) primaryShape; |
127 | } |
128 | |
129 | /** |
130 | * @generated |
131 | */ |
132 | protected boolean addFixedChild(EditPart childEditPart) { |
133 | if (childEditPart instanceof CollectionIteratorParameterLabelEditPart) { |
134 | ((CollectionIteratorParameterLabelEditPart) childEditPart) |
135 | .setLabel(getPrimaryShape() |
136 | .getFigureCollectionIteratorParameterLabelFigure()); |
137 | return true; |
138 | } |
139 | if (childEditPart instanceof CollectionIteratorActionEntityName2EditPart) { |
140 | ((CollectionIteratorActionEntityName2EditPart) childEditPart) |
141 | .setLabel(getPrimaryShape() |
142 | .getFigureCollectionIteratorNameLabelFigure()); |
143 | return true; |
144 | } |
145 | return false; |
146 | } |
147 | |
148 | /** |
149 | * @generated |
150 | */ |
151 | protected boolean removeFixedChild(EditPart childEditPart) { |
152 | if (childEditPart instanceof CollectionIteratorParameterLabelEditPart) { |
153 | return true; |
154 | } |
155 | if (childEditPart instanceof CollectionIteratorActionEntityName2EditPart) { |
156 | return true; |
157 | } |
158 | return false; |
159 | } |
160 | |
161 | /** |
162 | * @generated |
163 | */ |
164 | protected void addChildVisual(EditPart childEditPart, int index) { |
165 | if (addFixedChild(childEditPart)) { |
166 | return; |
167 | } |
168 | super.addChildVisual(childEditPart, -1); |
169 | } |
170 | |
171 | /** |
172 | * @generated |
173 | */ |
174 | protected void removeChildVisual(EditPart childEditPart) { |
175 | if (removeFixedChild(childEditPart)) { |
176 | return; |
177 | } |
178 | super.removeChildVisual(childEditPart); |
179 | } |
180 | |
181 | /** |
182 | * @generated |
183 | */ |
184 | protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { |
185 | return getContentPane(); |
186 | } |
187 | |
188 | /** |
189 | * @generated |
190 | */ |
191 | protected NodeFigure createNodePlate() { |
192 | DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40); |
193 | return result; |
194 | } |
195 | |
196 | /** |
197 | * Creates figure for this edit part. |
198 | * |
199 | * Body of this method does not depend on settings in generation model |
200 | * so you may safely remove <i>generated</i> tag and modify it. |
201 | * |
202 | * @generated |
203 | */ |
204 | protected NodeFigure createNodeFigure() { |
205 | NodeFigure figure = createNodePlate(); |
206 | figure.setLayoutManager(new StackLayout()); |
207 | IFigure shape = createNodeShape(); |
208 | figure.add(shape); |
209 | contentPane = setupContentPane(shape); |
210 | return figure; |
211 | } |
212 | |
213 | /** |
214 | * Default implementation treats passed figure as content pane. |
215 | * Respects layout one may have set for generated figure. |
216 | * @param nodeShape instance of generated figure class |
217 | * @generated |
218 | */ |
219 | protected IFigure setupContentPane(IFigure nodeShape) { |
220 | if (nodeShape.getLayoutManager() == null) { |
221 | ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); |
222 | layout.setSpacing(5); |
223 | nodeShape.setLayoutManager(layout); |
224 | } |
225 | return nodeShape; // use nodeShape itself as contentPane |
226 | } |
227 | |
228 | /** |
229 | * @generated |
230 | */ |
231 | public IFigure getContentPane() { |
232 | if (contentPane != null) { |
233 | return contentPane; |
234 | } |
235 | return super.getContentPane(); |
236 | } |
237 | |
238 | /** |
239 | * @generated |
240 | */ |
241 | protected void setForegroundColor(Color color) { |
242 | if (primaryShape != null) { |
243 | primaryShape.setForegroundColor(color); |
244 | } |
245 | } |
246 | |
247 | /** |
248 | * @generated |
249 | */ |
250 | protected void setBackgroundColor(Color color) { |
251 | if (primaryShape != null) { |
252 | primaryShape.setBackgroundColor(color); |
253 | } |
254 | } |
255 | |
256 | /** |
257 | * @generated |
258 | */ |
259 | protected void setLineWidth(int width) { |
260 | if (primaryShape instanceof Shape) { |
261 | ((Shape) primaryShape).setLineWidth(width); |
262 | } |
263 | } |
264 | |
265 | /** |
266 | * @generated |
267 | */ |
268 | protected void setLineType(int style) { |
269 | if (primaryShape instanceof Shape) { |
270 | ((Shape) primaryShape).setLineStyle(style); |
271 | } |
272 | } |
273 | |
274 | /** |
275 | * @generated |
276 | */ |
277 | public EditPart getPrimaryChildEditPart() { |
278 | return getChildBySemanticHint(PalladioComponentModelVisualIDRegistry |
279 | .getType(CollectionIteratorActionEntityName2EditPart.VISUAL_ID)); |
280 | } |
281 | |
282 | /** |
283 | * @generated |
284 | */ |
285 | public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnSource() { |
286 | List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/(); |
287 | types |
288 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
289 | return types; |
290 | } |
291 | |
292 | /** |
293 | * @generated |
294 | */ |
295 | public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnSourceAndTarget( |
296 | IGraphicalEditPart targetEditPart) { |
297 | List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/(); |
298 | if (targetEditPart instanceof StartActionEditPart) { |
299 | types |
300 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
301 | } |
302 | if (targetEditPart instanceof StopActionEditPart) { |
303 | types |
304 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
305 | } |
306 | if (targetEditPart instanceof ExternalCallActionEditPart) { |
307 | types |
308 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
309 | } |
310 | if (targetEditPart instanceof EmitEventActionEditPart) { |
311 | types |
312 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
313 | } |
314 | if (targetEditPart instanceof LoopActionEditPart) { |
315 | types |
316 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
317 | } |
318 | if (targetEditPart instanceof BranchActionEditPart) { |
319 | types |
320 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
321 | } |
322 | if (targetEditPart instanceof InternalActionEditPart) { |
323 | types |
324 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
325 | } |
326 | if (targetEditPart instanceof CollectionIteratorActionEditPart) { |
327 | types |
328 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
329 | } |
330 | if (targetEditPart instanceof SetVariableActionEditPart) { |
331 | types |
332 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
333 | } |
334 | if (targetEditPart instanceof AcquireActionEditPart) { |
335 | types |
336 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
337 | } |
338 | if (targetEditPart instanceof ReleaseActionEditPart) { |
339 | types |
340 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
341 | } |
342 | if (targetEditPart instanceof ForkActionEditPart) { |
343 | types |
344 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
345 | } |
346 | if (targetEditPart instanceof RecoveryActionEditPart) { |
347 | types |
348 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
349 | } |
350 | if (targetEditPart instanceof StartAction2EditPart) { |
351 | types |
352 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
353 | } |
354 | if (targetEditPart instanceof StopAction2EditPart) { |
355 | types |
356 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
357 | } |
358 | if (targetEditPart instanceof LoopAction2EditPart) { |
359 | types |
360 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
361 | } |
362 | if (targetEditPart instanceof InternalAction2EditPart) { |
363 | types |
364 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
365 | } |
366 | if (targetEditPart instanceof BranchAction2EditPart) { |
367 | types |
368 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
369 | } |
370 | if (targetEditPart instanceof ExternalCallAction2EditPart) { |
371 | types |
372 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
373 | } |
374 | if (targetEditPart instanceof EmitEventAction2EditPart) { |
375 | types |
376 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
377 | } |
378 | if (targetEditPart instanceof AcquireAction2EditPart) { |
379 | types |
380 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
381 | } |
382 | if (targetEditPart instanceof ReleaseAction2EditPart) { |
383 | types |
384 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
385 | } |
386 | if (targetEditPart instanceof ForkAction2EditPart) { |
387 | types |
388 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
389 | } |
390 | if (targetEditPart instanceof de.uka.ipd.sdq.pcm.gmf.seff.edit.parts.CollectionIteratorAction2EditPart) { |
391 | types |
392 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
393 | } |
394 | if (targetEditPart instanceof RecoveryAction2EditPart) { |
395 | types |
396 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
397 | } |
398 | if (targetEditPart instanceof SetVariableAction2EditPart) { |
399 | types |
400 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
401 | } |
402 | return types; |
403 | } |
404 | |
405 | /** |
406 | * @generated |
407 | */ |
408 | public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForTarget( |
409 | IElementType relationshipType) { |
410 | List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/(); |
411 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
412 | types.add(PalladioComponentModelElementTypes.StartAction_2001); |
413 | } |
414 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
415 | types.add(PalladioComponentModelElementTypes.StopAction_2002); |
416 | } |
417 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
418 | types |
419 | .add(PalladioComponentModelElementTypes.ExternalCallAction_2003); |
420 | } |
421 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
422 | types.add(PalladioComponentModelElementTypes.EmitEventAction_2013); |
423 | } |
424 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
425 | types.add(PalladioComponentModelElementTypes.LoopAction_2004); |
426 | } |
427 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
428 | types.add(PalladioComponentModelElementTypes.BranchAction_2005); |
429 | } |
430 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
431 | types.add(PalladioComponentModelElementTypes.InternalAction_2006); |
432 | } |
433 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
434 | types |
435 | .add(PalladioComponentModelElementTypes.CollectionIteratorAction_2007); |
436 | } |
437 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
438 | types |
439 | .add(PalladioComponentModelElementTypes.SetVariableAction_2008); |
440 | } |
441 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
442 | types.add(PalladioComponentModelElementTypes.AcquireAction_2012); |
443 | } |
444 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
445 | types.add(PalladioComponentModelElementTypes.ReleaseAction_2010); |
446 | } |
447 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
448 | types.add(PalladioComponentModelElementTypes.ForkAction_2011); |
449 | } |
450 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
451 | types.add(PalladioComponentModelElementTypes.RecoveryAction_2016); |
452 | } |
453 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
454 | types.add(PalladioComponentModelElementTypes.StartAction_3004); |
455 | } |
456 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
457 | types.add(PalladioComponentModelElementTypes.StopAction_3005); |
458 | } |
459 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
460 | types.add(PalladioComponentModelElementTypes.LoopAction_3006); |
461 | } |
462 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
463 | types.add(PalladioComponentModelElementTypes.InternalAction_3007); |
464 | } |
465 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
466 | types.add(PalladioComponentModelElementTypes.BranchAction_3009); |
467 | } |
468 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
469 | types |
470 | .add(PalladioComponentModelElementTypes.ExternalCallAction_3012); |
471 | } |
472 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
473 | types.add(PalladioComponentModelElementTypes.EmitEventAction_3046); |
474 | } |
475 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
476 | types.add(PalladioComponentModelElementTypes.AcquireAction_3026); |
477 | } |
478 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
479 | types.add(PalladioComponentModelElementTypes.ReleaseAction_3020); |
480 | } |
481 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
482 | types.add(PalladioComponentModelElementTypes.ForkAction_3023); |
483 | } |
484 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
485 | types |
486 | .add(PalladioComponentModelElementTypes.CollectionIteratorAction_3013); |
487 | } |
488 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
489 | types.add(PalladioComponentModelElementTypes.RecoveryAction_3057); |
490 | } |
491 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
492 | types |
493 | .add(PalladioComponentModelElementTypes.SetVariableAction_3024); |
494 | } |
495 | return types; |
496 | } |
497 | |
498 | /** |
499 | * @generated |
500 | */ |
501 | public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnTarget() { |
502 | List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/(); |
503 | types |
504 | .add(PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001); |
505 | return types; |
506 | } |
507 | |
508 | /** |
509 | * @generated |
510 | */ |
511 | public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForSource( |
512 | IElementType relationshipType) { |
513 | List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/(); |
514 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
515 | types.add(PalladioComponentModelElementTypes.StartAction_2001); |
516 | } |
517 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
518 | types.add(PalladioComponentModelElementTypes.StopAction_2002); |
519 | } |
520 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
521 | types |
522 | .add(PalladioComponentModelElementTypes.ExternalCallAction_2003); |
523 | } |
524 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
525 | types.add(PalladioComponentModelElementTypes.EmitEventAction_2013); |
526 | } |
527 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
528 | types.add(PalladioComponentModelElementTypes.LoopAction_2004); |
529 | } |
530 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
531 | types.add(PalladioComponentModelElementTypes.BranchAction_2005); |
532 | } |
533 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
534 | types.add(PalladioComponentModelElementTypes.InternalAction_2006); |
535 | } |
536 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
537 | types |
538 | .add(PalladioComponentModelElementTypes.CollectionIteratorAction_2007); |
539 | } |
540 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
541 | types |
542 | .add(PalladioComponentModelElementTypes.SetVariableAction_2008); |
543 | } |
544 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
545 | types.add(PalladioComponentModelElementTypes.AcquireAction_2012); |
546 | } |
547 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
548 | types.add(PalladioComponentModelElementTypes.ReleaseAction_2010); |
549 | } |
550 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
551 | types.add(PalladioComponentModelElementTypes.ForkAction_2011); |
552 | } |
553 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
554 | types.add(PalladioComponentModelElementTypes.RecoveryAction_2016); |
555 | } |
556 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
557 | types.add(PalladioComponentModelElementTypes.StartAction_3004); |
558 | } |
559 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
560 | types.add(PalladioComponentModelElementTypes.StopAction_3005); |
561 | } |
562 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
563 | types.add(PalladioComponentModelElementTypes.LoopAction_3006); |
564 | } |
565 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
566 | types.add(PalladioComponentModelElementTypes.InternalAction_3007); |
567 | } |
568 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
569 | types.add(PalladioComponentModelElementTypes.BranchAction_3009); |
570 | } |
571 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
572 | types |
573 | .add(PalladioComponentModelElementTypes.ExternalCallAction_3012); |
574 | } |
575 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
576 | types.add(PalladioComponentModelElementTypes.EmitEventAction_3046); |
577 | } |
578 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
579 | types.add(PalladioComponentModelElementTypes.AcquireAction_3026); |
580 | } |
581 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
582 | types.add(PalladioComponentModelElementTypes.ReleaseAction_3020); |
583 | } |
584 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
585 | types.add(PalladioComponentModelElementTypes.ForkAction_3023); |
586 | } |
587 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
588 | types |
589 | .add(PalladioComponentModelElementTypes.CollectionIteratorAction_3013); |
590 | } |
591 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
592 | types.add(PalladioComponentModelElementTypes.RecoveryAction_3057); |
593 | } |
594 | if (relationshipType == PalladioComponentModelElementTypes.AbstractActionSuccessor_AbstractAction_4001) { |
595 | types |
596 | .add(PalladioComponentModelElementTypes.SetVariableAction_3024); |
597 | } |
598 | return types; |
599 | } |
600 | |
601 | /** |
602 | * @generated |
603 | */ |
604 | public class CollectionIteratorFigure extends RoundedRectangle { |
605 | /** |
606 | * @generated |
607 | */ |
608 | private WrappingLabel fFigureCollectionIteratorNameLabelFigure; |
609 | /** |
610 | * @generated |
611 | */ |
612 | private WrappingLabel fFigureCollectionIteratorParameterLabelFigure; |
613 | |
614 | /** |
615 | * @generated |
616 | */ |
617 | public CollectionIteratorFigure() { |
618 | |
619 | GridLayout layoutThis = new GridLayout(); |
620 | layoutThis.numColumns = 1; |
621 | layoutThis.makeColumnsEqualWidth = true; |
622 | layoutThis.horizontalSpacing = 0; |
623 | layoutThis.verticalSpacing = 0; |
624 | layoutThis.marginWidth = 0; |
625 | layoutThis.marginHeight = 0; |
626 | this.setLayoutManager(layoutThis); |
627 | |
628 | this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(8), |
629 | getMapMode().DPtoLP(8))); |
630 | this.setLineWidth(1); |
631 | this.setMinimumSize(new Dimension(getMapMode().DPtoLP(0), |
632 | getMapMode().DPtoLP(0))); |
633 | createContents(); |
634 | } |
635 | |
636 | /** |
637 | * @generated |
638 | */ |
639 | private void createContents() { |
640 | |
641 | WrappingLabel collectionIteratorStereotype0 = new WrappingLabel(); |
642 | collectionIteratorStereotype0 |
643 | .setText("<<CollectionIteratorAction>>"); |
644 | collectionIteratorStereotype0.setBorder(new MarginBorder( |
645 | getMapMode().DPtoLP(2), getMapMode().DPtoLP(0), |
646 | getMapMode().DPtoLP(2), getMapMode().DPtoLP(0))); |
647 | |
648 | GridData constraintCollectionIteratorStereotype0 = new GridData(); |
649 | constraintCollectionIteratorStereotype0.verticalAlignment = GridData.CENTER; |
650 | constraintCollectionIteratorStereotype0.horizontalAlignment = GridData.CENTER; |
651 | constraintCollectionIteratorStereotype0.horizontalIndent = 0; |
652 | constraintCollectionIteratorStereotype0.horizontalSpan = 1; |
653 | constraintCollectionIteratorStereotype0.verticalSpan = 1; |
654 | constraintCollectionIteratorStereotype0.grabExcessHorizontalSpace = false; |
655 | constraintCollectionIteratorStereotype0.grabExcessVerticalSpace = false; |
656 | this.add(collectionIteratorStereotype0, |
657 | constraintCollectionIteratorStereotype0); |
658 | |
659 | fFigureCollectionIteratorNameLabelFigure = new WrappingLabel(); |
660 | fFigureCollectionIteratorNameLabelFigure.setText("myLoop"); |
661 | fFigureCollectionIteratorNameLabelFigure |
662 | .setBorder(new MarginBorder(getMapMode().DPtoLP(2), |
663 | getMapMode().DPtoLP(0), getMapMode().DPtoLP(2), |
664 | getMapMode().DPtoLP(0))); |
665 | |
666 | GridData constraintFFigureCollectionIteratorNameLabelFigure = new GridData(); |
667 | constraintFFigureCollectionIteratorNameLabelFigure.verticalAlignment = GridData.CENTER; |
668 | constraintFFigureCollectionIteratorNameLabelFigure.horizontalAlignment = GridData.CENTER; |
669 | constraintFFigureCollectionIteratorNameLabelFigure.horizontalIndent = 0; |
670 | constraintFFigureCollectionIteratorNameLabelFigure.horizontalSpan = 1; |
671 | constraintFFigureCollectionIteratorNameLabelFigure.verticalSpan = 1; |
672 | constraintFFigureCollectionIteratorNameLabelFigure.grabExcessHorizontalSpace = false; |
673 | constraintFFigureCollectionIteratorNameLabelFigure.grabExcessVerticalSpace = false; |
674 | this.add(fFigureCollectionIteratorNameLabelFigure, |
675 | constraintFFigureCollectionIteratorNameLabelFigure); |
676 | |
677 | fFigureCollectionIteratorParameterLabelFigure = new WrappingLabel(); |
678 | fFigureCollectionIteratorParameterLabelFigure.setText(""); |
679 | fFigureCollectionIteratorParameterLabelFigure |
680 | .setBorder(new MarginBorder(getMapMode().DPtoLP(2), |
681 | getMapMode().DPtoLP(0), getMapMode().DPtoLP(2), |
682 | getMapMode().DPtoLP(0))); |
683 | |
684 | GridData constraintFFigureCollectionIteratorParameterLabelFigure = new GridData(); |
685 | constraintFFigureCollectionIteratorParameterLabelFigure.verticalAlignment = GridData.CENTER; |
686 | constraintFFigureCollectionIteratorParameterLabelFigure.horizontalAlignment = GridData.CENTER; |
687 | constraintFFigureCollectionIteratorParameterLabelFigure.horizontalIndent = 0; |
688 | constraintFFigureCollectionIteratorParameterLabelFigure.horizontalSpan = 1; |
689 | constraintFFigureCollectionIteratorParameterLabelFigure.verticalSpan = 1; |
690 | constraintFFigureCollectionIteratorParameterLabelFigure.grabExcessHorizontalSpace = false; |
691 | constraintFFigureCollectionIteratorParameterLabelFigure.grabExcessVerticalSpace = false; |
692 | this.add(fFigureCollectionIteratorParameterLabelFigure, |
693 | constraintFFigureCollectionIteratorParameterLabelFigure); |
694 | |
695 | } |
696 | |
697 | /** |
698 | * @generated |
699 | */ |
700 | public WrappingLabel getFigureCollectionIteratorNameLabelFigure() { |
701 | return fFigureCollectionIteratorNameLabelFigure; |
702 | } |
703 | |
704 | /** |
705 | * @generated |
706 | */ |
707 | public WrappingLabel getFigureCollectionIteratorParameterLabelFigure() { |
708 | return fFigureCollectionIteratorParameterLabelFigure; |
709 | } |
710 | |
711 | /** |
712 | * @generated |
713 | */ |
714 | private boolean myUseLocalCoordinates = false; |
715 | |
716 | /** |
717 | * @generated |
718 | */ |
719 | protected boolean useLocalCoordinates() { |
720 | return myUseLocalCoordinates; |
721 | } |
722 | |
723 | /** |
724 | * @generated |
725 | */ |
726 | protected void setUseLocalCoordinates(boolean useLocalCoordinates) { |
727 | myUseLocalCoordinates = useLocalCoordinates; |
728 | } |
729 | |
730 | @Override |
731 | public void add(IFigure figure, Object constraint, int index) { |
732 | Object newConstraint = constraint; |
733 | if (newConstraint == null) { |
734 | GridData layout = new GridData(); |
735 | layout.grabExcessHorizontalSpace = true; |
736 | layout.grabExcessVerticalSpace = true; |
737 | layout.horizontalAlignment = SWT.FILL; |
738 | layout.verticalAlignment = SWT.FILL; |
739 | layout.horizontalSpan = 1; |
740 | layout.verticalSpan = 1; |
741 | |
742 | newConstraint = layout; |
743 | } |
744 | super.add(figure, newConstraint, index); |
745 | } |
746 | } |
747 | |
748 | } |