001: package newprocess.diagram.providers;
002:
003: import org.eclipse.core.runtime.IAdaptable;
004: import org.eclipse.emf.ecore.EClass;
005: import org.eclipse.emf.ecore.EObject;
006: import org.eclipse.gmf.runtime.diagram.core.providers.AbstractViewProvider;
007: import org.eclipse.gmf.runtime.notation.View;
008: import org.eclipse.gmf.runtime.emf.type.core.IElementType;
009: import newprocess.diagram.edit.parts.ActorEditPart;
010: import newprocess.diagram.edit.parts.ActorNameEditPart;
011: import newprocess.diagram.edit.parts.AndOperatorEditPart;
012: import newprocess.diagram.edit.parts.AsyncActivity2EditPart;
013: import newprocess.diagram.edit.parts.AsyncActivityAsyncActivityPostconditionCompartment2EditPart;
014: import newprocess.diagram.edit.parts.AsyncActivityAsyncActivityPostconditionCompartmentEditPart;
015: import newprocess.diagram.edit.parts.AsyncActivityAsyncActivityPreconditionCompartment2EditPart;
016: import newprocess.diagram.edit.parts.AsyncActivityAsyncActivityPreconditionCompartmentEditPart;
017: import newprocess.diagram.edit.parts.AsyncActivityEditPart;
018: import newprocess.diagram.edit.parts.AsyncActivityName2EditPart;
019: import newprocess.diagram.edit.parts.AsyncActivityNameEditPart;
020: import newprocess.diagram.edit.parts.ConclusionConclusionPostconditionCompartmentEditPart;
021: import newprocess.diagram.edit.parts.ConclusionEditPart;
022: import newprocess.diagram.edit.parts.ConclusionNameEditPart;
023: import newprocess.diagram.edit.parts.ConditionEditPart;
024: import newprocess.diagram.edit.parts.ConditionNameEditPart;
025: import newprocess.diagram.edit.parts.ConditionProxyEditPart;
026: import newprocess.diagram.edit.parts.ConditionProxyProxyNameEditPart;
027: import newprocess.diagram.edit.parts.ConditionTermEditPart;
028: import newprocess.diagram.edit.parts.EventEditPart;
029: import newprocess.diagram.edit.parts.EventEventPostconditionCompartmentEditPart;
030: import newprocess.diagram.edit.parts.EventNameEditPart;
031: import newprocess.diagram.edit.parts.ExpansionEditPart;
032: import newprocess.diagram.edit.parts.ExpansionExpansionPostconditionCompartmentEditPart;
033: import newprocess.diagram.edit.parts.ExpansionNameEditPart;
034: import newprocess.diagram.edit.parts.Expression2EditPart;
035: import newprocess.diagram.edit.parts.Expression3EditPart;
036: import newprocess.diagram.edit.parts.Expression4EditPart;
037: import newprocess.diagram.edit.parts.Expression5EditPart;
038: import newprocess.diagram.edit.parts.Expression6EditPart;
039: import newprocess.diagram.edit.parts.Expression7EditPart;
040: import newprocess.diagram.edit.parts.Expression8EditPart;
041: import newprocess.diagram.edit.parts.ExpressionEditPart;
042: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment2EditPart;
043: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment3EditPart;
044: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment4EditPart;
045: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment5EditPart;
046: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment6EditPart;
047: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment7EditPart;
048: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment8EditPart;
049: import newprocess.diagram.edit.parts.ExpressionExpressionCompartmentEditPart;
050: import newprocess.diagram.edit.parts.GlobalsEditPart;
051: import newprocess.diagram.edit.parts.GlobalsGlobalsConditionCompartmentEditPart;
052: import newprocess.diagram.edit.parts.GlobalsGlobalsLoaderCompartmentEditPart;
053: import newprocess.diagram.edit.parts.ListenerEditPart;
054: import newprocess.diagram.edit.parts.ListenerListenerPreconditionCompartmentEditPart;
055: import newprocess.diagram.edit.parts.ListenerNameEditPart;
056: import newprocess.diagram.edit.parts.LoaderEditPart;
057: import newprocess.diagram.edit.parts.LoaderNameEditPart;
058: import newprocess.diagram.edit.parts.MessageEditPart;
059: import newprocess.diagram.edit.parts.MessageNameEditPart;
060: import newprocess.diagram.edit.parts.OrOperatorEditPart;
061: import newprocess.diagram.edit.parts.ProcessEditPart;
062: import newprocess.diagram.edit.parts.RootEditPart;
063: import newprocess.diagram.edit.parts.SyncActivityEditPart;
064: import newprocess.diagram.edit.parts.SyncActivityNameEditPart;
065: import newprocess.diagram.edit.parts.SyncActivitySynActivityPostconditionCompartmentEditPart;
066: import newprocess.diagram.edit.parts.SyncActivitySynActivityPreconditionCompartmentEditPart;
067:
068: import newprocess.diagram.part.New_processVisualIDRegistry;
069:
070: import newprocess.diagram.view.factories.ActorNameViewFactory;
071: import newprocess.diagram.view.factories.ActorViewFactory;
072: import newprocess.diagram.view.factories.AndOperatorViewFactory;
073: import newprocess.diagram.view.factories.AsyncActivity2ViewFactory;
074: import newprocess.diagram.view.factories.AsyncActivityActorViewFactory;
075: import newprocess.diagram.view.factories.AsyncActivityAsyncActivityPostconditionCompartment2ViewFactory;
076: import newprocess.diagram.view.factories.AsyncActivityAsyncActivityPostconditionCompartmentViewFactory;
077: import newprocess.diagram.view.factories.AsyncActivityAsyncActivityPreconditionCompartment2ViewFactory;
078: import newprocess.diagram.view.factories.AsyncActivityAsyncActivityPreconditionCompartmentViewFactory;
079: import newprocess.diagram.view.factories.AsyncActivityName2ViewFactory;
080: import newprocess.diagram.view.factories.AsyncActivityNameViewFactory;
081: import newprocess.diagram.view.factories.AsyncActivityViewFactory;
082: import newprocess.diagram.view.factories.ConclusionConclusionPostconditionCompartmentViewFactory;
083: import newprocess.diagram.view.factories.ConclusionConclusionProxyViewFactory;
084: import newprocess.diagram.view.factories.ConclusionNameViewFactory;
085: import newprocess.diagram.view.factories.ConclusionViewFactory;
086: import newprocess.diagram.view.factories.ConditionNameViewFactory;
087: import newprocess.diagram.view.factories.ConditionProxyProxyNameViewFactory;
088: import newprocess.diagram.view.factories.ConditionProxyViewFactory;
089: import newprocess.diagram.view.factories.ConditionTermConditionProxyViewFactory;
090: import newprocess.diagram.view.factories.ConditionTermViewFactory;
091: import newprocess.diagram.view.factories.ConditionViewFactory;
092: import newprocess.diagram.view.factories.EventEventPostconditionCompartmentViewFactory;
093: import newprocess.diagram.view.factories.EventNameViewFactory;
094: import newprocess.diagram.view.factories.EventViewFactory;
095: import newprocess.diagram.view.factories.ExpansionExpansionPostconditionCompartmentViewFactory;
096: import newprocess.diagram.view.factories.ExpansionExpansionProxyViewFactory;
097: import newprocess.diagram.view.factories.ExpansionNameViewFactory;
098: import newprocess.diagram.view.factories.ExpansionViewFactory;
099: import newprocess.diagram.view.factories.Expression2ViewFactory;
100: import newprocess.diagram.view.factories.Expression3ViewFactory;
101: import newprocess.diagram.view.factories.Expression4ViewFactory;
102: import newprocess.diagram.view.factories.Expression5ViewFactory;
103: import newprocess.diagram.view.factories.Expression6ViewFactory;
104: import newprocess.diagram.view.factories.Expression7ViewFactory;
105: import newprocess.diagram.view.factories.Expression8ViewFactory;
106: import newprocess.diagram.view.factories.ExpressionExpressionCompartment2ViewFactory;
107: import newprocess.diagram.view.factories.ExpressionExpressionCompartment3ViewFactory;
108: import newprocess.diagram.view.factories.ExpressionExpressionCompartment4ViewFactory;
109: import newprocess.diagram.view.factories.ExpressionExpressionCompartment5ViewFactory;
110: import newprocess.diagram.view.factories.ExpressionExpressionCompartment6ViewFactory;
111: import newprocess.diagram.view.factories.ExpressionExpressionCompartment7ViewFactory;
112: import newprocess.diagram.view.factories.ExpressionExpressionCompartment8ViewFactory;
113: import newprocess.diagram.view.factories.ExpressionExpressionCompartmentViewFactory;
114: import newprocess.diagram.view.factories.ExpressionViewFactory;
115: import newprocess.diagram.view.factories.GlobalsGlobalsConditionCompartmentViewFactory;
116: import newprocess.diagram.view.factories.GlobalsGlobalsLoaderCompartmentViewFactory;
117: import newprocess.diagram.view.factories.GlobalsViewFactory;
118: import newprocess.diagram.view.factories.ListenerListenerPreconditionCompartmentViewFactory;
119: import newprocess.diagram.view.factories.ListenerNameViewFactory;
120: import newprocess.diagram.view.factories.ListenerViewFactory;
121: import newprocess.diagram.view.factories.LoaderNameViewFactory;
122: import newprocess.diagram.view.factories.LoaderViewFactory;
123: import newprocess.diagram.view.factories.MessageNameViewFactory;
124: import newprocess.diagram.view.factories.MessageViewFactory;
125: import newprocess.diagram.view.factories.OperatorTermSubTermViewFactory;
126: import newprocess.diagram.view.factories.OrOperatorViewFactory;
127: import newprocess.diagram.view.factories.ProcessViewFactory;
128: import newprocess.diagram.view.factories.RootTermViewFactory;
129: import newprocess.diagram.view.factories.RootViewFactory;
130: import newprocess.diagram.view.factories.SyncActivityNameViewFactory;
131: import newprocess.diagram.view.factories.SyncActivitySynActivityPostconditionCompartmentViewFactory;
132: import newprocess.diagram.view.factories.SyncActivitySynActivityPreconditionCompartmentViewFactory;
133: import newprocess.diagram.view.factories.SyncActivityViewFactory;
134:
135: /**
136: * @generated
137: */
138: public class New_processViewProvider extends AbstractViewProvider {
139:
140: /**
141: * @generated
142: */
143: protected Class getDiagramViewClass(IAdaptable semanticAdapter,
144: String diagramKind) {
145: EObject semanticElement = getSemanticElement(semanticAdapter);
146: if (ProcessEditPart.MODEL_ID.equals(diagramKind)
147: && New_processVisualIDRegistry
148: .getDiagramVisualID(semanticElement) != -1) {
149: return ProcessViewFactory.class;
150: }
151: return null;
152: }
153:
154: /**
155: * @generated
156: */
157: protected Class getNodeViewClass(IAdaptable semanticAdapter,
158: View containerView, String semanticHint) {
159: if (containerView == null) {
160: return null;
161: }
162: IElementType elementType = getSemanticElementType(semanticAdapter);
163: if (elementType != null
164: && !New_processElementTypes
165: .isKnownElementType(elementType)) {
166: return null;
167: }
168: EClass semanticType = getSemanticEClass(semanticAdapter);
169: EObject semanticElement = getSemanticElement(semanticAdapter);
170: int nodeVID = New_processVisualIDRegistry.getNodeVisualID(
171: containerView, semanticElement, semanticType,
172: semanticHint);
173: switch (nodeVID) {
174: case SyncActivityEditPart.VISUAL_ID:
175: return SyncActivityViewFactory.class;
176: case SyncActivityNameEditPart.VISUAL_ID:
177: return SyncActivityNameViewFactory.class;
178: case ListenerEditPart.VISUAL_ID:
179: return ListenerViewFactory.class;
180: case ListenerNameEditPart.VISUAL_ID:
181: return ListenerNameViewFactory.class;
182: case AsyncActivityEditPart.VISUAL_ID:
183: return AsyncActivityViewFactory.class;
184: case AsyncActivityNameEditPart.VISUAL_ID:
185: return AsyncActivityNameViewFactory.class;
186: case EventEditPart.VISUAL_ID:
187: return EventViewFactory.class;
188: case EventNameEditPart.VISUAL_ID:
189: return EventNameViewFactory.class;
190: case ConditionProxyEditPart.VISUAL_ID:
191: return ConditionProxyViewFactory.class;
192: case ConditionProxyProxyNameEditPart.VISUAL_ID:
193: return ConditionProxyProxyNameViewFactory.class;
194: case ActorEditPart.VISUAL_ID:
195: return ActorViewFactory.class;
196: case ActorNameEditPart.VISUAL_ID:
197: return ActorNameViewFactory.class;
198: case MessageEditPart.VISUAL_ID:
199: return MessageViewFactory.class;
200: case MessageNameEditPart.VISUAL_ID:
201: return MessageNameViewFactory.class;
202: case ExpansionEditPart.VISUAL_ID:
203: return ExpansionViewFactory.class;
204: case ExpansionNameEditPart.VISUAL_ID:
205: return ExpansionNameViewFactory.class;
206: case ConclusionEditPart.VISUAL_ID:
207: return ConclusionViewFactory.class;
208: case ConclusionNameEditPart.VISUAL_ID:
209: return ConclusionNameViewFactory.class;
210: case GlobalsEditPart.VISUAL_ID:
211: return GlobalsViewFactory.class;
212: case ExpressionEditPart.VISUAL_ID:
213: return ExpressionViewFactory.class;
214: case RootEditPart.VISUAL_ID:
215: return RootViewFactory.class;
216: case OrOperatorEditPart.VISUAL_ID:
217: return OrOperatorViewFactory.class;
218: case AndOperatorEditPart.VISUAL_ID:
219: return AndOperatorViewFactory.class;
220: case ConditionTermEditPart.VISUAL_ID:
221: return ConditionTermViewFactory.class;
222: case Expression2EditPart.VISUAL_ID:
223: return Expression2ViewFactory.class;
224: case Expression3EditPart.VISUAL_ID:
225: return Expression3ViewFactory.class;
226: case Expression4EditPart.VISUAL_ID:
227: return Expression4ViewFactory.class;
228: case Expression5EditPart.VISUAL_ID:
229: return Expression5ViewFactory.class;
230: case Expression6EditPart.VISUAL_ID:
231: return Expression6ViewFactory.class;
232: case Expression7EditPart.VISUAL_ID:
233: return Expression7ViewFactory.class;
234: case Expression8EditPart.VISUAL_ID:
235: return Expression8ViewFactory.class;
236: case LoaderEditPart.VISUAL_ID:
237: return LoaderViewFactory.class;
238: case LoaderNameEditPart.VISUAL_ID:
239: return LoaderNameViewFactory.class;
240: case ConditionEditPart.VISUAL_ID:
241: return ConditionViewFactory.class;
242: case ConditionNameEditPart.VISUAL_ID:
243: return ConditionNameViewFactory.class;
244: case SyncActivitySynActivityPreconditionCompartmentEditPart.VISUAL_ID:
245: return SyncActivitySynActivityPreconditionCompartmentViewFactory.class;
246: case SyncActivitySynActivityPostconditionCompartmentEditPart.VISUAL_ID:
247: return SyncActivitySynActivityPostconditionCompartmentViewFactory.class;
248: case ExpressionExpressionCompartmentEditPart.VISUAL_ID:
249: return ExpressionExpressionCompartmentViewFactory.class;
250: case ExpressionExpressionCompartment2EditPart.VISUAL_ID:
251: return ExpressionExpressionCompartment2ViewFactory.class;
252: case ListenerListenerPreconditionCompartmentEditPart.VISUAL_ID:
253: return ListenerListenerPreconditionCompartmentViewFactory.class;
254: case ExpressionExpressionCompartment3EditPart.VISUAL_ID:
255: return ExpressionExpressionCompartment3ViewFactory.class;
256: case AsyncActivityAsyncActivityPreconditionCompartmentEditPart.VISUAL_ID:
257: return AsyncActivityAsyncActivityPreconditionCompartmentViewFactory.class;
258: case AsyncActivityAsyncActivityPostconditionCompartmentEditPart.VISUAL_ID:
259: return AsyncActivityAsyncActivityPostconditionCompartmentViewFactory.class;
260: case ExpressionExpressionCompartment4EditPart.VISUAL_ID:
261: return ExpressionExpressionCompartment4ViewFactory.class;
262: case ExpressionExpressionCompartment5EditPart.VISUAL_ID:
263: return ExpressionExpressionCompartment5ViewFactory.class;
264: case EventEventPostconditionCompartmentEditPart.VISUAL_ID:
265: return EventEventPostconditionCompartmentViewFactory.class;
266: case ExpressionExpressionCompartment6EditPart.VISUAL_ID:
267: return ExpressionExpressionCompartment6ViewFactory.class;
268: case ExpansionExpansionPostconditionCompartmentEditPart.VISUAL_ID:
269: return ExpansionExpansionPostconditionCompartmentViewFactory.class;
270: case ExpressionExpressionCompartment7EditPart.VISUAL_ID:
271: return ExpressionExpressionCompartment7ViewFactory.class;
272: case ConclusionConclusionPostconditionCompartmentEditPart.VISUAL_ID:
273: return ConclusionConclusionPostconditionCompartmentViewFactory.class;
274: case ExpressionExpressionCompartment8EditPart.VISUAL_ID:
275: return ExpressionExpressionCompartment8ViewFactory.class;
276: case GlobalsGlobalsLoaderCompartmentEditPart.VISUAL_ID:
277: return GlobalsGlobalsLoaderCompartmentViewFactory.class;
278: case GlobalsGlobalsConditionCompartmentEditPart.VISUAL_ID:
279: return GlobalsGlobalsConditionCompartmentViewFactory.class;
280: }
281: return null;
282: }
283:
284: /**
285: * @generated
286: */
287: protected Class getEdgeViewClass(IAdaptable semanticAdapter,
288: View containerView, String semanticHint) {
289: IElementType elementType = getSemanticElementType(semanticAdapter);
290: if (elementType != null
291: && !New_processElementTypes
292: .isKnownElementType(elementType)) {
293: return null;
294: }
295: if (New_processElementTypes.AsyncActivityActor_4001
296: .equals(elementType)) {
297: return AsyncActivityActorViewFactory.class;
298: }
299: if (New_processElementTypes.RootTerm_4002.equals(elementType)) {
300: return RootTermViewFactory.class;
301: }
302: if (New_processElementTypes.OperatorTermSubTerm_4003
303: .equals(elementType)) {
304: return OperatorTermSubTermViewFactory.class;
305: }
306: if (New_processElementTypes.ConditionTermConditionProxy_4004
307: .equals(elementType)) {
308: return ConditionTermConditionProxyViewFactory.class;
309: }
310: if (New_processElementTypes.ConclusionConclusionProxy_4005
311: .equals(elementType)) {
312: return ConclusionConclusionProxyViewFactory.class;
313: }
314: if (New_processElementTypes.ExpansionExpansionProxy_4006
315: .equals(elementType)) {
316: return ExpansionExpansionProxyViewFactory.class;
317: }
318: EClass semanticType = getSemanticEClass(semanticAdapter);
319: if (semanticType == null) {
320: return null;
321: }
322: EObject semanticElement = getSemanticElement(semanticAdapter);
323: int linkVID = New_processVisualIDRegistry
324: .getLinkWithClassVisualID(semanticElement, semanticType);
325: switch (linkVID) {
326: }
327: return getUnrecognizedConnectorViewClass(semanticAdapter,
328: containerView, semanticHint);
329: }
330:
331: /**
332: * @generated
333: */
334: private IElementType getSemanticElementType(
335: IAdaptable semanticAdapter) {
336: if (semanticAdapter == null) {
337: return null;
338: }
339: return (IElementType) semanticAdapter
340: .getAdapter(IElementType.class);
341: }
342:
343: /**
344: * @generated
345: */
346: private Class getUnrecognizedConnectorViewClass(
347: IAdaptable semanticAdapter, View containerView,
348: String semanticHint) {
349: // Handle unrecognized child node classes here
350: return null;
351: }
352:
353: }
|