blob: 4fa499e7eaafe0a8867f9090f8cf0305b20d27ab [file] [log] [blame]
/**
*/
package flowchart.impl;
import flowchart.Action;
import flowchart.Decision;
import flowchart.Flowchart;
import flowchart.FlowchartFactory;
import flowchart.FlowchartPackage;
import flowchart.Node;
import flowchart.Subflow;
import flowchart.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 FlowchartPackageImpl extends EPackageImpl implements FlowchartPackage
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass flowchartEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass nodeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass transitionEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass subflowEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass actionEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass decisionEClass = 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 flowchart.FlowchartPackage#eNS_URI
* @see #init()
* @generated
*/
private FlowchartPackageImpl()
{
super(eNS_URI, FlowchartFactory.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 FlowchartPackage#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 FlowchartPackage init()
{
if (isInited) return (FlowchartPackage)EPackage.Registry.INSTANCE.getEPackage(FlowchartPackage.eNS_URI);
// Obtain or create and register package
FlowchartPackageImpl theFlowchartPackage = (FlowchartPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FlowchartPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FlowchartPackageImpl());
isInited = true;
// Create package meta-data objects
theFlowchartPackage.createPackageContents();
// Initialize created meta-data
theFlowchartPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theFlowchartPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(FlowchartPackage.eNS_URI, theFlowchartPackage);
return theFlowchartPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFlowchart()
{
return flowchartEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFlowchart_Nodes()
{
return (EReference)flowchartEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFlowchart_Transitions()
{
return (EReference)flowchartEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getNode()
{
return nodeEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getNode_Name()
{
return (EAttribute)nodeEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getNode_Outgoing()
{
return (EReference)nodeEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getNode_Incoming()
{
return (EReference)nodeEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTransition()
{
return transitionEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTransition_Name()
{
return (EAttribute)transitionEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getTransition_Source()
{
return (EReference)transitionEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getTransition_Target()
{
return (EReference)transitionEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getSubflow()
{
return subflowEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAction()
{
return actionEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getDecision()
{
return decisionEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FlowchartFactory getFlowchartFactory()
{
return (FlowchartFactory)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
flowchartEClass = createEClass(FLOWCHART);
createEReference(flowchartEClass, FLOWCHART__NODES);
createEReference(flowchartEClass, FLOWCHART__TRANSITIONS);
nodeEClass = createEClass(NODE);
createEAttribute(nodeEClass, NODE__NAME);
createEReference(nodeEClass, NODE__OUTGOING);
createEReference(nodeEClass, NODE__INCOMING);
transitionEClass = createEClass(TRANSITION);
createEAttribute(transitionEClass, TRANSITION__NAME);
createEReference(transitionEClass, TRANSITION__SOURCE);
createEReference(transitionEClass, TRANSITION__TARGET);
subflowEClass = createEClass(SUBFLOW);
actionEClass = createEClass(ACTION);
decisionEClass = createEClass(DECISION);
}
/**
* <!-- 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);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
subflowEClass.getESuperTypes().add(this.getFlowchart());
subflowEClass.getESuperTypes().add(this.getNode());
actionEClass.getESuperTypes().add(this.getNode());
decisionEClass.getESuperTypes().add(this.getNode());
// Initialize classes and features; add operations and parameters
initEClass(flowchartEClass, Flowchart.class, "Flowchart", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getFlowchart_Nodes(), this.getNode(), null, "nodes", null, 0, -1, Flowchart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFlowchart_Transitions(), this.getTransition(), null, "transitions", null, 0, -1, Flowchart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(nodeEClass, Node.class, "Node", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getNode_Name(), ecorePackage.getEString(), "name", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getNode_Outgoing(), this.getTransition(), this.getTransition_Source(), "outgoing", 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_Incoming(), this.getTransition(), this.getTransition_Target(), "incoming", 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(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getTransition_Name(), ecorePackage.getEString(), "name", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getTransition_Source(), this.getNode(), this.getNode_Outgoing(), "source", null, 0, 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.getNode(), this.getNode_Incoming(), "target", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(subflowEClass, Subflow.class, "Subflow", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(actionEClass, Action.class, "Action", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(decisionEClass, Decision.class, "Decision", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// 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
(flowchartEClass,
source,
new String[]
{
"foo", "bar"
});
}
/**
* 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",
"label.icon", "false"
});
addAnnotation
(actionEClass,
source,
new String[]
{
"figure", "org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures.SquareFigure"
});
addAnnotation
(decisionEClass,
source,
new String[]
{
"figure", "org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures.DiamondFigure"
});
}
/**
* Initializes the annotations for <b>gmf.link</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createGmf_2Annotations()
{
String source = "gmf.link";
addAnnotation
(transitionEClass,
source,
new String[]
{
"label", "name",
"source", "source",
"target", "target",
"target.decoration", "arrow"
});
}
} //FlowchartPackageImpl