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