01: package newprocess.diagram.view.factories;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import newprocess.diagram.edit.parts.AsyncActivityAsyncActivityPostconditionCompartmentEditPart;
07: import newprocess.diagram.edit.parts.AsyncActivityAsyncActivityPreconditionCompartmentEditPart;
08: import newprocess.diagram.edit.parts.AsyncActivityEditPart;
09: import newprocess.diagram.edit.parts.AsyncActivityNameEditPart;
10: import newprocess.diagram.edit.parts.ProcessEditPart;
11:
12: import newprocess.diagram.part.New_processVisualIDRegistry;
13:
14: import org.eclipse.core.runtime.IAdaptable;
15:
16: import org.eclipse.emf.ecore.EAnnotation;
17: import org.eclipse.emf.ecore.EcoreFactory;
18:
19: import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
20:
21: import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
22:
23: import org.eclipse.gmf.runtime.notation.NotationFactory;
24: import org.eclipse.gmf.runtime.notation.View;
25:
26: /**
27: * @generated
28: */
29: public class AsyncActivityViewFactory extends AbstractShapeViewFactory {
30:
31: /**
32: * @generated
33: */
34: protected List createStyles(View view) {
35: List styles = new ArrayList();
36: styles.add(NotationFactory.eINSTANCE.createFontStyle());
37: styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
38: styles.add(NotationFactory.eINSTANCE.createFillStyle());
39: styles.add(NotationFactory.eINSTANCE.createLineStyle());
40: return styles;
41: }
42:
43: /**
44: * @generated
45: */
46: protected void decorateView(View containerView, View view,
47: IAdaptable semanticAdapter, String semanticHint, int index,
48: boolean persisted) {
49: if (semanticHint == null) {
50: semanticHint = New_processVisualIDRegistry
51: .getType(AsyncActivityEditPart.VISUAL_ID);
52: view.setType(semanticHint);
53: }
54: super .decorateView(containerView, view, semanticAdapter,
55: semanticHint, index, persisted);
56: if (!ProcessEditPart.MODEL_ID
57: .equals(New_processVisualIDRegistry
58: .getModelID(containerView))) {
59: EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE
60: .createEAnnotation();
61: shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
62: shortcutAnnotation.getDetails().put(
63: "modelID", ProcessEditPart.MODEL_ID); //$NON-NLS-1$
64: view.getEAnnotations().add(shortcutAnnotation);
65: }
66: getViewService().createNode(
67: semanticAdapter,
68: view,
69: New_processVisualIDRegistry
70: .getType(AsyncActivityNameEditPart.VISUAL_ID),
71: ViewUtil.APPEND, true, getPreferencesHint());
72: getViewService()
73: .createNode(
74: semanticAdapter,
75: view,
76: New_processVisualIDRegistry
77: .getType(AsyncActivityAsyncActivityPreconditionCompartmentEditPart.VISUAL_ID),
78: ViewUtil.APPEND, true, getPreferencesHint());
79: getViewService()
80: .createNode(
81: semanticAdapter,
82: view,
83: New_processVisualIDRegistry
84: .getType(AsyncActivityAsyncActivityPostconditionCompartmentEditPart.VISUAL_ID),
85: ViewUtil.APPEND, true, getPreferencesHint());
86: }
87:
88: }
|