/** * Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis, * Rick Salay. * 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: * Alessio Di Sandro - Implementation. */ package edu.toronto.cs.se.modelepedia.graph_mavo.impl; import edu.toronto.cs.se.mavo.MAVOPackage; import edu.toronto.cs.se.modelepedia.graph_mavo.Edge; import edu.toronto.cs.se.modelepedia.graph_mavo.Graph; import edu.toronto.cs.se.modelepedia.graph_mavo.Graph_MAVOFactory; import edu.toronto.cs.se.modelepedia.graph_mavo.Graph_MAVOPackage; import edu.toronto.cs.se.modelepedia.graph_mavo.NamedElement; import edu.toronto.cs.se.modelepedia.graph_mavo.Node; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; /** * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> * @generated */ public class Graph_MAVOPackageImpl extends EPackageImpl implements Graph_MAVOPackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass graphEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass namedElementEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass nodeEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass edgeEClass = null; /** * Creates an instance of the model <b>Package</b>, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package * package URI value. * <p>Note: the correct way to create the package is via the static * factory method {@link #init init()}, which also performs * initialization of the package, or returns the registered package, * if one already exists. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.eclipse.emf.ecore.EPackage.Registry * @see edu.toronto.cs.se.modelepedia.graph_mavo.Graph_MAVOPackage#eNS_URI * @see #init() * @generated */ private Graph_MAVOPackageImpl() { super(eNS_URI, Graph_MAVOFactory.eINSTANCE); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static boolean isInited = false; /** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * * <p>This method is used to initialize {@link Graph_MAVOPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static Graph_MAVOPackage init() { if (isInited) return (Graph_MAVOPackage)EPackage.Registry.INSTANCE.getEPackage(Graph_MAVOPackage.eNS_URI); // Obtain or create and register package Graph_MAVOPackageImpl theGraph_MAVOPackage = (Graph_MAVOPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Graph_MAVOPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new Graph_MAVOPackageImpl()); isInited = true; // Initialize simple dependencies MAVOPackage.eINSTANCE.eClass(); // Create package meta-data objects theGraph_MAVOPackage.createPackageContents(); // Initialize created meta-data theGraph_MAVOPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theGraph_MAVOPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(Graph_MAVOPackage.eNS_URI, theGraph_MAVOPackage); return theGraph_MAVOPackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getGraph() { return graphEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getGraph_Nodes() { return (EReference)graphEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getGraph_Edges() { return (EReference)graphEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getNamedElement() { return namedElementEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getNamedElement_Name() { return (EAttribute)namedElementEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getNode() { return nodeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getNode_EdgesAsSource() { return (EReference)nodeEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getNode_EdgesAsTarget() { return (EReference)nodeEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getEdge() { return edgeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getEdge_Source() { return (EReference)edgeEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getEdge_Target() { return (EReference)edgeEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Graph_MAVOFactory getGraph_MAVOFactory() { return (Graph_MAVOFactory)getEFactoryInstance(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private boolean isCreated = false; /** * Creates the meta-model objects for the package. This method is * guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void createPackageContents() { if (isCreated) return; isCreated = true; // Create classes and their features graphEClass = createEClass(GRAPH); createEReference(graphEClass, GRAPH__NODES); createEReference(graphEClass, GRAPH__EDGES); namedElementEClass = createEClass(NAMED_ELEMENT); createEAttribute(namedElementEClass, NAMED_ELEMENT__NAME); nodeEClass = createEClass(NODE); createEReference(nodeEClass, NODE__EDGES_AS_SOURCE); createEReference(nodeEClass, NODE__EDGES_AS_TARGET); edgeEClass = createEClass(EDGE); createEReference(edgeEClass, EDGE__SOURCE); createEReference(edgeEClass, EDGE__TARGET); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private boolean isInitialized = false; /** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Obtain other dependent packages MAVOPackage theMAVOPackage = (MAVOPackage)EPackage.Registry.INSTANCE.getEPackage(MAVOPackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes graphEClass.getESuperTypes().add(theMAVOPackage.getMAVORoot()); namedElementEClass.getESuperTypes().add(theMAVOPackage.getMAVOElement()); nodeEClass.getESuperTypes().add(this.getNamedElement()); edgeEClass.getESuperTypes().add(this.getNamedElement()); // Initialize classes, features, and operations; add parameters initEClass(graphEClass, Graph.class, "Graph", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getGraph_Nodes(), this.getNode(), null, "nodes", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getGraph_Edges(), this.getEdge(), null, "edges", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(namedElementEClass, NamedElement.class, "NamedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getNamedElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, NamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getNode_EdgesAsSource(), this.getEdge(), this.getEdge_Source(), "edgesAsSource", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getNode_EdgesAsTarget(), this.getEdge(), this.getEdge_Target(), "edgesAsTarget", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(edgeEClass, Edge.class, "Edge", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getEdge_Source(), this.getNode(), this.getNode_EdgesAsSource(), "source", null, 1, 1, Edge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEdge_Target(), this.getNode(), this.getNode_EdgesAsTarget(), "target", null, 1, 1, Edge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); // Create annotations // gmf.diagram createGmfAnnotations(); // gmf.node createGmf_1Annotations(); // gmf.link createGmf_2Annotations(); } /** * Initializes the annotations for <b>gmf.diagram</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createGmfAnnotations() { String source = "gmf.diagram"; addAnnotation (graphEClass, source, new String[] { }); } /** * Initializes the annotations for <b>gmf.node</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createGmf_1Annotations() { String source = "gmf.node"; addAnnotation (nodeEClass, source, new String[] { "label", "name" }); } /** * Initializes the annotations for <b>gmf.link</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createGmf_2Annotations() { String source = "gmf.link"; addAnnotation (edgeEClass, source, new String[] { "label", "name", "label.icon", "true", "source", "source", "target", "target", "target.decoration", "arrow" }); } } //Graph_MAVOPackageImpl