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