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