/***************************************************************************** * Copyright (c) 2010 CEA LIST. * * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation * *****************************************************************************/ package org.eclipse.papyrus.uml.diagram.profile.providers; import java.util.ArrayList; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.EAnnotation; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EcoreFactory; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; import org.eclipse.gmf.runtime.common.core.service.IOperation; import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation; import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.emf.type.core.IHintedType; import org.eclipse.gmf.runtime.notation.Connector; import org.eclipse.gmf.runtime.notation.DecorationNode; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.FillStyle; import org.eclipse.gmf.runtime.notation.FontStyle; import org.eclipse.gmf.runtime.notation.Location; import org.eclipse.gmf.runtime.notation.MeasurementUnit; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.NotationFactory; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.RelativeBendpoints; import org.eclipse.gmf.runtime.notation.Shape; import org.eclipse.gmf.runtime.notation.TitleStyle; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter; import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper; import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AppliedStereotypeElementImportEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationAppliedStereotypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationBranchEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationBranchMultiplicityEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationBranchRoleEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationMultiplicitySourceEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationMultiplicityTargetEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationNodeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationRoleSourceEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationRoleTargetEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ClassOperationEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ClassPropertyEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.CommentAnnotatedElementEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.CommentBodyEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.CommentBodyEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.CommentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.CommentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintBodyEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintBondyEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintConstrainedElementEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ConstraintNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeAttributeCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeAttributeCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeOperationCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeOperationCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypeOperationEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DataTypePropertyEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DependencyAppliedStereotypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DependencyBranchEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DependencyEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DependencyNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DependencyNodeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.DiagramNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ElementImportAliasEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ElementImportEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationEnumerationLiteralCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationEnumerationLiteralCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationLiteralEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ExtensionEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.GeneralizationAppliedStereotypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.GeneralizationEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.MetaclassEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.MetaclassEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.MetaclassNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.MetaclassNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ModelEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ModelEditPartTN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ModelNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ModelNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ModelPackageableElementCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ModelPackageableElementCompartmentEditPartTN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.MultiDependencyLabelEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackageEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackageEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackageImportAppliedStereotypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackageImportEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackageNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackageNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackagePackageableElementCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PackagePackageableElementCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PrimitiveTypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PrimitiveTypeEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PrimitiveTypeNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.PrimitiveTypeNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfileApplicationEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfileDiagramEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfileEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfileEditPartTN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfileNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfileNameEditPartTN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfilePackageableElementCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ProfilePackageableElementCompartmentEditPartTN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.ShortCutDiagramEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeAttributeCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeAttributeCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeNameEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeNameEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeOperationCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.profile.edit.parts.StereotypeOperationCompartmentEditPartCN; import org.eclipse.papyrus.uml.diagram.profile.part.UMLVisualIDRegistry; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.FontData; /** * @generated */ public class UMLViewProvider extends AbstractProvider implements IViewProvider { /** * @generated */ public final boolean provides(IOperation operation) { if(operation instanceof CreateViewForKindOperation) { return provides((CreateViewForKindOperation)operation); } assert operation instanceof CreateViewOperation; if(operation instanceof CreateDiagramViewOperation) { return provides((CreateDiagramViewOperation)operation); } else if(operation instanceof CreateEdgeViewOperation) { return provides((CreateEdgeViewOperation)operation); } else if(operation instanceof CreateNodeViewOperation) { return provides((CreateNodeViewOperation)operation); } return false; } /** * @generated */ protected boolean provides(CreateViewForKindOperation op) { /* if (op.getViewKind() == Node.class) return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; if (op.getViewKind() == Edge.class) return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; */ // check Diagram Type should be the class diagram String modelID = UMLVisualIDRegistry.getModelID(op.getContainerView()); if(!getDiagramProvidedId().equals(modelID)) { return false; } int visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint()); if(Node.class.isAssignableFrom(op.getViewKind())) { return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID); } return true; } /** * Indicates for which diagram this provider works for. * <p> * This method can be overloaded when diagram editor inherits from another one * </p> * * @return the unique identifier of the diagram for which views are provided. */ protected String getDiagramProvidedId() { return ProfileDiagramEditPart.MODEL_ID; } /** * @generated */ protected boolean provides(CreateDiagramViewOperation op) { return ProfileDiagramEditPart.MODEL_ID.equals(op.getSemanticHint()) && UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())) != -1; } /** * @generated */ protected boolean provides(CreateNodeViewOperation op) { if(op.getContainerView() == null) { return false; } IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); EObject domainElement = getSemanticElement(op.getSemanticAdapter()); int visualID; if(op.getSemanticHint() == null) { // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy. // In this situation there should be NO elementType, visualID will be determined // by VisualIDRegistry.getNodeVisualID() for domainElement. if(elementType != null || domainElement == null) { return false; } visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement); } else { visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint()); if(elementType != null) { if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) { return false; // foreign element type } String elementTypeHint = ((IHintedType)elementType).getSemanticHint(); if(!op.getSemanticHint().equals(elementTypeHint)) { return false; // if semantic hint is specified it should be the same as in element type } if(domainElement != null && visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) { return false; // visual id for node EClass should match visual id from element type } } else { if(!ProfileDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) { return false; // foreign diagram } switch(visualID) { case DependencyNodeEditPart.VISUAL_ID: case AssociationNodeEditPart.VISUAL_ID: case StereotypeEditPart.VISUAL_ID: case CommentEditPart.VISUAL_ID: case ConstraintEditPart.VISUAL_ID: case ModelEditPartTN.VISUAL_ID: case ProfileEditPartTN.VISUAL_ID: case PackageEditPart.VISUAL_ID: case EnumerationEditPart.VISUAL_ID: case DataTypeEditPart.VISUAL_ID: case ShortCutDiagramEditPart.VISUAL_ID: case PrimitiveTypeEditPartCN.VISUAL_ID: case DataTypeOperationEditPart.VISUAL_ID: case EnumerationLiteralEditPart.VISUAL_ID: case DataTypePropertyEditPart.VISUAL_ID: case ClassPropertyEditPart.VISUAL_ID: case ClassOperationEditPart.VISUAL_ID: case StereotypeEditPartCN.VISUAL_ID: case MetaclassEditPartCN.VISUAL_ID: case CommentEditPartCN.VISUAL_ID: case PackageEditPartCN.VISUAL_ID: case ConstraintEditPartCN.VISUAL_ID: case MetaclassEditPart.VISUAL_ID: case PrimitiveTypeEditPart.VISUAL_ID: case ModelEditPartCN.VISUAL_ID: case ProfileEditPartCN.VISUAL_ID: case EnumerationEditPartCN.VISUAL_ID: case DataTypeEditPartCN.VISUAL_ID: if(domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) { return false; // visual id in semantic hint should match visual id for domain element } break; default: return false; } } } return DependencyNodeEditPart.VISUAL_ID == visualID || AssociationNodeEditPart.VISUAL_ID == visualID || StereotypeEditPart.VISUAL_ID == visualID || MetaclassEditPart.VISUAL_ID == visualID || CommentEditPart.VISUAL_ID == visualID || ConstraintEditPart.VISUAL_ID == visualID || ModelEditPartTN.VISUAL_ID == visualID || ProfileEditPartTN.VISUAL_ID == visualID || PackageEditPart.VISUAL_ID == visualID || EnumerationEditPart.VISUAL_ID == visualID || PrimitiveTypeEditPart.VISUAL_ID == visualID || DataTypeEditPart.VISUAL_ID == visualID || ShortCutDiagramEditPart.VISUAL_ID == visualID || PrimitiveTypeEditPartCN.VISUAL_ID == visualID || DataTypeOperationEditPart.VISUAL_ID == visualID || EnumerationLiteralEditPart.VISUAL_ID == visualID || DataTypePropertyEditPart.VISUAL_ID == visualID || ClassPropertyEditPart.VISUAL_ID == visualID || ClassOperationEditPart.VISUAL_ID == visualID || StereotypeEditPartCN.VISUAL_ID == visualID || MetaclassEditPartCN.VISUAL_ID == visualID || CommentEditPartCN.VISUAL_ID == visualID || ModelEditPartCN.VISUAL_ID == visualID || ProfileEditPartCN.VISUAL_ID == visualID || PackageEditPartCN.VISUAL_ID == visualID || ConstraintEditPartCN.VISUAL_ID == visualID || EnumerationEditPartCN.VISUAL_ID == visualID || DataTypeEditPartCN.VISUAL_ID == visualID; } /** * @generated */ protected boolean provides(CreateEdgeViewOperation op) { IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) { return false; // foreign element type } String elementTypeHint = ((IHintedType)elementType).getSemanticHint(); if(elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) { return false; // our hint is visual id and must be specified, and it should be the same as in element type } int visualID = UMLVisualIDRegistry.getVisualID(elementTypeHint); EObject domainElement = getSemanticElement(op.getSemanticAdapter()); if(domainElement != null && visualID != UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) { return false; // visual id for link EClass should match visual id from element type } return true; } /** * @generated */ public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) { Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle()); diagram.setType(ProfileDiagramEditPart.MODEL_ID); diagram.setElement(getSemanticElement(semanticAdapter)); diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL); return diagram; } /** * @generated */ public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { final EObject domainElement = getSemanticElement(semanticAdapter); final int visualID; if(semanticHint == null) { visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement); } else { visualID = UMLVisualIDRegistry.getVisualID(semanticHint); } switch(visualID) { case DependencyNodeEditPart.VISUAL_ID: return createDependency_2014(domainElement, containerView, index, persisted, preferencesHint); case AssociationNodeEditPart.VISUAL_ID: return createAssociation_2015(domainElement, containerView, index, persisted, preferencesHint); case StereotypeEditPart.VISUAL_ID: return createStereotype_1026(domainElement, containerView, index, persisted, preferencesHint); case MetaclassEditPart.VISUAL_ID: return createClass_1031(domainElement, containerView, index, persisted, preferencesHint); case CommentEditPart.VISUAL_ID: return createComment_1002(domainElement, containerView, index, persisted, preferencesHint); case ConstraintEditPart.VISUAL_ID: return createConstraint_1014(domainElement, containerView, index, persisted, preferencesHint); case ModelEditPartTN.VISUAL_ID: return createModel_2005(domainElement, containerView, index, persisted, preferencesHint); case ProfileEditPartTN.VISUAL_ID: return createProfile_1030(domainElement, containerView, index, persisted, preferencesHint); case PackageEditPart.VISUAL_ID: return createPackage_2007(domainElement, containerView, index, persisted, preferencesHint); case EnumerationEditPart.VISUAL_ID: return createEnumeration_2006(domainElement, containerView, index, persisted, preferencesHint); case PrimitiveTypeEditPart.VISUAL_ID: return createPrimitiveType_2009(domainElement, containerView, index, persisted, preferencesHint); case DataTypeEditPart.VISUAL_ID: return createDataType_2010(domainElement, containerView, index, persisted, preferencesHint); case ShortCutDiagramEditPart.VISUAL_ID: return createDiagram_2016(domainElement, containerView, index, persisted, preferencesHint); case PrimitiveTypeEditPartCN.VISUAL_ID: return createPrimitiveType_3026(domainElement, containerView, index, persisted, preferencesHint); case DataTypeOperationEditPart.VISUAL_ID: return createOperation_3019(domainElement, containerView, index, persisted, preferencesHint); case EnumerationLiteralEditPart.VISUAL_ID: return createEnumerationLiteral_1037(domainElement, containerView, index, persisted, preferencesHint); case DataTypePropertyEditPart.VISUAL_ID: return createProperty_3018(domainElement, containerView, index, persisted, preferencesHint); case ClassPropertyEditPart.VISUAL_ID: return createProperty_3002(domainElement, containerView, index, persisted, preferencesHint); case ClassOperationEditPart.VISUAL_ID: return createOperation_3020(domainElement, containerView, index, persisted, preferencesHint); case StereotypeEditPartCN.VISUAL_ID: return createStereotype_1023(domainElement, containerView, index, persisted, preferencesHint); case MetaclassEditPartCN.VISUAL_ID: return createClass_3028(domainElement, containerView, index, persisted, preferencesHint); case CommentEditPartCN.VISUAL_ID: return createComment_1007(domainElement, containerView, index, persisted, preferencesHint); case ModelEditPartCN.VISUAL_ID: return createModel_1027(domainElement, containerView, index, persisted, preferencesHint); case ProfileEditPartCN.VISUAL_ID: return createProfile_1024(domainElement, containerView, index, persisted, preferencesHint); case PackageEditPartCN.VISUAL_ID: return createPackage_1012(domainElement, containerView, index, persisted, preferencesHint); case ConstraintEditPartCN.VISUAL_ID: return createConstraint_1028(domainElement, containerView, index, persisted, preferencesHint); case EnumerationEditPartCN.VISUAL_ID: return createEnumeration_3025(domainElement, containerView, index, persisted, preferencesHint); case DataTypeEditPartCN.VISUAL_ID: return createDataType_3027(domainElement, containerView, index, persisted, preferencesHint); } // can't happen, provided #provides(CreateNodeViewOperation) is correct return null; } /** * @generated */ public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { IElementType elementType = getSemanticElementType(semanticAdapter); String elementTypeHint = ((IHintedType)elementType).getSemanticHint(); switch(UMLVisualIDRegistry.getVisualID(elementTypeHint)) { case ExtensionEditPart.VISUAL_ID: return createExtension_1013(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case AssociationEditPart.VISUAL_ID: return createAssociation_4001(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case ProfileApplicationEditPart.VISUAL_ID: return createProfileApplication_1045(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case AssociationBranchEditPart.VISUAL_ID: return createAssociation_4019(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case GeneralizationEditPart.VISUAL_ID: return createGeneralization_4002(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case DependencyEditPart.VISUAL_ID: return createDependency_4008(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case DependencyBranchEditPart.VISUAL_ID: return createDependency_4018(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case ElementImportEditPart.VISUAL_ID: return createElementImport_1064(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case PackageImportEditPart.VISUAL_ID: return createPackageImport_1065(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case CommentAnnotatedElementEditPart.VISUAL_ID: return createCommentAnnotatedElement_1022(containerView, index, persisted, preferencesHint); case ConstraintConstrainedElementEditPart.VISUAL_ID: return createConstraintConstrainedElement_4014(containerView, index, persisted, preferencesHint); } // can never happen, provided #provides(CreateEdgeViewOperation) is correct return null; } /** * @generated */ public Node createDependency_2014(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DependencyNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Dependency"); Node label1 = createLabel(node, UMLVisualIDRegistry.getType(MultiDependencyLabelEditPart.VISUAL_ID)); label1.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location1 = (Location)label1.getLayoutConstraint(); location1.setX(0); location1.setY(5); return node; } /** * @generated */ public Node createAssociation_2015(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(AssociationNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "AssociationNode"); return node; } /** * @generated */ public Node createStereotype_1026(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(StereotypeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Stereotype"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Stereotype"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Stereotype"); Node label1034 = createLabel(node, UMLVisualIDRegistry.getType(StereotypeNameEditPart.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(StereotypeAttributeCompartmentEditPart.VISUAL_ID), true, true, true, true); createCompartment(node, UMLVisualIDRegistry.getType(StereotypeOperationCompartmentEditPart.VISUAL_ID), true, true, true, true); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Stereotype"); return node; } /** * @generated */ public Node createClass_1031(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(MetaclassEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Metaclass"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Metaclass"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Metaclass"); Node label1084 = createLabel(node, UMLVisualIDRegistry.getType(MetaclassNameEditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createComment_1002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Comment"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Comment"); Node label3 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createConstraint_1014(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Constraint"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Constraint"); Node label1015 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID)); Node label5063 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintBodyEditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createModel_2005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ModelEditPartTN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Model"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Model"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Model"); Node label5020 = createLabel(node, UMLVisualIDRegistry.getType(ModelNameEditPart.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(ModelPackageableElementCompartmentEditPartTN.VISUAL_ID), false, true, false, false); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Model"); return node; } /** * @generated */ public Node createProfile_1030(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ProfileEditPartTN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Profile"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Profile"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Profile"); Node label1047 = createLabel(node, UMLVisualIDRegistry.getType(ProfileNameEditPartTN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(ProfilePackageableElementCompartmentEditPartTN.VISUAL_ID), false, true, false, false); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Profile"); return node; } /** * @generated */ public Node createPackage_2007(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(PackageEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Package"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Package"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Package"); Node label5026 = createLabel(node, UMLVisualIDRegistry.getType(PackageNameEditPart.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(PackagePackageableElementCompartmentEditPart.VISUAL_ID), false, true, false, false); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Package"); return node; } /** * @generated */ public Node createEnumeration_2006(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Enumeration"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Enumeration"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Enumeration"); Node label5023 = createLabel(node, UMLVisualIDRegistry.getType(EnumerationNameEditPart.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID), true, true, true, true); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Enumeration"); return node; } /** * @generated */ public Node createPrimitiveType_2009(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "PrimitiveType"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "PrimitiveType"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "PrimitiveType"); Node label5032 = createLabel(node, UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createDataType_2010(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "DataType"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DataType"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "DataType"); Node label5035 = createLabel(node, UMLVisualIDRegistry.getType(DataTypeNameEditPart.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(DataTypeAttributeCompartmentEditPart.VISUAL_ID), true, true, true, true); createCompartment(node, UMLVisualIDRegistry.getType(DataTypeOperationCompartmentEditPart.VISUAL_ID), true, true, true, true); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "DataType"); return node; } /** * @generated */ public Node createDiagram_2016(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ShortCutDiagramEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "ShortCutDiagram"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ShortCutDiagram"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "ShortCutDiagram"); Node label2 = createLabel(node, UMLVisualIDRegistry.getType(DiagramNameEditPart.VISUAL_ID)); label2.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location2 = (Location)label2.getLayoutConstraint(); location2.setX(0); location2.setY(5); return node; } /** * @generated */ public Node createPrimitiveType_3026(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(PrimitiveTypeEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "PrimitiveType"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "PrimitiveType"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "PrimitiveType"); Node label5058 = createLabel(node, UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPartCN.VISUAL_ID)); return node; } /** * @generated */ public Node createOperation_3019(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); node.setType(UMLVisualIDRegistry.getType(DataTypeOperationEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Operation"); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Operation"); return node; } /** * @generated */ public Node createEnumerationLiteral_1037(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); node.setType(UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "EnumerationLiteral"); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "EnumerationLiteral"); return node; } /** * @generated */ public Node createProperty_3018(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); node.setType(UMLVisualIDRegistry.getType(DataTypePropertyEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Property"); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Property"); return node; } /** * @generated */ public Node createProperty_3002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); node.setType(UMLVisualIDRegistry.getType(ClassPropertyEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Property"); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Property"); return node; } /** * @generated */ public Node createOperation_3020(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); node.setType(UMLVisualIDRegistry.getType(ClassOperationEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Operation"); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Operation"); return node; } /** * @generated */ public Node createStereotype_1023(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(StereotypeEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Stereotype"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Stereotype"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Stereotype"); Node label1046 = createLabel(node, UMLVisualIDRegistry.getType(StereotypeNameEditPartCN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(StereotypeAttributeCompartmentEditPartCN.VISUAL_ID), true, true, true, true); createCompartment(node, UMLVisualIDRegistry.getType(StereotypeOperationCompartmentEditPartCN.VISUAL_ID), true, true, true, true); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Stereotype"); return node; } /** * @generated */ public Node createClass_3028(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(MetaclassEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Metaclass"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Metaclass"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Metaclass"); Node label5062 = createLabel(node, UMLVisualIDRegistry.getType(MetaclassNameEditPartCN.VISUAL_ID)); return node; } /** * @generated */ public Node createComment_1007(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CommentEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Comment"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Comment"); Node label1008 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPartCN.VISUAL_ID)); return node; } /** * @generated */ public Node createModel_1027(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ModelEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Model"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Model"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Model"); Node label1056 = createLabel(node, UMLVisualIDRegistry.getType(ModelNameEditPartCN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(ModelPackageableElementCompartmentEditPartCN.VISUAL_ID), false, true, false, false); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Model"); return node; } /** * @generated */ public Node createProfile_1024(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ProfileEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Profile"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Profile"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Profile"); Node label1050 = createLabel(node, UMLVisualIDRegistry.getType(ProfileNameEditPartCN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(ProfilePackageableElementCompartmentEditPartCN.VISUAL_ID), false, true, false, false); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Profile"); return node; } /** * @generated */ public Node createPackage_1012(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(PackageEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Package"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Package"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Package"); Node label1010 = createLabel(node, UMLVisualIDRegistry.getType(PackageNameEditPartCN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(PackagePackageableElementCompartmentEditPartCN.VISUAL_ID), false, true, false, false); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Package"); return node; } /** * @generated */ public Node createConstraint_1028(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ConstraintEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Constraint"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Constraint"); Node label1059 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPartCN.VISUAL_ID)); Node label5064 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintBondyEditPartCN.VISUAL_ID)); return node; } /** * @generated */ public Node createEnumeration_3025(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(EnumerationEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Enumeration"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Enumeration"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Enumeration"); Node label5055 = createLabel(node, UMLVisualIDRegistry.getType(EnumerationNameEditPartCN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID), true, true, true, true); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Enumeration"); return node; } /** * @generated */ public Node createDataType_3027(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DataTypeEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "DataType"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DataType"); PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "DataType"); Node label5061 = createLabel(node, UMLVisualIDRegistry.getType(DataTypeNameEditPartCN.VISUAL_ID)); createCompartment(node, UMLVisualIDRegistry.getType(DataTypeAttributeCompartmentEditPartCN.VISUAL_ID), true, true, true, true); createCompartment(node, UMLVisualIDRegistry.getType(DataTypeOperationCompartmentEditPartCN.VISUAL_ID), true, true, true, true); PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "DataType"); return node; } /** * @generated */ public Edge createExtension_1013(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(ExtensionEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Extension"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Extension"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Extension"); return edge; } /** * @generated */ public Edge createAssociation_4001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Association"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Association"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Association"); Node label6001 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationAppliedStereotypeEditPart.VISUAL_ID)); label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6001 = (Location)label6001.getLayoutConstraint(); location6001.setX(0); location6001.setY(60); Node label6002 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationNameEditPart.VISUAL_ID)); label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6002 = (Location)label6002.getLayoutConstraint(); location6002.setX(0); location6002.setY(20); Node label6003 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationRoleTargetEditPart.VISUAL_ID)); label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6003 = (Location)label6003.getLayoutConstraint(); location6003.setX(0); location6003.setY(20); Node label6005 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationRoleSourceEditPart.VISUAL_ID)); label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6005 = (Location)label6005.getLayoutConstraint(); location6005.setX(0); location6005.setY(-20); Node label6033 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationMultiplicitySourceEditPart.VISUAL_ID)); label6033.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6033 = (Location)label6033.getLayoutConstraint(); location6033.setX(0); location6033.setY(20); Node label6034 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationMultiplicityTargetEditPart.VISUAL_ID)); label6034.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6034 = (Location)label6034.getLayoutConstraint(); location6034.setX(0); location6034.setY(-20); PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Association"); return edge; } /** * @generated */ public Edge createProfileApplication_1045(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(ProfileApplicationEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "ProfileApplication"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ProfileApplication"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "ProfileApplication"); return edge; } /** * @generated */ public Edge createAssociation_4019(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(AssociationBranchEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "AssociationBranch"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "AssociationBranch"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "AssociationBranch"); Node label6024 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationBranchRoleEditPart.VISUAL_ID)); label6024.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6024 = (Location)label6024.getLayoutConstraint(); location6024.setX(0); location6024.setY(-20); Node label6035 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationBranchMultiplicityEditPart.VISUAL_ID)); label6035.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6035 = (Location)label6035.getLayoutConstraint(); location6035.setX(0); location6035.setY(20); return edge; } /** * @generated */ public Edge createGeneralization_4002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Generalization"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Generalization"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Generalization"); Node label6007 = createLabel(edge, UMLVisualIDRegistry.getType(GeneralizationAppliedStereotypeEditPart.VISUAL_ID)); label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6007 = (Location)label6007.getLayoutConstraint(); location6007.setX(0); location6007.setY(60); PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Generalization"); return edge; } /** * @generated */ public Edge createDependency_4008(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Dependency"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Dependency"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Dependency"); Node label6026 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID)); label6026.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6026 = (Location)label6026.getLayoutConstraint(); location6026.setX(0); location6026.setY(40); Node label6027 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyAppliedStereotypeEditPart.VISUAL_ID)); label6027.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6027 = (Location)label6027.getLayoutConstraint(); location6027.setX(0); location6027.setY(60); PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Dependency"); return edge; } /** * @generated */ public Edge createDependency_4018(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(DependencyBranchEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Dependency"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Dependency"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Dependency"); return edge; } /** * @generated */ public Edge createElementImport_1064(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(ElementImportEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "ElementImport"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ElementImport"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "ElementImport"); Node label6020 = createLabel(edge, UMLVisualIDRegistry.getType(ElementImportAliasEditPart.VISUAL_ID)); label6020.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6020 = (Location)label6020.getLayoutConstraint(); location6020.setX(0); location6020.setY(40); Node label6021 = createLabel(edge, UMLVisualIDRegistry.getType(AppliedStereotypeElementImportEditPart.VISUAL_ID)); label6021.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6021 = (Location)label6021.getLayoutConstraint(); location6021.setX(0); location6021.setY(60); PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "ElementImport"); return edge; } /** * @generated */ public Edge createPackageImport_1065(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(PackageImportEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "PackageImport"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "PackageImport"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "PackageImport"); Node label6022 = createLabel(edge, UMLVisualIDRegistry.getType(PackageImportAppliedStereotypeEditPart.VISUAL_ID)); label6022.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6022 = (Location)label6022.getLayoutConstraint(); location6022.setX(0); location6022.setY(60); PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "PackageImport"); return edge; } /** * @generated */ public Edge createCommentAnnotatedElement_1022(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.VISUAL_ID)); edge.setElement(null); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined"); return edge; } /** * @generated */ public Edge createConstraintConstrainedElement_4014(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Connector edge = NotationFactory.eINSTANCE.createConnector(); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID)); edge.setElement(null); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore(); PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined"); PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined"); //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE)); //if (routing != null) { // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); //} PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined"); return edge; } /** * @generated */ protected void stampShortcut(View containerView, Node target) { if(!ProfileDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileDiagramEditPart.MODEL_ID); //$NON-NLS-1$ target.getEAnnotations().add(shortcutAnnotation); } } /** * @generated */ protected Node createLabel(View owner, String hint) { DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode(); rv.setType(hint); ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); return rv; } /** * @generated */ protected Node createCompartment(View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) { //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment(); //rv.setShowTitle(showTitle); //rv.setCollapsed(isCollapsed); Node rv; if(canCollapse) { rv = NotationFactory.eINSTANCE.createBasicCompartment(); } else { rv = NotationFactory.eINSTANCE.createDecorationNode(); } rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); if(hasTitle) { TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle(); ts.setShowTitle(true); rv.getStyles().add(ts); } if(canSort) { rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle()); } if(canFilter) { rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle()); } rv.setType(hint); ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); return rv; } /** * @generated */ protected EObject getSemanticElement(IAdaptable semanticAdapter) { if(semanticAdapter == null) { return null; } EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class); if(eObject != null) { return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject); } return null; } /** * @generated */ protected IElementType getSemanticElementType(IAdaptable semanticAdapter) { if(semanticAdapter == null) { return null; } return (IElementType)semanticAdapter.getAdapter(IElementType.class); } /** * @generated */ private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) { String fontConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.FONT); String fontColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FONT); FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE); if(viewFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(store, fontConstant); viewFontStyle.setFontName(fontData.getName()); viewFontStyle.setFontHeight(fontData.getHeight()); viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant); viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } } /** * @generated */ private void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) { String lineColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant); ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); } /** * @generated */ private void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) { String fillColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL); String gradientColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT); String gradientPolicyConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY); org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant); ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE); fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue()); ; if(store.getBoolean(gradientPolicyConstant)) { GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant)); fillStyle.setGradient(gradientPreferenceConverter.getGradientData()); fillStyle.setTransparency(gradientPreferenceConverter.getTransparency()); } } }