/** * 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.statemachine_mavo.impl; import edu.toronto.cs.se.mavo.MAVOPackage; import edu.toronto.cs.se.modelepedia.statemachine_mavo.AbstractState; import edu.toronto.cs.se.modelepedia.statemachine_mavo.FinalState; import edu.toronto.cs.se.modelepedia.statemachine_mavo.FiringElement; import edu.toronto.cs.se.modelepedia.statemachine_mavo.InitialState; import edu.toronto.cs.se.modelepedia.statemachine_mavo.State; import edu.toronto.cs.se.modelepedia.statemachine_mavo.StateAction; import edu.toronto.cs.se.modelepedia.statemachine_mavo.StateMachine; import edu.toronto.cs.se.modelepedia.statemachine_mavo.StateMachine_MAVOFactory; import edu.toronto.cs.se.modelepedia.statemachine_mavo.StateMachine_MAVOPackage; import edu.toronto.cs.se.modelepedia.statemachine_mavo.Transition; 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 StateMachine_MAVOPackageImpl extends EPackageImpl implements StateMachine_MAVOPackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass stateMachineEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass firingElementEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass abstractStateEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass stateEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass initialStateEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass finalStateEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass transitionEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass stateActionEClass = 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.statemachine_mavo.StateMachine_MAVOPackage#eNS_URI * @see #init() * @generated */ private StateMachine_MAVOPackageImpl() { super(eNS_URI, StateMachine_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 StateMachine_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 StateMachine_MAVOPackage init() { if (isInited) return (StateMachine_MAVOPackage)EPackage.Registry.INSTANCE.getEPackage(StateMachine_MAVOPackage.eNS_URI); // Obtain or create and register package StateMachine_MAVOPackageImpl theStateMachine_MAVOPackage = (StateMachine_MAVOPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof StateMachine_MAVOPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new StateMachine_MAVOPackageImpl()); isInited = true; // Initialize simple dependencies MAVOPackage.eINSTANCE.eClass(); // Create package meta-data objects theStateMachine_MAVOPackage.createPackageContents(); // Initialize created meta-data theStateMachine_MAVOPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theStateMachine_MAVOPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(StateMachine_MAVOPackage.eNS_URI, theStateMachine_MAVOPackage); return theStateMachine_MAVOPackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getStateMachine() { return stateMachineEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getStateMachine_States() { return (EReference)stateMachineEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getStateMachine_Transitions() { return (EReference)stateMachineEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getFiringElement() { return firingElementEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getFiringElement_Trigger() { return (EAttribute)firingElementEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getFiringElement_Action() { return (EAttribute)firingElementEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getAbstractState() { return abstractStateEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getAbstractState_Name() { return (EAttribute)abstractStateEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getAbstractState_TransitionsAsSource() { return (EReference)abstractStateEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getAbstractState_TransitionsAsTarget() { return (EReference)abstractStateEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getState() { return stateEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getState_InternalActions() { return (EReference)stateEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getInitialState() { return initialStateEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getFinalState() { return finalStateEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getTransition() { return transitionEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getTransition_Source() { return (EReference)transitionEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getTransition_Target() { return (EReference)transitionEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getStateAction() { return stateActionEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public StateMachine_MAVOFactory getStateMachine_MAVOFactory() { return (StateMachine_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 stateMachineEClass = createEClass(STATE_MACHINE); createEReference(stateMachineEClass, STATE_MACHINE__STATES); createEReference(stateMachineEClass, STATE_MACHINE__TRANSITIONS); firingElementEClass = createEClass(FIRING_ELEMENT); createEAttribute(firingElementEClass, FIRING_ELEMENT__TRIGGER); createEAttribute(firingElementEClass, FIRING_ELEMENT__ACTION); abstractStateEClass = createEClass(ABSTRACT_STATE); createEAttribute(abstractStateEClass, ABSTRACT_STATE__NAME); createEReference(abstractStateEClass, ABSTRACT_STATE__TRANSITIONS_AS_SOURCE); createEReference(abstractStateEClass, ABSTRACT_STATE__TRANSITIONS_AS_TARGET); stateEClass = createEClass(STATE); createEReference(stateEClass, STATE__INTERNAL_ACTIONS); initialStateEClass = createEClass(INITIAL_STATE); finalStateEClass = createEClass(FINAL_STATE); transitionEClass = createEClass(TRANSITION); createEReference(transitionEClass, TRANSITION__SOURCE); createEReference(transitionEClass, TRANSITION__TARGET); stateActionEClass = createEClass(STATE_ACTION); } /** * <!-- 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 stateMachineEClass.getESuperTypes().add(theMAVOPackage.getMAVORoot()); firingElementEClass.getESuperTypes().add(theMAVOPackage.getMAVOElement()); stateEClass.getESuperTypes().add(theMAVOPackage.getMAVOElement()); stateEClass.getESuperTypes().add(this.getAbstractState()); initialStateEClass.getESuperTypes().add(this.getAbstractState()); finalStateEClass.getESuperTypes().add(this.getAbstractState()); transitionEClass.getESuperTypes().add(this.getFiringElement()); stateActionEClass.getESuperTypes().add(this.getFiringElement()); // Initialize classes, features, and operations; add parameters initEClass(stateMachineEClass, StateMachine.class, "StateMachine", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getStateMachine_States(), this.getAbstractState(), null, "states", null, 0, -1, StateMachine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getStateMachine_Transitions(), this.getTransition(), null, "transitions", null, 0, -1, StateMachine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(firingElementEClass, FiringElement.class, "FiringElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFiringElement_Trigger(), ecorePackage.getEString(), "trigger", null, 0, 1, FiringElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFiringElement_Action(), ecorePackage.getEString(), "action", null, 0, 1, FiringElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(abstractStateEClass, AbstractState.class, "AbstractState", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAbstractState_Name(), ecorePackage.getEString(), "name", null, 1, 1, AbstractState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAbstractState_TransitionsAsSource(), this.getTransition(), this.getTransition_Source(), "transitionsAsSource", null, 0, -1, AbstractState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAbstractState_TransitionsAsTarget(), this.getTransition(), this.getTransition_Target(), "transitionsAsTarget", null, 0, -1, AbstractState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(stateEClass, State.class, "State", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getState_InternalActions(), this.getStateAction(), null, "internalActions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(initialStateEClass, InitialState.class, "InitialState", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(finalStateEClass, FinalState.class, "FinalState", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getTransition_Source(), this.getAbstractState(), this.getAbstractState_TransitionsAsSource(), "source", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getTransition_Target(), this.getAbstractState(), this.getAbstractState_TransitionsAsTarget(), "target", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(stateActionEClass, StateAction.class, "StateAction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); // Create annotations // gmf.diagram createGmfAnnotations(); // gmf.node createGmf_1Annotations(); // gmf.compartment createGmf_2Annotations(); // gmf.link createGmf_3Annotations(); } /** * Initializes the annotations for <b>gmf.diagram</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createGmfAnnotations() { String source = "gmf.diagram"; addAnnotation (stateMachineEClass, 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 (stateEClass, source, new String[] { "label", "name" }); addAnnotation (initialStateEClass, source, new String[] { "label.placement", "none", "figure", "ellipse", "size", "20,20", "color", "0,0,0" }); addAnnotation (finalStateEClass, source, new String[] { "label.placement", "none", "figure", "rectangle", "size", "20,20", "color", "0,0,0" }); addAnnotation (stateActionEClass, source, new String[] { "label", "trigger,action", "label.pattern", "{0}/{1}" }); } /** * Initializes the annotations for <b>gmf.compartment</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createGmf_2Annotations() { String source = "gmf.compartment"; addAnnotation (getState_InternalActions(), source, new String[] { "layout", "list" }); } /** * Initializes the annotations for <b>gmf.link</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createGmf_3Annotations() { String source = "gmf.link"; addAnnotation (transitionEClass, source, new String[] { "label", "trigger,action", "label.pattern", "{0}/{1}", "label.icon", "true", "source", "source", "target", "target", "target.decoration", "arrow" }); } } //StateMachine_MAVOPackageImpl