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