1 | /* |
2 | *Copyright 2007, IPD, SDQ, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.repository.providers; |
5 | |
6 | import java.util.ArrayList; |
7 | |
8 | import org.eclipse.core.runtime.IAdaptable; |
9 | import org.eclipse.emf.ecore.EAnnotation; |
10 | import org.eclipse.emf.ecore.EObject; |
11 | import org.eclipse.emf.ecore.EcoreFactory; |
12 | import org.eclipse.emf.transaction.util.TransactionUtil; |
13 | import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; |
14 | import org.eclipse.gmf.runtime.common.core.service.IOperation; |
15 | import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; |
16 | import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider; |
17 | import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; |
18 | import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation; |
19 | import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation; |
20 | import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation; |
21 | import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation; |
22 | import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; |
23 | import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants; |
24 | import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; |
25 | import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; |
26 | import org.eclipse.gmf.runtime.emf.type.core.IElementType; |
27 | import org.eclipse.gmf.runtime.emf.type.core.IHintedType; |
28 | import org.eclipse.gmf.runtime.notation.Connector; |
29 | import org.eclipse.gmf.runtime.notation.DecorationNode; |
30 | import org.eclipse.gmf.runtime.notation.Diagram; |
31 | import org.eclipse.gmf.runtime.notation.Edge; |
32 | import org.eclipse.gmf.runtime.notation.FontStyle; |
33 | import org.eclipse.gmf.runtime.notation.HintedDiagramLinkStyle; |
34 | import org.eclipse.gmf.runtime.notation.Location; |
35 | import org.eclipse.gmf.runtime.notation.MeasurementUnit; |
36 | import org.eclipse.gmf.runtime.notation.Node; |
37 | import org.eclipse.gmf.runtime.notation.NotationFactory; |
38 | import org.eclipse.gmf.runtime.notation.NotationPackage; |
39 | import org.eclipse.gmf.runtime.notation.RelativeBendpoints; |
40 | import org.eclipse.gmf.runtime.notation.Routing; |
41 | import org.eclipse.gmf.runtime.notation.Shape; |
42 | import org.eclipse.gmf.runtime.notation.TitleStyle; |
43 | import org.eclipse.gmf.runtime.notation.View; |
44 | import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint; |
45 | import org.eclipse.jface.preference.IPreferenceStore; |
46 | import org.eclipse.jface.preference.PreferenceConverter; |
47 | import org.eclipse.swt.SWT; |
48 | import org.eclipse.swt.graphics.FontData; |
49 | |
50 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.BasicComponentComponentParameterCompartmentEditPart; |
51 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.BasicComponentEditPart; |
52 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.BasicComponentEntityNameEditPart; |
53 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.BasicComponentPassiveResourceCompartmentEditPart; |
54 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.BasicComponentSEFFCompartmentEditPart; |
55 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.CompleteComponentTypeEditPart; |
56 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.CompleteComponentTypeEntityNameEditPart; |
57 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.CompleteComponentTypeParentProvidesComponentTypesEditPart; |
58 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.CompleteComponentTypeParentProvidesComponentTypesLabelEditPart; |
59 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.CompositeComponentEditPart; |
60 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.CompositeComponentEntityNameEditPart; |
61 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.EventGroupEditPart; |
62 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.EventGroupEntityNameEditPart; |
63 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.EventGroupEventTypeListEditPart; |
64 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.EventTypeEditPart; |
65 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.ImplementationComponentTypeParentCompleteComponentTypesEditPart; |
66 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.ImplementationComponentTypeParentCompleteTypesLabelEditPart; |
67 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.InfrastructureInterfaceEditPart; |
68 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.InfrastructureInterfaceEntityNameEditPart; |
69 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.InfrastructureInterfaceInfrastructureSignatureListEditPart; |
70 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.InfrastructureProvidedRoleEditPart; |
71 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.InfrastructureRequiredRoleEditPart; |
72 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.InfrastructureSignatureEditPart; |
73 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationInterfaceEditPart; |
74 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationInterfaceEntityNameEditPart; |
75 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationInterfaceSignatureListEditPart; |
76 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationProvidedRoleEditPart; |
77 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationProvidedRoleLabelEditPart; |
78 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationRequiredRoleEditPart; |
79 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationRequiredRoleLabelEditPart; |
80 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.OperationSignatureEditPart; |
81 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.PassiveResourceEditPart; |
82 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.ProvidesComponentTypeEditPart; |
83 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.ProvidesComponentTypeEntityNameEditPart; |
84 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.RepositoryEditPart; |
85 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.ResourceDemandingSEFFEditPart; |
86 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.SinkRoleEditPart; |
87 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.SinkRoleLabelEditPart; |
88 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.SourceRoleEditPart; |
89 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.SourceRoleLabelEditPart; |
90 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.SubSystemEditPart; |
91 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.SubSystemEntityNameEditPart; |
92 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.VariableCharacterisationEditPart; |
93 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.VariableUsageComponentParameterVariableCharacterisationCompartmentEditPart; |
94 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.VariableUsageEditPart; |
95 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.VariableUsageLabelEditPart; |
96 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.WrappingLabel2EditPart; |
97 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.WrappingLabelEditPart; |
98 | import de.uka.ipd.sdq.pcm.gmf.repository.part.PalladioComponentModelVisualIDRegistry; |
99 | |
100 | /** |
101 | * @generated |
102 | */ |
103 | public class PalladioComponentModelViewProvider extends AbstractProvider |
104 | implements IViewProvider { |
105 | |
106 | /** |
107 | * @generated |
108 | */ |
109 | public final boolean provides(IOperation operation) { |
110 | if (operation instanceof CreateViewForKindOperation) { |
111 | return provides((CreateViewForKindOperation) operation); |
112 | } |
113 | assert operation instanceof CreateViewOperation; |
114 | if (operation instanceof CreateDiagramViewOperation) { |
115 | return provides((CreateDiagramViewOperation) operation); |
116 | } else if (operation instanceof CreateEdgeViewOperation) { |
117 | return provides((CreateEdgeViewOperation) operation); |
118 | } else if (operation instanceof CreateNodeViewOperation) { |
119 | return provides((CreateNodeViewOperation) operation); |
120 | } |
121 | return false; |
122 | } |
123 | |
124 | /** |
125 | * @generated |
126 | */ |
127 | protected boolean provides(CreateViewForKindOperation op) { |
128 | /* |
129 | if (op.getViewKind() == Node.class) |
130 | return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; |
131 | if (op.getViewKind() == Edge.class) |
132 | return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; |
133 | */ |
134 | return true; |
135 | } |
136 | |
137 | /** |
138 | * @generated |
139 | */ |
140 | protected boolean provides(CreateDiagramViewOperation op) { |
141 | return RepositoryEditPart.MODEL_ID.equals(op.getSemanticHint()) |
142 | && PalladioComponentModelVisualIDRegistry |
143 | .getDiagramVisualID(getSemanticElement(op |
144 | .getSemanticAdapter())) != -1; |
145 | } |
146 | |
147 | /** |
148 | * @generated |
149 | */ |
150 | protected boolean provides(CreateNodeViewOperation op) { |
151 | if (op.getContainerView() == null) { |
152 | return false; |
153 | } |
154 | IElementType elementType = getSemanticElementType(op |
155 | .getSemanticAdapter()); |
156 | EObject domainElement = getSemanticElement(op.getSemanticAdapter()); |
157 | int visualID; |
158 | if (op.getSemanticHint() == null) { |
159 | // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy. |
160 | // In this situation there should be NO elementType, visualID will be determined |
161 | // by VisualIDRegistry.getNodeVisualID() for domainElement. |
162 | if (elementType != null || domainElement == null) { |
163 | return false; |
164 | } |
165 | visualID = PalladioComponentModelVisualIDRegistry.getNodeVisualID( |
166 | op.getContainerView(), domainElement); |
167 | } else { |
168 | visualID = PalladioComponentModelVisualIDRegistry.getVisualID(op |
169 | .getSemanticHint()); |
170 | if (elementType != null) { |
171 | if (!PalladioComponentModelElementTypes |
172 | .isKnownElementType(elementType) |
173 | || (!(elementType instanceof IHintedType))) { |
174 | return false; // foreign element type |
175 | } |
176 | String elementTypeHint = ((IHintedType) elementType) |
177 | .getSemanticHint(); |
178 | if (!op.getSemanticHint().equals(elementTypeHint)) { |
179 | return false; // if semantic hint is specified it should be the same as in element type |
180 | } |
181 | if (domainElement != null |
182 | && visualID != PalladioComponentModelVisualIDRegistry |
183 | .getNodeVisualID(op.getContainerView(), |
184 | domainElement)) { |
185 | return false; // visual id for node EClass should match visual id from element type |
186 | } |
187 | } else { |
188 | if (!RepositoryEditPart.MODEL_ID |
189 | .equals(PalladioComponentModelVisualIDRegistry |
190 | .getModelID(op.getContainerView()))) { |
191 | return false; // foreign diagram |
192 | } |
193 | switch (visualID) { |
194 | case OperationInterfaceEditPart.VISUAL_ID: |
195 | case EventGroupEditPart.VISUAL_ID: |
196 | case BasicComponentEditPart.VISUAL_ID: |
197 | case CompositeComponentEditPart.VISUAL_ID: |
198 | case CompleteComponentTypeEditPart.VISUAL_ID: |
199 | case ProvidesComponentTypeEditPart.VISUAL_ID: |
200 | case SubSystemEditPart.VISUAL_ID: |
201 | case InfrastructureInterfaceEditPart.VISUAL_ID: |
202 | case OperationSignatureEditPart.VISUAL_ID: |
203 | case EventTypeEditPart.VISUAL_ID: |
204 | case ResourceDemandingSEFFEditPart.VISUAL_ID: |
205 | case PassiveResourceEditPart.VISUAL_ID: |
206 | case VariableUsageEditPart.VISUAL_ID: |
207 | case VariableCharacterisationEditPart.VISUAL_ID: |
208 | case InfrastructureSignatureEditPart.VISUAL_ID: |
209 | if (domainElement == null |
210 | || visualID != PalladioComponentModelVisualIDRegistry |
211 | .getNodeVisualID(op.getContainerView(), |
212 | domainElement)) { |
213 | return false; // visual id in semantic hint should match visual id for domain element |
214 | } |
215 | break; |
216 | default: |
217 | return false; |
218 | } |
219 | } |
220 | } |
221 | return OperationInterfaceEditPart.VISUAL_ID == visualID |
222 | || EventGroupEditPart.VISUAL_ID == visualID |
223 | || BasicComponentEditPart.VISUAL_ID == visualID |
224 | || CompositeComponentEditPart.VISUAL_ID == visualID |
225 | || CompleteComponentTypeEditPart.VISUAL_ID == visualID |
226 | || ProvidesComponentTypeEditPart.VISUAL_ID == visualID |
227 | || SubSystemEditPart.VISUAL_ID == visualID |
228 | || InfrastructureInterfaceEditPart.VISUAL_ID == visualID |
229 | || OperationSignatureEditPart.VISUAL_ID == visualID |
230 | || EventTypeEditPart.VISUAL_ID == visualID |
231 | || ResourceDemandingSEFFEditPart.VISUAL_ID == visualID |
232 | || PassiveResourceEditPart.VISUAL_ID == visualID |
233 | || VariableUsageEditPart.VISUAL_ID == visualID |
234 | || VariableCharacterisationEditPart.VISUAL_ID == visualID |
235 | || InfrastructureSignatureEditPart.VISUAL_ID == visualID; |
236 | } |
237 | |
238 | /** |
239 | * @generated |
240 | */ |
241 | protected boolean provides(CreateEdgeViewOperation op) { |
242 | IElementType elementType = getSemanticElementType(op |
243 | .getSemanticAdapter()); |
244 | if (!PalladioComponentModelElementTypes.isKnownElementType(elementType) |
245 | || (!(elementType instanceof IHintedType))) { |
246 | return false; // foreign element type |
247 | } |
248 | String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); |
249 | if (elementTypeHint == null |
250 | || (op.getSemanticHint() != null && !elementTypeHint.equals(op |
251 | .getSemanticHint()))) { |
252 | return false; // our hint is visual id and must be specified, and it should be the same as in element type |
253 | } |
254 | int visualID = PalladioComponentModelVisualIDRegistry |
255 | .getVisualID(elementTypeHint); |
256 | EObject domainElement = getSemanticElement(op.getSemanticAdapter()); |
257 | if (domainElement != null |
258 | && visualID != PalladioComponentModelVisualIDRegistry |
259 | .getLinkWithClassVisualID(domainElement)) { |
260 | return false; // visual id for link EClass should match visual id from element type |
261 | } |
262 | return true; |
263 | } |
264 | |
265 | /** |
266 | * @generated |
267 | */ |
268 | public Diagram createDiagram(IAdaptable semanticAdapter, |
269 | String diagramKind, PreferencesHint preferencesHint) { |
270 | Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); |
271 | diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle()); |
272 | diagram.setType(RepositoryEditPart.MODEL_ID); |
273 | diagram.setElement(getSemanticElement(semanticAdapter)); |
274 | diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL); |
275 | return diagram; |
276 | } |
277 | |
278 | /** |
279 | * @generated |
280 | */ |
281 | public Node createNode(IAdaptable semanticAdapter, View containerView, |
282 | String semanticHint, int index, boolean persisted, |
283 | PreferencesHint preferencesHint) { |
284 | final EObject domainElement = getSemanticElement(semanticAdapter); |
285 | final int visualID; |
286 | if (semanticHint == null) { |
287 | visualID = PalladioComponentModelVisualIDRegistry.getNodeVisualID( |
288 | containerView, domainElement); |
289 | } else { |
290 | visualID = PalladioComponentModelVisualIDRegistry |
291 | .getVisualID(semanticHint); |
292 | } |
293 | switch (visualID) { |
294 | case OperationInterfaceEditPart.VISUAL_ID: |
295 | return createOperationInterface_2107(domainElement, containerView, |
296 | index, persisted, preferencesHint); |
297 | case EventGroupEditPart.VISUAL_ID: |
298 | return createEventGroup_2108(domainElement, containerView, index, |
299 | persisted, preferencesHint); |
300 | case BasicComponentEditPart.VISUAL_ID: |
301 | return createBasicComponent_2102(domainElement, containerView, |
302 | index, persisted, preferencesHint); |
303 | case CompositeComponentEditPart.VISUAL_ID: |
304 | return createCompositeComponent_2103(domainElement, containerView, |
305 | index, persisted, preferencesHint); |
306 | case CompleteComponentTypeEditPart.VISUAL_ID: |
307 | return createCompleteComponentType_2104(domainElement, |
308 | containerView, index, persisted, preferencesHint); |
309 | case ProvidesComponentTypeEditPart.VISUAL_ID: |
310 | return createProvidesComponentType_2105(domainElement, |
311 | containerView, index, persisted, preferencesHint); |
312 | case SubSystemEditPart.VISUAL_ID: |
313 | return createSubSystem_2106(domainElement, containerView, index, |
314 | persisted, preferencesHint); |
315 | case InfrastructureInterfaceEditPart.VISUAL_ID: |
316 | return createInfrastructureInterface_2109(domainElement, |
317 | containerView, index, persisted, preferencesHint); |
318 | case OperationSignatureEditPart.VISUAL_ID: |
319 | return createOperationSignature_3106(domainElement, containerView, |
320 | index, persisted, preferencesHint); |
321 | case EventTypeEditPart.VISUAL_ID: |
322 | return createEventType_3107(domainElement, containerView, index, |
323 | persisted, preferencesHint); |
324 | case ResourceDemandingSEFFEditPart.VISUAL_ID: |
325 | return createResourceDemandingSEFF_3102(domainElement, |
326 | containerView, index, persisted, preferencesHint); |
327 | case PassiveResourceEditPart.VISUAL_ID: |
328 | return createPassiveResource_3103(domainElement, containerView, |
329 | index, persisted, preferencesHint); |
330 | case VariableUsageEditPart.VISUAL_ID: |
331 | return createVariableUsage_3104(domainElement, containerView, |
332 | index, persisted, preferencesHint); |
333 | case VariableCharacterisationEditPart.VISUAL_ID: |
334 | return createVariableCharacterisation_3105(domainElement, |
335 | containerView, index, persisted, preferencesHint); |
336 | case InfrastructureSignatureEditPart.VISUAL_ID: |
337 | return createInfrastructureSignature_3108(domainElement, |
338 | containerView, index, persisted, preferencesHint); |
339 | } |
340 | // can't happen, provided #provides(CreateNodeViewOperation) is correct |
341 | return null; |
342 | } |
343 | |
344 | /** |
345 | * @generated |
346 | */ |
347 | public Edge createEdge(IAdaptable semanticAdapter, View containerView, |
348 | String semanticHint, int index, boolean persisted, |
349 | PreferencesHint preferencesHint) { |
350 | IElementType elementType = getSemanticElementType(semanticAdapter); |
351 | String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); |
352 | switch (PalladioComponentModelVisualIDRegistry |
353 | .getVisualID(elementTypeHint)) { |
354 | case OperationProvidedRoleEditPart.VISUAL_ID: |
355 | return createOperationProvidedRole_4105( |
356 | getSemanticElement(semanticAdapter), containerView, index, |
357 | persisted, preferencesHint); |
358 | case InfrastructureProvidedRoleEditPart.VISUAL_ID: |
359 | return createInfrastructureProvidedRole_4111( |
360 | getSemanticElement(semanticAdapter), containerView, index, |
361 | persisted, preferencesHint); |
362 | case InfrastructureRequiredRoleEditPart.VISUAL_ID: |
363 | return createInfrastructureRequiredRole_4112( |
364 | getSemanticElement(semanticAdapter), containerView, index, |
365 | persisted, preferencesHint); |
366 | case SinkRoleEditPart.VISUAL_ID: |
367 | return createSinkRole_4109(getSemanticElement(semanticAdapter), |
368 | containerView, index, persisted, preferencesHint); |
369 | case OperationRequiredRoleEditPart.VISUAL_ID: |
370 | return createOperationRequiredRole_4106( |
371 | getSemanticElement(semanticAdapter), containerView, index, |
372 | persisted, preferencesHint); |
373 | case ImplementationComponentTypeParentCompleteComponentTypesEditPart.VISUAL_ID: |
374 | return createImplementationComponentTypeParentCompleteComponentTypes_4103( |
375 | containerView, index, persisted, preferencesHint); |
376 | case CompleteComponentTypeParentProvidesComponentTypesEditPart.VISUAL_ID: |
377 | return createCompleteComponentTypeParentProvidesComponentTypes_4104( |
378 | containerView, index, persisted, preferencesHint); |
379 | case SourceRoleEditPart.VISUAL_ID: |
380 | return createSourceRole_4110(getSemanticElement(semanticAdapter), |
381 | containerView, index, persisted, preferencesHint); |
382 | } |
383 | // can never happen, provided #provides(CreateEdgeViewOperation) is correct |
384 | return null; |
385 | } |
386 | |
387 | /** |
388 | * @generated |
389 | */ |
390 | public Node createOperationInterface_2107(EObject domainElement, |
391 | View containerView, int index, boolean persisted, |
392 | PreferencesHint preferencesHint) { |
393 | Shape node = NotationFactory.eINSTANCE.createShape(); |
394 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
395 | node.setType(PalladioComponentModelVisualIDRegistry |
396 | .getType(OperationInterfaceEditPart.VISUAL_ID)); |
397 | ViewUtil.insertChildView(containerView, node, index, persisted); |
398 | node.setElement(domainElement); |
399 | stampShortcut(containerView, node); |
400 | // initializeFromPreferences |
401 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
402 | .getPreferenceStore(); |
403 | |
404 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
405 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
406 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
407 | .getLineStyle_LineColor(), FigureUtilities |
408 | .RGBToInteger(lineRGB)); |
409 | FontStyle nodeFontStyle = (FontStyle) node |
410 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
411 | if (nodeFontStyle != null) { |
412 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
413 | IPreferenceConstants.PREF_DEFAULT_FONT); |
414 | nodeFontStyle.setFontName(fontData.getName()); |
415 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
416 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
417 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
418 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
419 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
420 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
421 | .intValue()); |
422 | } |
423 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
424 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
425 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
426 | .getFillStyle_FillColor(), FigureUtilities |
427 | .RGBToInteger(fillRGB)); |
428 | Node label5108 = createLabel( |
429 | node, |
430 | PalladioComponentModelVisualIDRegistry |
431 | .getType(OperationInterfaceEntityNameEditPart.VISUAL_ID)); |
432 | createCompartment(node, PalladioComponentModelVisualIDRegistry |
433 | .getType(OperationInterfaceSignatureListEditPart.VISUAL_ID), |
434 | true, false, true, true); |
435 | return node; |
436 | } |
437 | |
438 | /** |
439 | * @generated |
440 | */ |
441 | public Node createEventGroup_2108(EObject domainElement, |
442 | View containerView, int index, boolean persisted, |
443 | PreferencesHint preferencesHint) { |
444 | Shape node = NotationFactory.eINSTANCE.createShape(); |
445 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
446 | node.setType(PalladioComponentModelVisualIDRegistry |
447 | .getType(EventGroupEditPart.VISUAL_ID)); |
448 | ViewUtil.insertChildView(containerView, node, index, persisted); |
449 | node.setElement(domainElement); |
450 | stampShortcut(containerView, node); |
451 | // initializeFromPreferences |
452 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
453 | .getPreferenceStore(); |
454 | |
455 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
456 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
457 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
458 | .getLineStyle_LineColor(), FigureUtilities |
459 | .RGBToInteger(lineRGB)); |
460 | FontStyle nodeFontStyle = (FontStyle) node |
461 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
462 | if (nodeFontStyle != null) { |
463 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
464 | IPreferenceConstants.PREF_DEFAULT_FONT); |
465 | nodeFontStyle.setFontName(fontData.getName()); |
466 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
467 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
468 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
469 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
470 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
471 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
472 | .intValue()); |
473 | } |
474 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
475 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
476 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
477 | .getFillStyle_FillColor(), FigureUtilities |
478 | .RGBToInteger(fillRGB)); |
479 | Node label5109 = createLabel(node, |
480 | PalladioComponentModelVisualIDRegistry |
481 | .getType(EventGroupEntityNameEditPart.VISUAL_ID)); |
482 | createCompartment(node, PalladioComponentModelVisualIDRegistry |
483 | .getType(EventGroupEventTypeListEditPart.VISUAL_ID), true, |
484 | false, true, true); |
485 | return node; |
486 | } |
487 | |
488 | /** |
489 | * @generated |
490 | */ |
491 | public Node createBasicComponent_2102(EObject domainElement, |
492 | View containerView, int index, boolean persisted, |
493 | PreferencesHint preferencesHint) { |
494 | Shape node = NotationFactory.eINSTANCE.createShape(); |
495 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
496 | node.setType(PalladioComponentModelVisualIDRegistry |
497 | .getType(BasicComponentEditPart.VISUAL_ID)); |
498 | ViewUtil.insertChildView(containerView, node, index, persisted); |
499 | node.setElement(domainElement); |
500 | stampShortcut(containerView, node); |
501 | // initializeFromPreferences |
502 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
503 | .getPreferenceStore(); |
504 | |
505 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
506 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
507 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
508 | .getLineStyle_LineColor(), FigureUtilities |
509 | .RGBToInteger(lineRGB)); |
510 | FontStyle nodeFontStyle = (FontStyle) node |
511 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
512 | if (nodeFontStyle != null) { |
513 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
514 | IPreferenceConstants.PREF_DEFAULT_FONT); |
515 | nodeFontStyle.setFontName(fontData.getName()); |
516 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
517 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
518 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
519 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
520 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
521 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
522 | .intValue()); |
523 | } |
524 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
525 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
526 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
527 | .getFillStyle_FillColor(), FigureUtilities |
528 | .RGBToInteger(fillRGB)); |
529 | Node label5102 = createLabel(node, |
530 | PalladioComponentModelVisualIDRegistry |
531 | .getType(BasicComponentEntityNameEditPart.VISUAL_ID)); |
532 | createCompartment(node, PalladioComponentModelVisualIDRegistry |
533 | .getType(BasicComponentSEFFCompartmentEditPart.VISUAL_ID), |
534 | false, false, true, true); |
535 | createCompartment( |
536 | node, |
537 | PalladioComponentModelVisualIDRegistry |
538 | .getType(BasicComponentPassiveResourceCompartmentEditPart.VISUAL_ID), |
539 | false, true, true, true); |
540 | createCompartment( |
541 | node, |
542 | PalladioComponentModelVisualIDRegistry |
543 | .getType(BasicComponentComponentParameterCompartmentEditPart.VISUAL_ID), |
544 | true, true, false, false); |
545 | return node; |
546 | } |
547 | |
548 | /** |
549 | * @generated |
550 | */ |
551 | public Node createCompositeComponent_2103(EObject domainElement, |
552 | View containerView, int index, boolean persisted, |
553 | PreferencesHint preferencesHint) { |
554 | Shape node = NotationFactory.eINSTANCE.createShape(); |
555 | { |
556 | HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE |
557 | .createHintedDiagramLinkStyle(); |
558 | diagramFacet.setHint("CompositeModel"); //$NON-NLS-1$ |
559 | node.getStyles().add(diagramFacet); |
560 | } |
561 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
562 | node.setType(PalladioComponentModelVisualIDRegistry |
563 | .getType(CompositeComponentEditPart.VISUAL_ID)); |
564 | ViewUtil.insertChildView(containerView, node, index, persisted); |
565 | node.setElement(domainElement); |
566 | stampShortcut(containerView, node); |
567 | // initializeFromPreferences |
568 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
569 | .getPreferenceStore(); |
570 | |
571 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
572 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
573 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
574 | .getLineStyle_LineColor(), FigureUtilities |
575 | .RGBToInteger(lineRGB)); |
576 | FontStyle nodeFontStyle = (FontStyle) node |
577 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
578 | if (nodeFontStyle != null) { |
579 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
580 | IPreferenceConstants.PREF_DEFAULT_FONT); |
581 | nodeFontStyle.setFontName(fontData.getName()); |
582 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
583 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
584 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
585 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
586 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
587 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
588 | .intValue()); |
589 | } |
590 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
591 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
592 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
593 | .getFillStyle_FillColor(), FigureUtilities |
594 | .RGBToInteger(fillRGB)); |
595 | Node label5103 = createLabel( |
596 | node, |
597 | PalladioComponentModelVisualIDRegistry |
598 | .getType(CompositeComponentEntityNameEditPart.VISUAL_ID)); |
599 | return node; |
600 | } |
601 | |
602 | /** |
603 | * @generated |
604 | */ |
605 | public Node createCompleteComponentType_2104(EObject domainElement, |
606 | View containerView, int index, boolean persisted, |
607 | PreferencesHint preferencesHint) { |
608 | Shape node = NotationFactory.eINSTANCE.createShape(); |
609 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
610 | node.setType(PalladioComponentModelVisualIDRegistry |
611 | .getType(CompleteComponentTypeEditPart.VISUAL_ID)); |
612 | ViewUtil.insertChildView(containerView, node, index, persisted); |
613 | node.setElement(domainElement); |
614 | stampShortcut(containerView, node); |
615 | // initializeFromPreferences |
616 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
617 | .getPreferenceStore(); |
618 | |
619 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
620 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
621 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
622 | .getLineStyle_LineColor(), FigureUtilities |
623 | .RGBToInteger(lineRGB)); |
624 | FontStyle nodeFontStyle = (FontStyle) node |
625 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
626 | if (nodeFontStyle != null) { |
627 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
628 | IPreferenceConstants.PREF_DEFAULT_FONT); |
629 | nodeFontStyle.setFontName(fontData.getName()); |
630 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
631 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
632 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
633 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
634 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
635 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
636 | .intValue()); |
637 | } |
638 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
639 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
640 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
641 | .getFillStyle_FillColor(), FigureUtilities |
642 | .RGBToInteger(fillRGB)); |
643 | Node label5104 = createLabel( |
644 | node, |
645 | PalladioComponentModelVisualIDRegistry |
646 | .getType(CompleteComponentTypeEntityNameEditPart.VISUAL_ID)); |
647 | return node; |
648 | } |
649 | |
650 | /** |
651 | * @generated |
652 | */ |
653 | public Node createProvidesComponentType_2105(EObject domainElement, |
654 | View containerView, int index, boolean persisted, |
655 | PreferencesHint preferencesHint) { |
656 | Shape node = NotationFactory.eINSTANCE.createShape(); |
657 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
658 | node.setType(PalladioComponentModelVisualIDRegistry |
659 | .getType(ProvidesComponentTypeEditPart.VISUAL_ID)); |
660 | ViewUtil.insertChildView(containerView, node, index, persisted); |
661 | node.setElement(domainElement); |
662 | stampShortcut(containerView, node); |
663 | // initializeFromPreferences |
664 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
665 | .getPreferenceStore(); |
666 | |
667 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
668 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
669 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
670 | .getLineStyle_LineColor(), FigureUtilities |
671 | .RGBToInteger(lineRGB)); |
672 | FontStyle nodeFontStyle = (FontStyle) node |
673 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
674 | if (nodeFontStyle != null) { |
675 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
676 | IPreferenceConstants.PREF_DEFAULT_FONT); |
677 | nodeFontStyle.setFontName(fontData.getName()); |
678 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
679 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
680 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
681 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
682 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
683 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
684 | .intValue()); |
685 | } |
686 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
687 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
688 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
689 | .getFillStyle_FillColor(), FigureUtilities |
690 | .RGBToInteger(fillRGB)); |
691 | Node label5105 = createLabel( |
692 | node, |
693 | PalladioComponentModelVisualIDRegistry |
694 | .getType(ProvidesComponentTypeEntityNameEditPart.VISUAL_ID)); |
695 | return node; |
696 | } |
697 | |
698 | /** |
699 | * @generated |
700 | */ |
701 | public Node createSubSystem_2106(EObject domainElement, View containerView, |
702 | int index, boolean persisted, PreferencesHint preferencesHint) { |
703 | Shape node = NotationFactory.eINSTANCE.createShape(); |
704 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
705 | node.setType(PalladioComponentModelVisualIDRegistry |
706 | .getType(SubSystemEditPart.VISUAL_ID)); |
707 | ViewUtil.insertChildView(containerView, node, index, persisted); |
708 | node.setElement(domainElement); |
709 | stampShortcut(containerView, node); |
710 | // initializeFromPreferences |
711 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
712 | .getPreferenceStore(); |
713 | |
714 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
715 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
716 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
717 | .getLineStyle_LineColor(), FigureUtilities |
718 | .RGBToInteger(lineRGB)); |
719 | FontStyle nodeFontStyle = (FontStyle) node |
720 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
721 | if (nodeFontStyle != null) { |
722 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
723 | IPreferenceConstants.PREF_DEFAULT_FONT); |
724 | nodeFontStyle.setFontName(fontData.getName()); |
725 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
726 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
727 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
728 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
729 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
730 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
731 | .intValue()); |
732 | } |
733 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
734 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
735 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
736 | .getFillStyle_FillColor(), FigureUtilities |
737 | .RGBToInteger(fillRGB)); |
738 | Node label5107 = createLabel(node, |
739 | PalladioComponentModelVisualIDRegistry |
740 | .getType(SubSystemEntityNameEditPart.VISUAL_ID)); |
741 | return node; |
742 | } |
743 | |
744 | /** |
745 | * @generated |
746 | */ |
747 | public Node createInfrastructureInterface_2109(EObject domainElement, |
748 | View containerView, int index, boolean persisted, |
749 | PreferencesHint preferencesHint) { |
750 | Shape node = NotationFactory.eINSTANCE.createShape(); |
751 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
752 | node.setType(PalladioComponentModelVisualIDRegistry |
753 | .getType(InfrastructureInterfaceEditPart.VISUAL_ID)); |
754 | ViewUtil.insertChildView(containerView, node, index, persisted); |
755 | node.setElement(domainElement); |
756 | stampShortcut(containerView, node); |
757 | // initializeFromPreferences |
758 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
759 | .getPreferenceStore(); |
760 | |
761 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
762 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
763 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
764 | .getLineStyle_LineColor(), FigureUtilities |
765 | .RGBToInteger(lineRGB)); |
766 | FontStyle nodeFontStyle = (FontStyle) node |
767 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
768 | if (nodeFontStyle != null) { |
769 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
770 | IPreferenceConstants.PREF_DEFAULT_FONT); |
771 | nodeFontStyle.setFontName(fontData.getName()); |
772 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
773 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
774 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
775 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
776 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
777 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
778 | .intValue()); |
779 | } |
780 | org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor( |
781 | prefStore, IPreferenceConstants.PREF_FILL_COLOR); |
782 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
783 | .getFillStyle_FillColor(), FigureUtilities |
784 | .RGBToInteger(fillRGB)); |
785 | Node label5110 = createLabel( |
786 | node, |
787 | PalladioComponentModelVisualIDRegistry |
788 | .getType(InfrastructureInterfaceEntityNameEditPart.VISUAL_ID)); |
789 | createCompartment( |
790 | node, |
791 | PalladioComponentModelVisualIDRegistry |
792 | .getType(InfrastructureInterfaceInfrastructureSignatureListEditPart.VISUAL_ID), |
793 | true, false, true, true); |
794 | return node; |
795 | } |
796 | |
797 | /** |
798 | * @generated |
799 | */ |
800 | public Node createOperationSignature_3106(EObject domainElement, |
801 | View containerView, int index, boolean persisted, |
802 | PreferencesHint preferencesHint) { |
803 | Node node = NotationFactory.eINSTANCE.createNode(); |
804 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); |
805 | node.setType(PalladioComponentModelVisualIDRegistry |
806 | .getType(OperationSignatureEditPart.VISUAL_ID)); |
807 | ViewUtil.insertChildView(containerView, node, index, persisted); |
808 | node.setElement(domainElement); |
809 | return node; |
810 | } |
811 | |
812 | /** |
813 | * @generated |
814 | */ |
815 | public Node createEventType_3107(EObject domainElement, View containerView, |
816 | int index, boolean persisted, PreferencesHint preferencesHint) { |
817 | Node node = NotationFactory.eINSTANCE.createNode(); |
818 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); |
819 | node.setType(PalladioComponentModelVisualIDRegistry |
820 | .getType(EventTypeEditPart.VISUAL_ID)); |
821 | ViewUtil.insertChildView(containerView, node, index, persisted); |
822 | node.setElement(domainElement); |
823 | return node; |
824 | } |
825 | |
826 | /** |
827 | * @generated |
828 | */ |
829 | public Node createResourceDemandingSEFF_3102(EObject domainElement, |
830 | View containerView, int index, boolean persisted, |
831 | PreferencesHint preferencesHint) { |
832 | Node node = NotationFactory.eINSTANCE.createNode(); |
833 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); |
834 | { |
835 | HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE |
836 | .createHintedDiagramLinkStyle(); |
837 | diagramFacet.setHint("PCM SEFF Model"); //$NON-NLS-1$ |
838 | node.getStyles().add(diagramFacet); |
839 | } |
840 | node.setType(PalladioComponentModelVisualIDRegistry |
841 | .getType(ResourceDemandingSEFFEditPart.VISUAL_ID)); |
842 | ViewUtil.insertChildView(containerView, node, index, persisted); |
843 | node.setElement(domainElement); |
844 | return node; |
845 | } |
846 | |
847 | /** |
848 | * @generated |
849 | */ |
850 | public Node createPassiveResource_3103(EObject domainElement, |
851 | View containerView, int index, boolean persisted, |
852 | PreferencesHint preferencesHint) { |
853 | Node node = NotationFactory.eINSTANCE.createNode(); |
854 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); |
855 | node.setType(PalladioComponentModelVisualIDRegistry |
856 | .getType(PassiveResourceEditPart.VISUAL_ID)); |
857 | ViewUtil.insertChildView(containerView, node, index, persisted); |
858 | node.setElement(domainElement); |
859 | return node; |
860 | } |
861 | |
862 | /** |
863 | * @generated |
864 | */ |
865 | public Node createVariableUsage_3104(EObject domainElement, |
866 | View containerView, int index, boolean persisted, |
867 | PreferencesHint preferencesHint) { |
868 | Node node = NotationFactory.eINSTANCE.createNode(); |
869 | node.getStyles() |
870 | .add(NotationFactory.eINSTANCE.createDescriptionStyle()); |
871 | node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
872 | node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle()); |
873 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); |
874 | node.setType(PalladioComponentModelVisualIDRegistry |
875 | .getType(VariableUsageEditPart.VISUAL_ID)); |
876 | ViewUtil.insertChildView(containerView, node, index, persisted); |
877 | node.setElement(domainElement); |
878 | // initializeFromPreferences |
879 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
880 | .getPreferenceStore(); |
881 | |
882 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
883 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
884 | ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE |
885 | .getLineStyle_LineColor(), FigureUtilities |
886 | .RGBToInteger(lineRGB)); |
887 | FontStyle nodeFontStyle = (FontStyle) node |
888 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
889 | if (nodeFontStyle != null) { |
890 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
891 | IPreferenceConstants.PREF_DEFAULT_FONT); |
892 | nodeFontStyle.setFontName(fontData.getName()); |
893 | nodeFontStyle.setFontHeight(fontData.getHeight()); |
894 | nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
895 | nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
896 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
897 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
898 | nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
899 | .intValue()); |
900 | } |
901 | Node label5106 = createLabel(node, |
902 | PalladioComponentModelVisualIDRegistry |
903 | .getType(VariableUsageLabelEditPart.VISUAL_ID)); |
904 | createCompartment( |
905 | node, |
906 | PalladioComponentModelVisualIDRegistry |
907 | .getType(VariableUsageComponentParameterVariableCharacterisationCompartmentEditPart.VISUAL_ID), |
908 | false, false, true, true); |
909 | return node; |
910 | } |
911 | |
912 | /** |
913 | * @generated |
914 | */ |
915 | public Node createVariableCharacterisation_3105(EObject domainElement, |
916 | View containerView, int index, boolean persisted, |
917 | PreferencesHint preferencesHint) { |
918 | Node node = NotationFactory.eINSTANCE.createNode(); |
919 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); |
920 | node.setType(PalladioComponentModelVisualIDRegistry |
921 | .getType(VariableCharacterisationEditPart.VISUAL_ID)); |
922 | ViewUtil.insertChildView(containerView, node, index, persisted); |
923 | node.setElement(domainElement); |
924 | return node; |
925 | } |
926 | |
927 | /** |
928 | * @generated |
929 | */ |
930 | public Node createInfrastructureSignature_3108(EObject domainElement, |
931 | View containerView, int index, boolean persisted, |
932 | PreferencesHint preferencesHint) { |
933 | Node node = NotationFactory.eINSTANCE.createNode(); |
934 | node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); |
935 | node.setType(PalladioComponentModelVisualIDRegistry |
936 | .getType(InfrastructureSignatureEditPart.VISUAL_ID)); |
937 | ViewUtil.insertChildView(containerView, node, index, persisted); |
938 | node.setElement(domainElement); |
939 | return node; |
940 | } |
941 | |
942 | /** |
943 | * @generated |
944 | */ |
945 | public Edge createOperationProvidedRole_4105(EObject domainElement, |
946 | View containerView, int index, boolean persisted, |
947 | PreferencesHint preferencesHint) { |
948 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
949 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
950 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
951 | .createRelativeBendpoints(); |
952 | ArrayList points = new ArrayList(2); |
953 | points.add(new RelativeBendpoint()); |
954 | points.add(new RelativeBendpoint()); |
955 | bendpoints.setPoints(points); |
956 | edge.setBendpoints(bendpoints); |
957 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
958 | edge.setType(PalladioComponentModelVisualIDRegistry |
959 | .getType(OperationProvidedRoleEditPart.VISUAL_ID)); |
960 | edge.setElement(domainElement); |
961 | // initializePreferences |
962 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
963 | .getPreferenceStore(); |
964 | |
965 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
966 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
967 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
968 | .getLineStyle_LineColor(), FigureUtilities |
969 | .RGBToInteger(lineRGB)); |
970 | FontStyle edgeFontStyle = (FontStyle) edge |
971 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
972 | if (edgeFontStyle != null) { |
973 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
974 | IPreferenceConstants.PREF_DEFAULT_FONT); |
975 | edgeFontStyle.setFontName(fontData.getName()); |
976 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
977 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
978 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
979 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
980 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
981 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
982 | .intValue()); |
983 | } |
984 | Routing routing = Routing.get(prefStore |
985 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
986 | if (routing != null) { |
987 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
988 | .getRoutingStyle_Routing(), routing); |
989 | } |
990 | Node label6105 = createLabel(edge, |
991 | PalladioComponentModelVisualIDRegistry |
992 | .getType(OperationProvidedRoleLabelEditPart.VISUAL_ID)); |
993 | label6105.getStyles().add( |
994 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
995 | label6105.setLayoutConstraint(NotationFactory.eINSTANCE |
996 | .createLocation()); |
997 | Location location6105 = (Location) label6105.getLayoutConstraint(); |
998 | location6105.setX(0); |
999 | location6105.setY(40); |
1000 | return edge; |
1001 | } |
1002 | |
1003 | /** |
1004 | * @generated |
1005 | */ |
1006 | public Edge createInfrastructureProvidedRole_4111(EObject domainElement, |
1007 | View containerView, int index, boolean persisted, |
1008 | PreferencesHint preferencesHint) { |
1009 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1010 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1011 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1012 | .createRelativeBendpoints(); |
1013 | ArrayList points = new ArrayList(2); |
1014 | points.add(new RelativeBendpoint()); |
1015 | points.add(new RelativeBendpoint()); |
1016 | bendpoints.setPoints(points); |
1017 | edge.setBendpoints(bendpoints); |
1018 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1019 | edge.setType(PalladioComponentModelVisualIDRegistry |
1020 | .getType(InfrastructureProvidedRoleEditPart.VISUAL_ID)); |
1021 | edge.setElement(domainElement); |
1022 | // initializePreferences |
1023 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1024 | .getPreferenceStore(); |
1025 | |
1026 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1027 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1028 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1029 | .getLineStyle_LineColor(), FigureUtilities |
1030 | .RGBToInteger(lineRGB)); |
1031 | FontStyle edgeFontStyle = (FontStyle) edge |
1032 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1033 | if (edgeFontStyle != null) { |
1034 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1035 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1036 | edgeFontStyle.setFontName(fontData.getName()); |
1037 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1038 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1039 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1040 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1041 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1042 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1043 | .intValue()); |
1044 | } |
1045 | Routing routing = Routing.get(prefStore |
1046 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1047 | if (routing != null) { |
1048 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1049 | .getRoutingStyle_Routing(), routing); |
1050 | } |
1051 | Node label6111 = createLabel(edge, |
1052 | PalladioComponentModelVisualIDRegistry |
1053 | .getType(WrappingLabelEditPart.VISUAL_ID)); |
1054 | label6111.getStyles().add( |
1055 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1056 | label6111.setLayoutConstraint(NotationFactory.eINSTANCE |
1057 | .createLocation()); |
1058 | Location location6111 = (Location) label6111.getLayoutConstraint(); |
1059 | location6111.setX(0); |
1060 | location6111.setY(40); |
1061 | return edge; |
1062 | } |
1063 | |
1064 | /** |
1065 | * @generated |
1066 | */ |
1067 | public Edge createInfrastructureRequiredRole_4112(EObject domainElement, |
1068 | View containerView, int index, boolean persisted, |
1069 | PreferencesHint preferencesHint) { |
1070 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1071 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1072 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1073 | .createRelativeBendpoints(); |
1074 | ArrayList points = new ArrayList(2); |
1075 | points.add(new RelativeBendpoint()); |
1076 | points.add(new RelativeBendpoint()); |
1077 | bendpoints.setPoints(points); |
1078 | edge.setBendpoints(bendpoints); |
1079 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1080 | edge.setType(PalladioComponentModelVisualIDRegistry |
1081 | .getType(InfrastructureRequiredRoleEditPart.VISUAL_ID)); |
1082 | edge.setElement(domainElement); |
1083 | // initializePreferences |
1084 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1085 | .getPreferenceStore(); |
1086 | |
1087 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1088 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1089 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1090 | .getLineStyle_LineColor(), FigureUtilities |
1091 | .RGBToInteger(lineRGB)); |
1092 | FontStyle edgeFontStyle = (FontStyle) edge |
1093 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1094 | if (edgeFontStyle != null) { |
1095 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1096 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1097 | edgeFontStyle.setFontName(fontData.getName()); |
1098 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1099 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1100 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1101 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1102 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1103 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1104 | .intValue()); |
1105 | } |
1106 | Routing routing = Routing.get(prefStore |
1107 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1108 | if (routing != null) { |
1109 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1110 | .getRoutingStyle_Routing(), routing); |
1111 | } |
1112 | Node label6112 = createLabel(edge, |
1113 | PalladioComponentModelVisualIDRegistry |
1114 | .getType(WrappingLabel2EditPart.VISUAL_ID)); |
1115 | label6112.getStyles().add( |
1116 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1117 | label6112.setLayoutConstraint(NotationFactory.eINSTANCE |
1118 | .createLocation()); |
1119 | Location location6112 = (Location) label6112.getLayoutConstraint(); |
1120 | location6112.setX(0); |
1121 | location6112.setY(40); |
1122 | return edge; |
1123 | } |
1124 | |
1125 | /** |
1126 | * @generated |
1127 | */ |
1128 | public Edge createSinkRole_4109(EObject domainElement, View containerView, |
1129 | int index, boolean persisted, PreferencesHint preferencesHint) { |
1130 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1131 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1132 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1133 | .createRelativeBendpoints(); |
1134 | ArrayList points = new ArrayList(2); |
1135 | points.add(new RelativeBendpoint()); |
1136 | points.add(new RelativeBendpoint()); |
1137 | bendpoints.setPoints(points); |
1138 | edge.setBendpoints(bendpoints); |
1139 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1140 | edge.setType(PalladioComponentModelVisualIDRegistry |
1141 | .getType(SinkRoleEditPart.VISUAL_ID)); |
1142 | edge.setElement(domainElement); |
1143 | // initializePreferences |
1144 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1145 | .getPreferenceStore(); |
1146 | |
1147 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1148 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1149 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1150 | .getLineStyle_LineColor(), FigureUtilities |
1151 | .RGBToInteger(lineRGB)); |
1152 | FontStyle edgeFontStyle = (FontStyle) edge |
1153 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1154 | if (edgeFontStyle != null) { |
1155 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1156 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1157 | edgeFontStyle.setFontName(fontData.getName()); |
1158 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1159 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1160 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1161 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1162 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1163 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1164 | .intValue()); |
1165 | } |
1166 | Routing routing = Routing.get(prefStore |
1167 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1168 | if (routing != null) { |
1169 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1170 | .getRoutingStyle_Routing(), routing); |
1171 | } |
1172 | Node label6109 = createLabel(edge, |
1173 | PalladioComponentModelVisualIDRegistry |
1174 | .getType(SinkRoleLabelEditPart.VISUAL_ID)); |
1175 | label6109.getStyles().add( |
1176 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1177 | label6109.setLayoutConstraint(NotationFactory.eINSTANCE |
1178 | .createLocation()); |
1179 | Location location6109 = (Location) label6109.getLayoutConstraint(); |
1180 | location6109.setX(0); |
1181 | location6109.setY(40); |
1182 | return edge; |
1183 | } |
1184 | |
1185 | /** |
1186 | * @generated |
1187 | */ |
1188 | public Edge createOperationRequiredRole_4106(EObject domainElement, |
1189 | View containerView, int index, boolean persisted, |
1190 | PreferencesHint preferencesHint) { |
1191 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1192 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1193 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1194 | .createRelativeBendpoints(); |
1195 | ArrayList points = new ArrayList(2); |
1196 | points.add(new RelativeBendpoint()); |
1197 | points.add(new RelativeBendpoint()); |
1198 | bendpoints.setPoints(points); |
1199 | edge.setBendpoints(bendpoints); |
1200 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1201 | edge.setType(PalladioComponentModelVisualIDRegistry |
1202 | .getType(OperationRequiredRoleEditPart.VISUAL_ID)); |
1203 | edge.setElement(domainElement); |
1204 | // initializePreferences |
1205 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1206 | .getPreferenceStore(); |
1207 | |
1208 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1209 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1210 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1211 | .getLineStyle_LineColor(), FigureUtilities |
1212 | .RGBToInteger(lineRGB)); |
1213 | FontStyle edgeFontStyle = (FontStyle) edge |
1214 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1215 | if (edgeFontStyle != null) { |
1216 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1217 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1218 | edgeFontStyle.setFontName(fontData.getName()); |
1219 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1220 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1221 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1222 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1223 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1224 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1225 | .intValue()); |
1226 | } |
1227 | Routing routing = Routing.get(prefStore |
1228 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1229 | if (routing != null) { |
1230 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1231 | .getRoutingStyle_Routing(), routing); |
1232 | } |
1233 | Node label6106 = createLabel(edge, |
1234 | PalladioComponentModelVisualIDRegistry |
1235 | .getType(OperationRequiredRoleLabelEditPart.VISUAL_ID)); |
1236 | label6106.getStyles().add( |
1237 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1238 | label6106.setLayoutConstraint(NotationFactory.eINSTANCE |
1239 | .createLocation()); |
1240 | Location location6106 = (Location) label6106.getLayoutConstraint(); |
1241 | location6106.setX(0); |
1242 | location6106.setY(40); |
1243 | return edge; |
1244 | } |
1245 | |
1246 | /** |
1247 | * @generated |
1248 | */ |
1249 | public Edge createImplementationComponentTypeParentCompleteComponentTypes_4103( |
1250 | View containerView, int index, boolean persisted, |
1251 | PreferencesHint preferencesHint) { |
1252 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1253 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1254 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1255 | .createRelativeBendpoints(); |
1256 | ArrayList points = new ArrayList(2); |
1257 | points.add(new RelativeBendpoint()); |
1258 | points.add(new RelativeBendpoint()); |
1259 | bendpoints.setPoints(points); |
1260 | edge.setBendpoints(bendpoints); |
1261 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1262 | edge |
1263 | .setType(PalladioComponentModelVisualIDRegistry |
1264 | .getType(ImplementationComponentTypeParentCompleteComponentTypesEditPart.VISUAL_ID)); |
1265 | edge.setElement(null); |
1266 | // initializePreferences |
1267 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1268 | .getPreferenceStore(); |
1269 | |
1270 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1271 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1272 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1273 | .getLineStyle_LineColor(), FigureUtilities |
1274 | .RGBToInteger(lineRGB)); |
1275 | FontStyle edgeFontStyle = (FontStyle) edge |
1276 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1277 | if (edgeFontStyle != null) { |
1278 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1279 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1280 | edgeFontStyle.setFontName(fontData.getName()); |
1281 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1282 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1283 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1284 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1285 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1286 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1287 | .intValue()); |
1288 | } |
1289 | Routing routing = Routing.get(prefStore |
1290 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1291 | if (routing != null) { |
1292 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1293 | .getRoutingStyle_Routing(), routing); |
1294 | } |
1295 | Node label6103 = createLabel( |
1296 | edge, |
1297 | PalladioComponentModelVisualIDRegistry |
1298 | .getType(ImplementationComponentTypeParentCompleteTypesLabelEditPart.VISUAL_ID)); |
1299 | label6103.getStyles().add( |
1300 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1301 | label6103.setLayoutConstraint(NotationFactory.eINSTANCE |
1302 | .createLocation()); |
1303 | Location location6103 = (Location) label6103.getLayoutConstraint(); |
1304 | location6103.setX(0); |
1305 | location6103.setY(40); |
1306 | return edge; |
1307 | } |
1308 | |
1309 | /** |
1310 | * @generated |
1311 | */ |
1312 | public Edge createCompleteComponentTypeParentProvidesComponentTypes_4104( |
1313 | View containerView, int index, boolean persisted, |
1314 | PreferencesHint preferencesHint) { |
1315 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1316 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1317 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1318 | .createRelativeBendpoints(); |
1319 | ArrayList points = new ArrayList(2); |
1320 | points.add(new RelativeBendpoint()); |
1321 | points.add(new RelativeBendpoint()); |
1322 | bendpoints.setPoints(points); |
1323 | edge.setBendpoints(bendpoints); |
1324 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1325 | edge |
1326 | .setType(PalladioComponentModelVisualIDRegistry |
1327 | .getType(CompleteComponentTypeParentProvidesComponentTypesEditPart.VISUAL_ID)); |
1328 | edge.setElement(null); |
1329 | // initializePreferences |
1330 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1331 | .getPreferenceStore(); |
1332 | |
1333 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1334 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1335 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1336 | .getLineStyle_LineColor(), FigureUtilities |
1337 | .RGBToInteger(lineRGB)); |
1338 | FontStyle edgeFontStyle = (FontStyle) edge |
1339 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1340 | if (edgeFontStyle != null) { |
1341 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1342 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1343 | edgeFontStyle.setFontName(fontData.getName()); |
1344 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1345 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1346 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1347 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1348 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1349 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1350 | .intValue()); |
1351 | } |
1352 | Routing routing = Routing.get(prefStore |
1353 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1354 | if (routing != null) { |
1355 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1356 | .getRoutingStyle_Routing(), routing); |
1357 | } |
1358 | Node label6104 = createLabel( |
1359 | edge, |
1360 | PalladioComponentModelVisualIDRegistry |
1361 | .getType(CompleteComponentTypeParentProvidesComponentTypesLabelEditPart.VISUAL_ID)); |
1362 | label6104.getStyles().add( |
1363 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1364 | label6104.setLayoutConstraint(NotationFactory.eINSTANCE |
1365 | .createLocation()); |
1366 | Location location6104 = (Location) label6104.getLayoutConstraint(); |
1367 | location6104.setX(0); |
1368 | location6104.setY(40); |
1369 | return edge; |
1370 | } |
1371 | |
1372 | /** |
1373 | * @generated |
1374 | */ |
1375 | public Edge createSourceRole_4110(EObject domainElement, |
1376 | View containerView, int index, boolean persisted, |
1377 | PreferencesHint preferencesHint) { |
1378 | Connector edge = NotationFactory.eINSTANCE.createConnector(); |
1379 | edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); |
1380 | RelativeBendpoints bendpoints = NotationFactory.eINSTANCE |
1381 | .createRelativeBendpoints(); |
1382 | ArrayList points = new ArrayList(2); |
1383 | points.add(new RelativeBendpoint()); |
1384 | points.add(new RelativeBendpoint()); |
1385 | bendpoints.setPoints(points); |
1386 | edge.setBendpoints(bendpoints); |
1387 | ViewUtil.insertChildView(containerView, edge, index, persisted); |
1388 | edge.setType(PalladioComponentModelVisualIDRegistry |
1389 | .getType(SourceRoleEditPart.VISUAL_ID)); |
1390 | edge.setElement(domainElement); |
1391 | // initializePreferences |
1392 | final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint |
1393 | .getPreferenceStore(); |
1394 | |
1395 | org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor( |
1396 | prefStore, IPreferenceConstants.PREF_LINE_COLOR); |
1397 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1398 | .getLineStyle_LineColor(), FigureUtilities |
1399 | .RGBToInteger(lineRGB)); |
1400 | FontStyle edgeFontStyle = (FontStyle) edge |
1401 | .getStyle(NotationPackage.Literals.FONT_STYLE); |
1402 | if (edgeFontStyle != null) { |
1403 | FontData fontData = PreferenceConverter.getFontData(prefStore, |
1404 | IPreferenceConstants.PREF_DEFAULT_FONT); |
1405 | edgeFontStyle.setFontName(fontData.getName()); |
1406 | edgeFontStyle.setFontHeight(fontData.getHeight()); |
1407 | edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); |
1408 | edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); |
1409 | org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter |
1410 | .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); |
1411 | edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB) |
1412 | .intValue()); |
1413 | } |
1414 | Routing routing = Routing.get(prefStore |
1415 | .getInt(IPreferenceConstants.PREF_LINE_STYLE)); |
1416 | if (routing != null) { |
1417 | ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE |
1418 | .getRoutingStyle_Routing(), routing); |
1419 | } |
1420 | Node label6110 = createLabel(edge, |
1421 | PalladioComponentModelVisualIDRegistry |
1422 | .getType(SourceRoleLabelEditPart.VISUAL_ID)); |
1423 | label6110.getStyles().add( |
1424 | NotationFactory.eINSTANCE.createDescriptionStyle()); |
1425 | label6110.setLayoutConstraint(NotationFactory.eINSTANCE |
1426 | .createLocation()); |
1427 | Location location6110 = (Location) label6110.getLayoutConstraint(); |
1428 | location6110.setX(0); |
1429 | location6110.setY(40); |
1430 | return edge; |
1431 | } |
1432 | |
1433 | /** |
1434 | * @generated |
1435 | */ |
1436 | private void stampShortcut(View containerView, Node target) { |
1437 | if (!RepositoryEditPart.MODEL_ID |
1438 | .equals(PalladioComponentModelVisualIDRegistry |
1439 | .getModelID(containerView))) { |
1440 | EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE |
1441 | .createEAnnotation(); |
1442 | shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ |
1443 | shortcutAnnotation.getDetails().put( |
1444 | "modelID", RepositoryEditPart.MODEL_ID); //$NON-NLS-1$ |
1445 | target.getEAnnotations().add(shortcutAnnotation); |
1446 | } |
1447 | } |
1448 | |
1449 | /** |
1450 | * @generated |
1451 | */ |
1452 | private Node createLabel(View owner, String hint) { |
1453 | DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode(); |
1454 | rv.setType(hint); |
1455 | ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); |
1456 | return rv; |
1457 | } |
1458 | |
1459 | /** |
1460 | * @generated |
1461 | */ |
1462 | private Node createCompartment(View owner, String hint, |
1463 | boolean canCollapse, boolean hasTitle, boolean canSort, |
1464 | boolean canFilter) { |
1465 | //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment(); |
1466 | //rv.setShowTitle(showTitle); |
1467 | //rv.setCollapsed(isCollapsed); |
1468 | Node rv; |
1469 | if (canCollapse) { |
1470 | rv = NotationFactory.eINSTANCE.createBasicCompartment(); |
1471 | } else { |
1472 | rv = NotationFactory.eINSTANCE.createDecorationNode(); |
1473 | } |
1474 | if (hasTitle) { |
1475 | TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle(); |
1476 | ts.setShowTitle(true); |
1477 | rv.getStyles().add(ts); |
1478 | } |
1479 | if (canSort) { |
1480 | rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle()); |
1481 | } |
1482 | if (canFilter) { |
1483 | rv.getStyles() |
1484 | .add(NotationFactory.eINSTANCE.createFilteringStyle()); |
1485 | } |
1486 | rv.setType(hint); |
1487 | ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); |
1488 | return rv; |
1489 | } |
1490 | |
1491 | /** |
1492 | * @generated |
1493 | */ |
1494 | private EObject getSemanticElement(IAdaptable semanticAdapter) { |
1495 | if (semanticAdapter == null) { |
1496 | return null; |
1497 | } |
1498 | EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); |
1499 | if (eObject != null) { |
1500 | return EMFCoreUtil.resolve(TransactionUtil |
1501 | .getEditingDomain(eObject), eObject); |
1502 | } |
1503 | return null; |
1504 | } |
1505 | |
1506 | /** |
1507 | * @generated |
1508 | */ |
1509 | private IElementType getSemanticElementType(IAdaptable semanticAdapter) { |
1510 | if (semanticAdapter == null) { |
1511 | return null; |
1512 | } |
1513 | return (IElementType) semanticAdapter.getAdapter(IElementType.class); |
1514 | } |
1515 | |
1516 | } |