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.RootEditPart;
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.AbstractShapeViewFactory;
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 RootViewFactory extends AbstractShapeViewFactory {
25:
26: /**
27: * @generated
28: */
29: protected List createStyles(View view) {
30: List styles = new ArrayList();
31: styles.add(NotationFactory.eINSTANCE.createFontStyle());
32: styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
33: styles.add(NotationFactory.eINSTANCE.createFillStyle());
34: styles.add(NotationFactory.eINSTANCE.createLineStyle());
35: return styles;
36: }
37:
38: /**
39: * @generated
40: */
41: protected void decorateView(View containerView, View view,
42: IAdaptable semanticAdapter, String semanticHint, int index,
43: boolean persisted) {
44: if (semanticHint == null) {
45: semanticHint = New_processVisualIDRegistry
46: .getType(RootEditPart.VISUAL_ID);
47: view.setType(semanticHint);
48: }
49: super .decorateView(containerView, view, semanticAdapter,
50: semanticHint, index, persisted);
51: if (!ProcessEditPart.MODEL_ID
52: .equals(New_processVisualIDRegistry
53: .getModelID(containerView))) {
54: EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE
55: .createEAnnotation();
56: shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
57: shortcutAnnotation.getDetails().put(
58: "modelID", ProcessEditPart.MODEL_ID); //$NON-NLS-1$
59: view.getEAnnotations().add(shortcutAnnotation);
60: }
61: }
62:
63: }
|