Merge changes I077cb946,Ice0f806c,I3582ae0a
* changes:
OCL2AC to Henshin: tool plug-in.
Change-Id: I0000000000000000000000000000000000000000
test for preparing the integration of OCL2AC into Henshin
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/.classpath b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/.classpath
new file mode 100644
index 0000000..22f3064
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/.project b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/.project
new file mode 100644
index 0000000..fbf08cb
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.unimarburg.swt.ocl2ac.model.edit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/META-INF/MANIFEST.MF b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5ff2dd7
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: de.unimarburg.swt.ocl2ac.model.edit;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: graph.provider,
+ laxcondition.provider,
+ nestedcondition.provider,
+ nestedconstraintmodel.provider
+Require-Bundle: org.eclipse.core.runtime,
+ de.unimarburg.swt.ocl2ac.model;visibility:=reexport,
+ org.eclipse.emf.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/build.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/build.properties
new file mode 100644
index 0000000..6e3e902
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_Formula.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_Formula.gif
new file mode 100644
index 0000000..375192a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_Formula.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_QuantifiedLaxCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_QuantifiedLaxCondition.gif
new file mode 100644
index 0000000..846943b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_QuantifiedLaxCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_True.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_True.gif
new file mode 100644
index 0000000..160e652
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateCondition_laxCondition_True.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_Formula.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_Formula.gif
new file mode 100644
index 0000000..2bd03ce
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_Formula.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_QuantifiedCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_QuantifiedCondition.gif
new file mode 100644
index 0000000..6a08579
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_QuantifiedCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_QuantifiedLaxCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_QuantifiedLaxCondition.gif
new file mode 100644
index 0000000..7f7c51a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_QuantifiedLaxCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_True.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_True.gif
new file mode 100644
index 0000000..b32e049
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateFormula_arguments_True.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateGraph_edges_Edge.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateGraph_edges_Edge.gif
new file mode 100644
index 0000000..8fe680b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateGraph_edges_Edge.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateGraph_nodes_Node.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateGraph_nodes_Node.gif
new file mode 100644
index 0000000..388fb52
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateGraph_nodes_Node.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateMorphism_edgeMappings_EdgeMapping.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateMorphism_edgeMappings_EdgeMapping.gif
new file mode 100644
index 0000000..fac7c9b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateMorphism_edgeMappings_EdgeMapping.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateMorphism_nodeMappings_NodeMapping.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateMorphism_nodeMappings_NodeMapping.gif
new file mode 100644
index 0000000..14bbb4b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateMorphism_nodeMappings_NodeMapping.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedCondition_variables_Variable.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedCondition_variables_Variable.gif
new file mode 100644
index 0000000..578475a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedCondition_variables_Variable.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraintModel_nestedconstrainmodels_NestedConstraint.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraintModel_nestedconstrainmodels_NestedConstraint.gif
new file mode 100644
index 0000000..8fe680b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraintModel_nestedconstrainmodels_NestedConstraint.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_Formula.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_Formula.gif
new file mode 100644
index 0000000..425104d
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_Formula.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_QuantifiedCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_QuantifiedCondition.gif
new file mode 100644
index 0000000..5961821
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_QuantifiedCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_True.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_True.gif
new file mode 100644
index 0000000..2639c9c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_condition_True.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_domain_Graph.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_domain_Graph.gif
new file mode 100644
index 0000000..2914f06
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNestedConstraint_domain_Graph.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNode_attributes_Attribute.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNode_attributes_Attribute.gif
new file mode 100644
index 0000000..99df60b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateNode_attributes_Attribute.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_codomain_Graph.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_codomain_Graph.gif
new file mode 100644
index 0000000..bdba705
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_codomain_Graph.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_Formula.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_Formula.gif
new file mode 100644
index 0000000..110a46d
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_Formula.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_QuantifiedCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_QuantifiedCondition.gif
new file mode 100644
index 0000000..b1e7722
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_QuantifiedCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_True.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_True.gif
new file mode 100644
index 0000000..5e122f6
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_condition_True.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_morphism_Morphism.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_morphism_Morphism.gif
new file mode 100644
index 0000000..f7cfbc9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedCondition_morphism_Morphism.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_Formula.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_Formula.gif
new file mode 100644
index 0000000..e47a63a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_Formula.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_QuantifiedLaxCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_QuantifiedLaxCondition.gif
new file mode 100644
index 0000000..8966d11
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_QuantifiedLaxCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_True.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_True.gif
new file mode 100644
index 0000000..9f51228
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_condition_True.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_graph_Graph.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_graph_Graph.gif
new file mode 100644
index 0000000..8966d11
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_graph_Graph.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_variables_Variable.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_variables_Variable.gif
new file mode 100644
index 0000000..8fe680b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/ctool16/CreateQuantifiedLaxCondition_variables_Variable.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Attribute.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Attribute.gif
new file mode 100644
index 0000000..7b7c428
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Attribute.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Condition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Condition.gif
new file mode 100644
index 0000000..a26660e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Condition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Edge.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Edge.gif
new file mode 100644
index 0000000..83afb9b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Edge.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/EdgeMapping.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/EdgeMapping.gif
new file mode 100644
index 0000000..d3dc5a9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/EdgeMapping.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Formula.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Formula.gif
new file mode 100644
index 0000000..2b69256
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Formula.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Graph.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Graph.gif
new file mode 100644
index 0000000..c00aedf
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Graph.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Morphism.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Morphism.gif
new file mode 100644
index 0000000..c4a8af4
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Morphism.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NestedConstraint.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NestedConstraint.gif
new file mode 100644
index 0000000..83afb9b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NestedConstraint.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NestedConstraintModel.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NestedConstraintModel.gif
new file mode 100644
index 0000000..c00aedf
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NestedConstraintModel.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Node.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Node.gif
new file mode 100644
index 0000000..ef56c14
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Node.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NodeMapping.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NodeMapping.gif
new file mode 100644
index 0000000..14af8aa
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/NodeMapping.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/QuantifiedCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/QuantifiedCondition.gif
new file mode 100644
index 0000000..8a5c70c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/QuantifiedCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/QuantifiedLaxCondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/QuantifiedLaxCondition.gif
new file mode 100644
index 0000000..c00aedf
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/QuantifiedLaxCondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/True.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/True.gif
new file mode 100644
index 0000000..45731fe
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/True.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Variable.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Variable.gif
new file mode 100644
index 0000000..83afb9b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/icons/full/obj16/Variable.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/plugin.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/plugin.properties
new file mode 100644
index 0000000..d60996e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/plugin.properties
@@ -0,0 +1,95 @@
+#
+
+pluginName = Nestedconstraintmodel Edit Support
+providerName = www.example.org
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_NestedConstraintModel_type = Nested Constraint Model
+_UI_NestedConstraint_type = Nested Constraint
+_UI_NestedCondition_type = Nested Condition
+_UI_Variable_type = Variable
+_UI_QuantifiedCondition_type = Quantified Condition
+_UI_True_type = True
+_UI_Formula_type = Formula
+_UI_Morphism_type = Morphism
+_UI_NodeMapping_type = Node Mapping
+_UI_EdgeMapping_type = Edge Mapping
+_UI_Graph_type = Graph
+_UI_Node_type = Node
+_UI_Edge_type = Edge
+_UI_Attribute_type = Attribute
+_UI_Condition_type = Condition
+_UI_LaxCondition_type = Lax Condition
+_UI_QuantifiedLaxCondition_type = Quantified Lax Condition
+_UI_True_type = True
+_UI_Formula_type = Formula
+_UI_Variable_type = Variable
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_NestedConstraintModel_name_feature = Name
+_UI_NestedConstraintModel_nestedconstrainmodels_feature = Nestedconstrainmodels
+_UI_NestedConstraint_name_feature = Name
+_UI_NestedConstraint_typeGraph_feature = Type Graph
+_UI_NestedConstraint_condition_feature = Condition
+_UI_NestedConstraint_domain_feature = Domain
+_UI_NestedCondition_variables_feature = Variables
+_UI_NestedCondition_domain_feature = Domain
+_UI_Variable_name_feature = Name
+_UI_QuantifiedCondition_quantifier_feature = Quantifier
+_UI_QuantifiedCondition_condition_feature = Condition
+_UI_QuantifiedCondition_morphism_feature = Morphism
+_UI_QuantifiedCondition_codomain_feature = Codomain
+_UI_Formula_operator_feature = Operator
+_UI_Formula_arguments_feature = Arguments
+_UI_Morphism_nodeMappings_feature = Node Mappings
+_UI_Morphism_from_feature = From
+_UI_Morphism_to_feature = To
+_UI_Morphism_edgeMappings_feature = Edge Mappings
+_UI_NodeMapping_origin_feature = Origin
+_UI_NodeMapping_image_feature = Image
+_UI_EdgeMapping_origin_feature = Origin
+_UI_EdgeMapping_image_feature = Image
+_UI_Graph_edges_feature = Edges
+_UI_Graph_nodes_feature = Nodes
+_UI_Graph_typegraph_feature = Typegraph
+_UI_Graph_name_feature = Name
+_UI_Node_attributes_feature = Attributes
+_UI_Node_outgoing_feature = Outgoing
+_UI_Node_name_feature = Name
+_UI_Node_incoming_feature = Incoming
+_UI_Node_type_feature = Type
+_UI_Edge_source_feature = Source
+_UI_Edge_target_feature = Target
+_UI_Edge_type_feature = Type
+_UI_Attribute_op_feature = Op
+_UI_Attribute_value_feature = Value
+_UI_Attribute_type_feature = Type
+_UI_Condition_typeGraph_feature = Type Graph
+_UI_Condition_name_feature = Name
+_UI_Condition_laxCondition_feature = Lax Condition
+_UI_LaxCondition_formula_feature = Formula
+_UI_QuantifiedLaxCondition_graph_feature = Graph
+_UI_QuantifiedLaxCondition_condition_feature = Condition
+_UI_QuantifiedLaxCondition_quantifier_feature = Quantifier
+_UI_QuantifiedLaxCondition_variables_feature = Variables
+_UI_Formula_op_feature = Op
+_UI_Unknown_feature = Unspecified
+
+_UI_Quantifier_EXISTS_literal = EXISTS
+_UI_Quantifier_FORALL_literal = FORALL
+_UI_Operator_NOT_literal = NOT
+_UI_Operator_AND_literal = AND
+_UI_Operator_OR_literal = OR
+_UI_Operator_IMPLIES_literal = IMPLIES
+_UI_Operator_EQUIVALENT_literal = EQUIVALENT
+_UI_Operator_XOR_literal = XOR
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/plugin.xml b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/plugin.xml
new file mode 100644
index 0000000..c416f6c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/plugin.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated nestedconstraintmodel -->
+ <factory
+ uri="http://www.example.org/nestedconstraintmodel"
+ class="nestedconstraintmodel.provider.NestedconstraintmodelItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated nestedconstraintmodel -->
+ <factory
+ uri="http://www.example.org/nestedcondition"
+ class="nestedcondition.provider.NestedconditionItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated nestedconstraintmodel -->
+ <factory
+ uri="http://www.example.org/graph"
+ class="graph.provider.GraphItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated nestedconstraintmodel -->
+ <factory
+ uri="http://www.example.org/laxcondition"
+ class="laxcondition.provider.LaxconditionItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/AttributeItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/AttributeItemProvider.java
new file mode 100644
index 0000000..ff5106f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/AttributeItemProvider.java
@@ -0,0 +1,207 @@
+/**
+ */
+package graph.provider;
+
+
+import graph.Attribute;
+import graph.GraphPackage;
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link graph.Attribute} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class AttributeItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AttributeItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addOpPropertyDescriptor(object);
+ addValuePropertyDescriptor(object);
+ addTypePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Op feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOpPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Attribute_op_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Attribute_op_feature", "_UI_Attribute_type"),
+ GraphPackage.Literals.ATTRIBUTE__OP,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Value feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addValuePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Attribute_value_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Attribute_value_feature", "_UI_Attribute_type"),
+ GraphPackage.Literals.ATTRIBUTE__VALUE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Type feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Attribute_type_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Attribute_type_feature", "_UI_Attribute_type"),
+ GraphPackage.Literals.ATTRIBUTE__TYPE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns Attribute.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Attribute"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Attribute)object).getOp();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Attribute_type") :
+ getString("_UI_Attribute_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Attribute.class)) {
+ case GraphPackage.ATTRIBUTE__OP:
+ case GraphPackage.ATTRIBUTE__VALUE:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/EdgeItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/EdgeItemProvider.java
new file mode 100644
index 0000000..656d0f3
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/EdgeItemProvider.java
@@ -0,0 +1,194 @@
+/**
+ */
+package graph.provider;
+
+
+import graph.GraphPackage;
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+
+/**
+ * This is the item provider adapter for a {@link graph.Edge} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EdgeItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EdgeItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addSourcePropertyDescriptor(object);
+ addTargetPropertyDescriptor(object);
+ addTypePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Source feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addSourcePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Edge_source_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Edge_source_feature", "_UI_Edge_type"),
+ GraphPackage.Literals.EDGE__SOURCE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Target feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTargetPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Edge_target_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Edge_target_feature", "_UI_Edge_type"),
+ GraphPackage.Literals.EDGE__TARGET,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Type feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Edge_type_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Edge_type_feature", "_UI_Edge_type"),
+ GraphPackage.Literals.EDGE__TYPE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns Edge.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Edge"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_Edge_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/GraphItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/GraphItemProvider.java
new file mode 100644
index 0000000..eacaa2c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/GraphItemProvider.java
@@ -0,0 +1,231 @@
+/**
+ */
+package graph.provider;
+
+
+import graph.Graph;
+import graph.GraphFactory;
+import graph.GraphPackage;
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link graph.Graph} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addTypegraphPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Typegraph feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypegraphPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Graph_typegraph_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Graph_typegraph_feature", "_UI_Graph_type"),
+ GraphPackage.Literals.GRAPH__TYPEGRAPH,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Graph_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Graph_name_feature", "_UI_Graph_type"),
+ GraphPackage.Literals.GRAPH__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(GraphPackage.Literals.GRAPH__EDGES);
+ childrenFeatures.add(GraphPackage.Literals.GRAPH__NODES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Graph.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Graph"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Graph)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Graph_type") :
+ getString("_UI_Graph_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Graph.class)) {
+ case GraphPackage.GRAPH__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case GraphPackage.GRAPH__EDGES:
+ case GraphPackage.GRAPH__NODES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (GraphPackage.Literals.GRAPH__EDGES,
+ GraphFactory.eINSTANCE.createEdge()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (GraphPackage.Literals.GRAPH__NODES,
+ GraphFactory.eINSTANCE.createNode()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/GraphItemProviderAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/GraphItemProviderAdapterFactory.java
new file mode 100644
index 0000000..573a739
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/GraphItemProviderAdapterFactory.java
@@ -0,0 +1,271 @@
+/**
+ */
+package graph.provider;
+
+import graph.util.GraphAdapterFactory;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphItemProviderAdapterFactory extends GraphAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link graph.Graph} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphItemProvider graphItemProvider;
+
+ /**
+ * This creates an adapter for a {@link graph.Graph}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createGraphAdapter() {
+ if (graphItemProvider == null) {
+ graphItemProvider = new GraphItemProvider(this);
+ }
+
+ return graphItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link graph.Node} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NodeItemProvider nodeItemProvider;
+
+ /**
+ * This creates an adapter for a {@link graph.Node}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createNodeAdapter() {
+ if (nodeItemProvider == null) {
+ nodeItemProvider = new NodeItemProvider(this);
+ }
+
+ return nodeItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link graph.Edge} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EdgeItemProvider edgeItemProvider;
+
+ /**
+ * This creates an adapter for a {@link graph.Edge}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createEdgeAdapter() {
+ if (edgeItemProvider == null) {
+ edgeItemProvider = new EdgeItemProvider(this);
+ }
+
+ return edgeItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link graph.Attribute} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AttributeItemProvider attributeItemProvider;
+
+ /**
+ * This creates an adapter for a {@link graph.Attribute}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createAttributeAdapter() {
+ if (attributeItemProvider == null) {
+ attributeItemProvider = new AttributeItemProvider(this);
+ }
+
+ return attributeItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (graphItemProvider != null) graphItemProvider.dispose();
+ if (nodeItemProvider != null) nodeItemProvider.dispose();
+ if (edgeItemProvider != null) edgeItemProvider.dispose();
+ if (attributeItemProvider != null) attributeItemProvider.dispose();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/NodeItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/NodeItemProvider.java
new file mode 100644
index 0000000..8d97b97
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/graph/provider/NodeItemProvider.java
@@ -0,0 +1,270 @@
+/**
+ */
+package graph.provider;
+
+
+import graph.GraphFactory;
+import graph.GraphPackage;
+import graph.Node;
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link graph.Node} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NodeItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NodeItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addOutgoingPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ addIncomingPropertyDescriptor(object);
+ addTypePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Outgoing feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOutgoingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Node_outgoing_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Node_outgoing_feature", "_UI_Node_type"),
+ GraphPackage.Literals.NODE__OUTGOING,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Node_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Node_name_feature", "_UI_Node_type"),
+ GraphPackage.Literals.NODE__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Incoming feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIncomingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Node_incoming_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Node_incoming_feature", "_UI_Node_type"),
+ GraphPackage.Literals.NODE__INCOMING,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Type feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Node_type_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Node_type_feature", "_UI_Node_type"),
+ GraphPackage.Literals.NODE__TYPE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(GraphPackage.Literals.NODE__ATTRIBUTES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Node.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Node"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Node)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Node_type") :
+ getString("_UI_Node_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Node.class)) {
+ case GraphPackage.NODE__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case GraphPackage.NODE__ATTRIBUTES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (GraphPackage.Literals.NODE__ATTRIBUTES,
+ GraphFactory.eINSTANCE.createAttribute()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/ConditionItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/ConditionItemProvider.java
new file mode 100644
index 0000000..2281188
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/ConditionItemProvider.java
@@ -0,0 +1,234 @@
+/**
+ */
+package laxcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import laxcondition.Condition;
+import laxcondition.LaxconditionFactory;
+import laxcondition.LaxconditionPackage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link laxcondition.Condition} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ConditionItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ConditionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addTypeGraphPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Type Graph feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypeGraphPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Condition_typeGraph_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Condition_typeGraph_feature", "_UI_Condition_type"),
+ LaxconditionPackage.Literals.CONDITION__TYPE_GRAPH,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Condition_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Condition_name_feature", "_UI_Condition_type"),
+ LaxconditionPackage.Literals.CONDITION__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(LaxconditionPackage.Literals.CONDITION__LAX_CONDITION);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Condition.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Condition"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Condition)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Condition_type") :
+ getString("_UI_Condition_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Condition.class)) {
+ case LaxconditionPackage.CONDITION__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case LaxconditionPackage.CONDITION__LAX_CONDITION:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.CONDITION__LAX_CONDITION,
+ LaxconditionFactory.eINSTANCE.createQuantifiedLaxCondition()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.CONDITION__LAX_CONDITION,
+ LaxconditionFactory.eINSTANCE.createTrue()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.CONDITION__LAX_CONDITION,
+ LaxconditionFactory.eINSTANCE.createFormula()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/FormulaItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/FormulaItemProvider.java
new file mode 100644
index 0000000..66f73f8
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/FormulaItemProvider.java
@@ -0,0 +1,185 @@
+/**
+ */
+package laxcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import laxcondition.Formula;
+import laxcondition.LaxconditionFactory;
+import laxcondition.LaxconditionPackage;
+import laxcondition.Operator;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link laxcondition.Formula} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class FormulaItemProvider extends LaxConditionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FormulaItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addOpPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Op feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOpPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Formula_op_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Formula_op_feature", "_UI_Formula_type"),
+ LaxconditionPackage.Literals.FORMULA__OP,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(LaxconditionPackage.Literals.FORMULA__ARGUMENTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Formula.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Formula"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ Operator labelValue = ((Formula)object).getOp();
+ String label = labelValue == null ? null : labelValue.toString();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Formula_type") :
+ getString("_UI_Formula_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Formula.class)) {
+ case LaxconditionPackage.FORMULA__OP:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.FORMULA__ARGUMENTS,
+ LaxconditionFactory.eINSTANCE.createQuantifiedLaxCondition()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.FORMULA__ARGUMENTS,
+ LaxconditionFactory.eINSTANCE.createTrue()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.FORMULA__ARGUMENTS,
+ LaxconditionFactory.eINSTANCE.createFormula()));
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/LaxConditionItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/LaxConditionItemProvider.java
new file mode 100644
index 0000000..70be7e9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/LaxConditionItemProvider.java
@@ -0,0 +1,111 @@
+/**
+ */
+package laxcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+
+/**
+ * This is the item provider adapter for a {@link laxcondition.LaxCondition} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxConditionItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxConditionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_LaxCondition_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/LaxconditionItemProviderAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/LaxconditionItemProviderAdapterFactory.java
new file mode 100644
index 0000000..e05adde
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/LaxconditionItemProviderAdapterFactory.java
@@ -0,0 +1,295 @@
+/**
+ */
+package laxcondition.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import laxcondition.util.LaxconditionAdapterFactory;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxconditionItemProviderAdapterFactory extends LaxconditionAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link laxcondition.Condition} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ConditionItemProvider conditionItemProvider;
+
+ /**
+ * This creates an adapter for a {@link laxcondition.Condition}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createConditionAdapter() {
+ if (conditionItemProvider == null) {
+ conditionItemProvider = new ConditionItemProvider(this);
+ }
+
+ return conditionItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link laxcondition.QuantifiedLaxCondition} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected QuantifiedLaxConditionItemProvider quantifiedLaxConditionItemProvider;
+
+ /**
+ * This creates an adapter for a {@link laxcondition.QuantifiedLaxCondition}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createQuantifiedLaxConditionAdapter() {
+ if (quantifiedLaxConditionItemProvider == null) {
+ quantifiedLaxConditionItemProvider = new QuantifiedLaxConditionItemProvider(this);
+ }
+
+ return quantifiedLaxConditionItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link laxcondition.True} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TrueItemProvider trueItemProvider;
+
+ /**
+ * This creates an adapter for a {@link laxcondition.True}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createTrueAdapter() {
+ if (trueItemProvider == null) {
+ trueItemProvider = new TrueItemProvider(this);
+ }
+
+ return trueItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link laxcondition.Formula} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FormulaItemProvider formulaItemProvider;
+
+ /**
+ * This creates an adapter for a {@link laxcondition.Formula}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createFormulaAdapter() {
+ if (formulaItemProvider == null) {
+ formulaItemProvider = new FormulaItemProvider(this);
+ }
+
+ return formulaItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link laxcondition.Variable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected VariableItemProvider variableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link laxcondition.Variable}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createVariableAdapter() {
+ if (variableItemProvider == null) {
+ variableItemProvider = new VariableItemProvider(this);
+ }
+
+ return variableItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (conditionItemProvider != null) conditionItemProvider.dispose();
+ if (quantifiedLaxConditionItemProvider != null) quantifiedLaxConditionItemProvider.dispose();
+ if (trueItemProvider != null) trueItemProvider.dispose();
+ if (formulaItemProvider != null) formulaItemProvider.dispose();
+ if (variableItemProvider != null) variableItemProvider.dispose();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/QuantifiedLaxConditionItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/QuantifiedLaxConditionItemProvider.java
new file mode 100644
index 0000000..504ad1a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/QuantifiedLaxConditionItemProvider.java
@@ -0,0 +1,201 @@
+/**
+ */
+package laxcondition.provider;
+
+
+import graph.GraphFactory;
+
+import java.util.Collection;
+import java.util.List;
+
+import laxcondition.LaxconditionFactory;
+import laxcondition.LaxconditionPackage;
+import laxcondition.QuantifiedLaxCondition;
+import laxcondition.Quantifier;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link laxcondition.QuantifiedLaxCondition} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class QuantifiedLaxConditionItemProvider extends LaxConditionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuantifiedLaxConditionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addQuantifierPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Quantifier feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addQuantifierPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_QuantifiedLaxCondition_quantifier_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_QuantifiedLaxCondition_quantifier_feature", "_UI_QuantifiedLaxCondition_type"),
+ LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__QUANTIFIER,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__GRAPH);
+ childrenFeatures.add(LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__CONDITION);
+ childrenFeatures.add(LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__VARIABLES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns QuantifiedLaxCondition.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/QuantifiedLaxCondition"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ Quantifier labelValue = ((QuantifiedLaxCondition)object).getQuantifier();
+ String label = labelValue == null ? null : labelValue.toString();
+ return label == null || label.length() == 0 ?
+ getString("_UI_QuantifiedLaxCondition_type") :
+ getString("_UI_QuantifiedLaxCondition_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(QuantifiedLaxCondition.class)) {
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__QUANTIFIER:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH:
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION:
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__GRAPH,
+ GraphFactory.eINSTANCE.createGraph()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__CONDITION,
+ LaxconditionFactory.eINSTANCE.createQuantifiedLaxCondition()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__CONDITION,
+ LaxconditionFactory.eINSTANCE.createTrue()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__CONDITION,
+ LaxconditionFactory.eINSTANCE.createFormula()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION__VARIABLES,
+ LaxconditionFactory.eINSTANCE.createVariable()));
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/TrueItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/TrueItemProvider.java
new file mode 100644
index 0000000..675a4f6
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/TrueItemProvider.java
@@ -0,0 +1,94 @@
+/**
+ */
+package laxcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * This is the item provider adapter for a {@link laxcondition.True} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class TrueItemProvider extends LaxConditionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TrueItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This returns True.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/True"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_True_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/VariableItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/VariableItemProvider.java
new file mode 100644
index 0000000..887a4bd
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/laxcondition/provider/VariableItemProvider.java
@@ -0,0 +1,160 @@
+/**
+ */
+package laxcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import laxcondition.LaxconditionPackage;
+import laxcondition.Variable;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link laxcondition.Variable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class VariableItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public VariableItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Variable_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Variable_name_feature", "_UI_Variable_type"),
+ LaxconditionPackage.Literals.VARIABLE__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns Variable.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Variable"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Variable)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Variable_type") :
+ getString("_UI_Variable_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Variable.class)) {
+ case LaxconditionPackage.VARIABLE__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/EdgeMappingItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/EdgeMappingItemProvider.java
new file mode 100644
index 0000000..931ff9e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/EdgeMappingItemProvider.java
@@ -0,0 +1,171 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.NestedconditionPackage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.EdgeMapping} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EdgeMappingItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EdgeMappingItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addOriginPropertyDescriptor(object);
+ addImagePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Origin feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOriginPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_EdgeMapping_origin_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_EdgeMapping_origin_feature", "_UI_EdgeMapping_type"),
+ NestedconditionPackage.Literals.EDGE_MAPPING__ORIGIN,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Image feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addImagePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_EdgeMapping_image_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_EdgeMapping_image_feature", "_UI_EdgeMapping_type"),
+ NestedconditionPackage.Literals.EDGE_MAPPING__IMAGE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns EdgeMapping.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/EdgeMapping"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_EdgeMapping_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/FormulaItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/FormulaItemProvider.java
new file mode 100644
index 0000000..1cd79f5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/FormulaItemProvider.java
@@ -0,0 +1,186 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import laxcondition.Operator;
+
+import nestedcondition.Formula;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.Formula} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class FormulaItemProvider extends NestedConditionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FormulaItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addOperatorPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Operator feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOperatorPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Formula_operator_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Formula_operator_feature", "_UI_Formula_type"),
+ NestedconditionPackage.Literals.FORMULA__OPERATOR,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(NestedconditionPackage.Literals.FORMULA__ARGUMENTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Formula.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Formula"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ Operator labelValue = ((Formula)object).getOperator();
+ String label = labelValue == null ? null : labelValue.toString();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Formula_type") :
+ getString("_UI_Formula_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Formula.class)) {
+ case NestedconditionPackage.FORMULA__OPERATOR:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case NestedconditionPackage.FORMULA__ARGUMENTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.FORMULA__ARGUMENTS,
+ NestedconditionFactory.eINSTANCE.createQuantifiedCondition()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.FORMULA__ARGUMENTS,
+ NestedconditionFactory.eINSTANCE.createTrue()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.FORMULA__ARGUMENTS,
+ NestedconditionFactory.eINSTANCE.createFormula()));
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/MorphismItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/MorphismItemProvider.java
new file mode 100644
index 0000000..5c29093
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/MorphismItemProvider.java
@@ -0,0 +1,224 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.Morphism;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.Morphism} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class MorphismItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MorphismItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addFromPropertyDescriptor(object);
+ addToPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the From feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addFromPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Morphism_from_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Morphism_from_feature", "_UI_Morphism_type"),
+ NestedconditionPackage.Literals.MORPHISM__FROM,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the To feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addToPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Morphism_to_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Morphism_to_feature", "_UI_Morphism_type"),
+ NestedconditionPackage.Literals.MORPHISM__TO,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(NestedconditionPackage.Literals.MORPHISM__NODE_MAPPINGS);
+ childrenFeatures.add(NestedconditionPackage.Literals.MORPHISM__EDGE_MAPPINGS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Morphism.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Morphism"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_Morphism_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Morphism.class)) {
+ case NestedconditionPackage.MORPHISM__NODE_MAPPINGS:
+ case NestedconditionPackage.MORPHISM__EDGE_MAPPINGS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.MORPHISM__NODE_MAPPINGS,
+ NestedconditionFactory.eINSTANCE.createNodeMapping()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.MORPHISM__EDGE_MAPPINGS,
+ NestedconditionFactory.eINSTANCE.createEdgeMapping()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedConditionItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedConditionItemProvider.java
new file mode 100644
index 0000000..b167ef7
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedConditionItemProvider.java
@@ -0,0 +1,183 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.NestedCondition} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedConditionItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedConditionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addDomainPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Domain feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addDomainPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_NestedCondition_domain_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_NestedCondition_domain_feature", "_UI_NestedCondition_type"),
+ NestedconditionPackage.Literals.NESTED_CONDITION__DOMAIN,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(NestedconditionPackage.Literals.NESTED_CONDITION__VARIABLES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_NestedCondition_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(NestedCondition.class)) {
+ case NestedconditionPackage.NESTED_CONDITION__VARIABLES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.NESTED_CONDITION__VARIABLES,
+ NestedconditionFactory.eINSTANCE.createVariable()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedConstraintItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedConstraintItemProvider.java
new file mode 100644
index 0000000..6dc0e62
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedConstraintItemProvider.java
@@ -0,0 +1,243 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import graph.GraphFactory;
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.NestedConstraint} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedConstraintItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedConstraintItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addTypeGraphPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_NestedConstraint_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_NestedConstraint_name_feature", "_UI_NestedConstraint_type"),
+ NestedconditionPackage.Literals.NESTED_CONSTRAINT__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Type Graph feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypeGraphPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_NestedConstraint_typeGraph_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_NestedConstraint_typeGraph_feature", "_UI_NestedConstraint_type"),
+ NestedconditionPackage.Literals.NESTED_CONSTRAINT__TYPE_GRAPH,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(NestedconditionPackage.Literals.NESTED_CONSTRAINT__CONDITION);
+ childrenFeatures.add(NestedconditionPackage.Literals.NESTED_CONSTRAINT__DOMAIN);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns NestedConstraint.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/NestedConstraint"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((NestedConstraint)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_NestedConstraint_type") :
+ getString("_UI_NestedConstraint_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(NestedConstraint.class)) {
+ case NestedconditionPackage.NESTED_CONSTRAINT__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__CONDITION:
+ case NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT__CONDITION,
+ NestedconditionFactory.eINSTANCE.createQuantifiedCondition()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT__CONDITION,
+ NestedconditionFactory.eINSTANCE.createTrue()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT__CONDITION,
+ NestedconditionFactory.eINSTANCE.createFormula()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT__DOMAIN,
+ GraphFactory.eINSTANCE.createGraph()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedconditionItemProviderAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedconditionItemProviderAdapterFactory.java
new file mode 100644
index 0000000..199b6ea
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NestedconditionItemProviderAdapterFactory.java
@@ -0,0 +1,367 @@
+/**
+ */
+package nestedcondition.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import nestedcondition.util.NestedconditionAdapterFactory;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconditionItemProviderAdapterFactory extends NestedconditionAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.NestedConstraint} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedConstraintItemProvider nestedConstraintItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.NestedConstraint}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createNestedConstraintAdapter() {
+ if (nestedConstraintItemProvider == null) {
+ nestedConstraintItemProvider = new NestedConstraintItemProvider(this);
+ }
+
+ return nestedConstraintItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.Variable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected VariableItemProvider variableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.Variable}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createVariableAdapter() {
+ if (variableItemProvider == null) {
+ variableItemProvider = new VariableItemProvider(this);
+ }
+
+ return variableItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.QuantifiedCondition} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected QuantifiedConditionItemProvider quantifiedConditionItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.QuantifiedCondition}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createQuantifiedConditionAdapter() {
+ if (quantifiedConditionItemProvider == null) {
+ quantifiedConditionItemProvider = new QuantifiedConditionItemProvider(this);
+ }
+
+ return quantifiedConditionItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.True} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TrueItemProvider trueItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.True}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createTrueAdapter() {
+ if (trueItemProvider == null) {
+ trueItemProvider = new TrueItemProvider(this);
+ }
+
+ return trueItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.Formula} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FormulaItemProvider formulaItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.Formula}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createFormulaAdapter() {
+ if (formulaItemProvider == null) {
+ formulaItemProvider = new FormulaItemProvider(this);
+ }
+
+ return formulaItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.Morphism} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MorphismItemProvider morphismItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.Morphism}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createMorphismAdapter() {
+ if (morphismItemProvider == null) {
+ morphismItemProvider = new MorphismItemProvider(this);
+ }
+
+ return morphismItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.NodeMapping} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NodeMappingItemProvider nodeMappingItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.NodeMapping}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createNodeMappingAdapter() {
+ if (nodeMappingItemProvider == null) {
+ nodeMappingItemProvider = new NodeMappingItemProvider(this);
+ }
+
+ return nodeMappingItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedcondition.EdgeMapping} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EdgeMappingItemProvider edgeMappingItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedcondition.EdgeMapping}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createEdgeMappingAdapter() {
+ if (edgeMappingItemProvider == null) {
+ edgeMappingItemProvider = new EdgeMappingItemProvider(this);
+ }
+
+ return edgeMappingItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (nestedConstraintItemProvider != null) nestedConstraintItemProvider.dispose();
+ if (variableItemProvider != null) variableItemProvider.dispose();
+ if (quantifiedConditionItemProvider != null) quantifiedConditionItemProvider.dispose();
+ if (trueItemProvider != null) trueItemProvider.dispose();
+ if (formulaItemProvider != null) formulaItemProvider.dispose();
+ if (morphismItemProvider != null) morphismItemProvider.dispose();
+ if (nodeMappingItemProvider != null) nodeMappingItemProvider.dispose();
+ if (edgeMappingItemProvider != null) edgeMappingItemProvider.dispose();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NodeMappingItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NodeMappingItemProvider.java
new file mode 100644
index 0000000..d06e425
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/NodeMappingItemProvider.java
@@ -0,0 +1,171 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.NestedconditionPackage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.NodeMapping} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NodeMappingItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NodeMappingItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addOriginPropertyDescriptor(object);
+ addImagePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Origin feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOriginPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_NodeMapping_origin_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_NodeMapping_origin_feature", "_UI_NodeMapping_type"),
+ NestedconditionPackage.Literals.NODE_MAPPING__ORIGIN,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Image feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addImagePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_NodeMapping_image_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_NodeMapping_image_feature", "_UI_NodeMapping_type"),
+ NestedconditionPackage.Literals.NODE_MAPPING__IMAGE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns NodeMapping.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/NodeMapping"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_NodeMapping_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/QuantifiedConditionItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/QuantifiedConditionItemProvider.java
new file mode 100644
index 0000000..6c78964
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/QuantifiedConditionItemProvider.java
@@ -0,0 +1,202 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import graph.GraphFactory;
+
+import java.util.Collection;
+import java.util.List;
+
+import laxcondition.Quantifier;
+
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.QuantifiedCondition;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.QuantifiedCondition} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class QuantifiedConditionItemProvider extends NestedConditionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuantifiedConditionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addQuantifierPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Quantifier feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addQuantifierPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_QuantifiedCondition_quantifier_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_QuantifiedCondition_quantifier_feature", "_UI_QuantifiedCondition_type"),
+ NestedconditionPackage.Literals.QUANTIFIED_CONDITION__QUANTIFIER,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(NestedconditionPackage.Literals.QUANTIFIED_CONDITION__CONDITION);
+ childrenFeatures.add(NestedconditionPackage.Literals.QUANTIFIED_CONDITION__MORPHISM);
+ childrenFeatures.add(NestedconditionPackage.Literals.QUANTIFIED_CONDITION__CODOMAIN);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns QuantifiedCondition.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/QuantifiedCondition"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ Quantifier labelValue = ((QuantifiedCondition)object).getQuantifier();
+ String label = labelValue == null ? null : labelValue.toString();
+ return label == null || label.length() == 0 ?
+ getString("_UI_QuantifiedCondition_type") :
+ getString("_UI_QuantifiedCondition_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(QuantifiedCondition.class)) {
+ case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION:
+ case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM:
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION__CONDITION,
+ NestedconditionFactory.eINSTANCE.createQuantifiedCondition()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION__CONDITION,
+ NestedconditionFactory.eINSTANCE.createTrue()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION__CONDITION,
+ NestedconditionFactory.eINSTANCE.createFormula()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION__MORPHISM,
+ NestedconditionFactory.eINSTANCE.createMorphism()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION__CODOMAIN,
+ GraphFactory.eINSTANCE.createGraph()));
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/TrueItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/TrueItemProvider.java
new file mode 100644
index 0000000..95ee9a9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/TrueItemProvider.java
@@ -0,0 +1,94 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.True} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class TrueItemProvider extends NestedConditionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TrueItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This returns True.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/True"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_True_type");
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/VariableItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/VariableItemProvider.java
new file mode 100644
index 0000000..6bdad6b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedcondition/provider/VariableItemProvider.java
@@ -0,0 +1,160 @@
+/**
+ */
+package nestedcondition.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.Variable;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedcondition.Variable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class VariableItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public VariableItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Variable_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Variable_name_feature", "_UI_Variable_type"),
+ NestedconditionPackage.Literals.VARIABLE__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns Variable.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Variable"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Variable)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Variable_type") :
+ getString("_UI_Variable_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Variable.class)) {
+ case NestedconditionPackage.VARIABLE__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedConstraintModelItemProvider.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedConstraintModelItemProvider.java
new file mode 100644
index 0000000..8875556
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedConstraintModelItemProvider.java
@@ -0,0 +1,200 @@
+/**
+ */
+package nestedconstraintmodel.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import nestedcondition.NestedconditionFactory;
+
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link nestedconstraintmodel.NestedConstraintModel} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedConstraintModelItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedConstraintModelItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_NestedConstraintModel_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_NestedConstraintModel_name_feature", "_UI_NestedConstraintModel_type"),
+ NestedconstraintmodelPackage.Literals.NESTED_CONSTRAINT_MODEL__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(NestedconstraintmodelPackage.Literals.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns NestedConstraintModel.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/NestedConstraintModel"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((NestedConstraintModel)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_NestedConstraintModel_type") :
+ getString("_UI_NestedConstraintModel_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(NestedConstraintModel.class)) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (NestedconstraintmodelPackage.Literals.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS,
+ NestedconditionFactory.eINSTANCE.createNestedConstraint()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return NestedconstraintmodelEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedconstraintmodelEditPlugin.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedconstraintmodelEditPlugin.java
new file mode 100644
index 0000000..c1958d0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedconstraintmodelEditPlugin.java
@@ -0,0 +1,89 @@
+/**
+ */
+package nestedconstraintmodel.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the Nestedconstraintmodel edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class NestedconstraintmodelEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final NestedconstraintmodelEditPlugin INSTANCE = new NestedconstraintmodelEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelEditPlugin() {
+ super
+ (new ResourceLocator [] {
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedconstraintmodelItemProviderAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedconstraintmodelItemProviderAdapterFactory.java
new file mode 100644
index 0000000..0cf2d35
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.edit/src/nestedconstraintmodel/provider/NestedconstraintmodelItemProviderAdapterFactory.java
@@ -0,0 +1,199 @@
+/**
+ */
+package nestedconstraintmodel.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import nestedconstraintmodel.util.NestedconstraintmodelAdapterFactory;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconstraintmodelItemProviderAdapterFactory extends NestedconstraintmodelAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link nestedconstraintmodel.NestedConstraintModel} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedConstraintModelItemProvider nestedConstraintModelItemProvider;
+
+ /**
+ * This creates an adapter for a {@link nestedconstraintmodel.NestedConstraintModel}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createNestedConstraintModelAdapter() {
+ if (nestedConstraintModelItemProvider == null) {
+ nestedConstraintModelItemProvider = new NestedConstraintModelItemProvider(this);
+ }
+
+ return nestedConstraintModelItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (nestedConstraintModelItemProvider != null) nestedConstraintModelItemProvider.dispose();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/.classpath b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/.classpath
new file mode 100644
index 0000000..22f3064
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/.project b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/.project
new file mode 100644
index 0000000..aeb84b5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.unimarburg.swt.ocl2ac.model.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/META-INF/MANIFEST.MF b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..897ff56
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: de.unimarburg.swt.ocl2ac.model.editor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: graph.presentation,
+ laxcondition.presentation,
+ nestedcondition.presentation,
+ nestedconstraintmodel.presentation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;visibility:=reexport,
+ de.unimarburg.swt.ocl2ac.model.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.edit.ui;visibility:=reexport,
+ org.eclipse.ui.ide;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/build.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/build.properties
new file mode 100644
index 0000000..5fb0771
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/GraphModelFile.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/GraphModelFile.gif
new file mode 100644
index 0000000..6984fd4
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/GraphModelFile.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/LaxconditionModelFile.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/LaxconditionModelFile.gif
new file mode 100644
index 0000000..557e65e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/LaxconditionModelFile.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/NestedconditionModelFile.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/NestedconditionModelFile.gif
new file mode 100644
index 0000000..415a3b6
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/NestedconditionModelFile.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/NestedconstraintmodelModelFile.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/NestedconstraintmodelModelFile.gif
new file mode 100644
index 0000000..fa21681
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/obj16/NestedconstraintmodelModelFile.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewGraph.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewGraph.gif
new file mode 100644
index 0000000..f3829ed
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewGraph.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewLaxcondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewLaxcondition.gif
new file mode 100644
index 0000000..7158177
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewLaxcondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewNestedcondition.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewNestedcondition.gif
new file mode 100644
index 0000000..acfcd36
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewNestedcondition.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewNestedconstraintmodel.gif b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewNestedconstraintmodel.gif
new file mode 100644
index 0000000..0e69a72
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/icons/full/wizban/NewNestedconstraintmodel.gif
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/plugin.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/plugin.properties
new file mode 100644
index 0000000..4aee8a9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/plugin.properties
@@ -0,0 +1,80 @@
+#
+
+pluginName = Nestedconstraintmodel Editor
+providerName = www.example.org
+
+_UI_NestedconstraintmodelEditor_menu = &Nestedconstraintmodel Editor
+_UI_NestedconditionEditor_menu = &Nestedcondition Editor
+_UI_GraphEditor_menu = &Graph Editor
+_UI_LaxconditionEditor_menu = &Laxcondition Editor
+
+_UI_CreateChild_menu_item = &New Child
+_UI_CreateSibling_menu_item = N&ew Sibling
+
+_UI_ShowPropertiesView_menu_item = Show &Properties View
+_UI_RefreshViewer_menu_item = &Refresh
+
+_UI_SelectionPage_label = Selection
+_UI_ParentPage_label = Parent
+_UI_ListPage_label = List
+_UI_TreePage_label = Tree
+_UI_TablePage_label = Table
+_UI_TreeWithColumnsPage_label = Tree with Columns
+_UI_ObjectColumn_label = Object
+_UI_SelfColumn_label = Self
+
+_UI_NoObjectSelected = Selected Nothing
+_UI_SingleObjectSelected = Selected Object: {0}
+_UI_MultiObjectSelected = Selected {0} Objects
+
+_UI_OpenEditorError_label = Open Editor
+
+_UI_Wizard_category = Example EMF Model Creation Wizards
+
+_UI_CreateModelError_message = Problems encountered in file "{0}"
+
+_UI_NestedconstraintmodelModelWizard_label = Nestedconstraintmodel Model
+_UI_NestedconstraintmodelModelWizard_description = Create a new Nestedconstraintmodel model
+
+_UI_NestedconstraintmodelEditor_label = Nestedconstraintmodel Model Editor
+
+_UI_NestedconstraintmodelEditorFilenameDefaultBase = My
+_UI_NestedconstraintmodelEditorFilenameExtensions = nestedconstraintmodel
+
+_UI_NestedconditionModelWizard_label = Nestedcondition Model
+_UI_NestedconditionModelWizard_description = Create a new Nestedcondition model
+
+_UI_NestedconditionEditor_label = Nestedcondition Model Editor
+
+_UI_NestedconditionEditorFilenameDefaultBase = My
+_UI_NestedconditionEditorFilenameExtensions = nestedcondition
+
+_UI_GraphModelWizard_label = Graph Model
+_UI_GraphModelWizard_description = Create a new Graph model
+
+_UI_GraphEditor_label = Graph Model Editor
+
+_UI_GraphEditorFilenameDefaultBase = My
+_UI_GraphEditorFilenameExtensions = graph
+
+_UI_LaxconditionModelWizard_label = Laxcondition Model
+_UI_LaxconditionModelWizard_description = Create a new Laxcondition model
+
+_UI_LaxconditionEditor_label = Laxcondition Model Editor
+
+_UI_LaxconditionEditorFilenameDefaultBase = My
+_UI_LaxconditionEditorFilenameExtensions = laxcondition
+
+_UI_Wizard_label = New
+
+_WARN_FilenameExtension = The file name must end in ''.{0}''
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+
+_UI_ModelObject = &Model Object
+_UI_XMLEncoding = &XML Encoding
+_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
+_UI_Wizard_initial_object_description = Select a model object to create
+
+_UI_FileConflict_label = File Conflict
+_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/plugin.xml b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/plugin.xml
new file mode 100644
index 0000000..5017302
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/plugin.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated nestedconstraintmodel -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="nestedconstraintmodel.presentation.NestedconstraintmodelModelWizardID"
+ name="%_UI_NestedconstraintmodelModelWizard_label"
+ class="nestedconstraintmodel.presentation.NestedconstraintmodelModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/NestedconstraintmodelModelFile.gif">
+ <description>%_UI_NestedconstraintmodelModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated nestedconstraintmodel -->
+ <editor
+ id="nestedconstraintmodel.presentation.NestedconstraintmodelEditorID"
+ name="%_UI_NestedconstraintmodelEditor_label"
+ icon="icons/full/obj16/NestedconstraintmodelModelFile.gif"
+ extensions="nestedconstraintmodel"
+ class="nestedconstraintmodel.presentation.NestedconstraintmodelEditor"
+ contributorClass="nestedconstraintmodel.presentation.NestedconstraintmodelActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated nestedconstraintmodel -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="nestedcondition.presentation.NestedconditionModelWizardID"
+ name="%_UI_NestedconditionModelWizard_label"
+ class="nestedcondition.presentation.NestedconditionModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/NestedconditionModelFile.gif">
+ <description>%_UI_NestedconditionModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated nestedconstraintmodel -->
+ <editor
+ id="nestedcondition.presentation.NestedconditionEditorID"
+ name="%_UI_NestedconditionEditor_label"
+ icon="icons/full/obj16/NestedconditionModelFile.gif"
+ extensions="nestedcondition"
+ class="nestedcondition.presentation.NestedconditionEditor"
+ contributorClass="nestedcondition.presentation.NestedconditionActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated nestedconstraintmodel -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="graph.presentation.GraphModelWizardID"
+ name="%_UI_GraphModelWizard_label"
+ class="graph.presentation.GraphModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/GraphModelFile.gif">
+ <description>%_UI_GraphModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated nestedconstraintmodel -->
+ <editor
+ id="graph.presentation.GraphEditorID"
+ name="%_UI_GraphEditor_label"
+ icon="icons/full/obj16/GraphModelFile.gif"
+ extensions="graph"
+ class="graph.presentation.GraphEditor"
+ contributorClass="graph.presentation.GraphActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated nestedconstraintmodel -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="laxcondition.presentation.LaxconditionModelWizardID"
+ name="%_UI_LaxconditionModelWizard_label"
+ class="laxcondition.presentation.LaxconditionModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/LaxconditionModelFile.gif">
+ <description>%_UI_LaxconditionModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated nestedconstraintmodel -->
+ <editor
+ id="laxcondition.presentation.LaxconditionEditorID"
+ name="%_UI_LaxconditionEditor_label"
+ icon="icons/full/obj16/LaxconditionModelFile.gif"
+ extensions="laxcondition"
+ class="laxcondition.presentation.LaxconditionEditor"
+ contributorClass="laxcondition.presentation.LaxconditionActionBarContributor">
+ </editor>
+ </extension>
+
+</plugin>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphActionBarContributor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphActionBarContributor.java
new file mode 100644
index 0000000..d3b483a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphActionBarContributor.java
@@ -0,0 +1,425 @@
+/**
+ */
+package graph.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the Graph model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("graph-settings"));
+ toolBarManager.add(new Separator("graph-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphEditor_menu"), "graphMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphEditor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphEditor.java
new file mode 100644
index 0000000..bb463a4
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphEditor.java
@@ -0,0 +1,1748 @@
+/**
+ */
+package graph.presentation;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import graph.provider.GraphItemProviderAdapterFactory;
+import laxcondition.provider.LaxconditionItemProviderAdapterFactory;
+import nestedcondition.provider.NestedconditionItemProviderAdapterFactory;
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+import nestedconstraintmodel.provider.NestedconstraintmodelItemProviderAdapterFactory;
+
+/**
+ * This is an example of a Graph model editor. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+public class GraphEditor extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * This keeps track of the editing domain that is used to track all changes
+ * to the model. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge... <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline. The
+ * parent relation must be correctly defined for this to work. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and
+ * show parents as a tree. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works. A list viewer doesn't support icons.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works. A table can be used as a list with
+ * icons. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of
+ * the viewers in the pages or the content outline viewer. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the
+ * {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are
+ * listening to this editor. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers
+ * presented in Eclipse's Problems View. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IPartListener partListener = new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(GraphEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ } else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(GraphEditor.this);
+ handleActivate();
+ }
+ } else if (p == GraphEditor.this) {
+ handleActivate();
+ }
+ }
+
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded
+ * loaded. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter = new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource) notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ } else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ } else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED
+ && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(
+ URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ } else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(GraphEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == GraphEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ } catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(GraphEditor.this, false);
+ } else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ } else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ } catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the
+ * specified diagnostic. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "de.unimarburg.swt.ocl2ac.model.editor", 0,
+ null, new Object[] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ } else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ } catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ } catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ public GraphEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconstraintmodelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new GraphItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new LaxconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are
+ // executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to
+ // be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener(new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext();) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ } else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable = new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of
+ // the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the
+ * {@link IEditingDomainProvider} interface. This is important for
+ * implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object[] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object[] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or
+ * the outline view, if it has focus, is the current one. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener = new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the
+ // section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's
+ // selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider}
+ * interface. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well
+ * registering the menu for extension. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu = contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(),
+ FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's
+ * resource set based on the editor's input. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ } catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the
+ * resource and the specified exception (if any). <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic = new BasicDiagnostic(hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
+ "de.unimarburg.swt.ocl2ac.model.editor", 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception == null ? (Object) resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ } else if (exception != null) {
+ return new BasicDiagnostic(Diagnostic.ERROR, "de.unimarburg.swt.ocl2ac.model.editor", 0,
+ getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception });
+ } else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane = new ViewerPane(getSite().getPage(), GraphEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer) viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(
+ new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane = new ViewerPane(getSite().getPage(), GraphEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer) viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane = new ViewerPane(getSite().getPage(), GraphEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer) viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane = new ViewerPane(getSite().getPage(), GraphEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer) viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane = new ViewerPane(getSite().getPage(), GraphEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer) viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String[] { "a", "b" });
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane = new ViewerPane(getSite().getPage(), GraphEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer) viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" });
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener(new ControlAdapter() {
+ boolean guard = false;
+
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part, this hides the
+ * single tab at the bottom. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder) getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part, this shows
+ * the tabs at the bottom. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ } else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ } else if (key.equals(IGotoMarker.class)) {
+ return this;
+ } else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(
+ new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
+ IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ GraphEditor.this.setSelectionToViewer(selection);
+ GraphEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other
+ * views. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection) selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the
+ // same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ } else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command
+ * stack. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model
+ * file. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running
+ // activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource))
+ && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ } catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ } catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the
+ * specified resource. The implementation uses the URI converter from the
+ * editor's resource set to try to open an input stream. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ } catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null
+ ? getActionBars().getStatusLineManager().getProgressMonitor() : new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener,
+ IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ } else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to
+ * return this editor's overall selection. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to
+ * set this editor's overall selection. Calling this result will notify the
+ * listeners. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer
+ ? contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection) selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager
+ .setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ } else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static String getString(String key) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object[] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help
+ * fill the context menus with contributions from the Edit menu. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphModelWizard.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphModelWizard.java
new file mode 100644
index 0000000..d6a4a97
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/graph/presentation/GraphModelWizard.java
@@ -0,0 +1,630 @@
+/**
+ */
+package graph.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import graph.GraphFactory;
+import graph.GraphPackage;
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphPackage graphPackage = GraphPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphFactory graphFactory = graphPackage.getGraphFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(NestedconstraintmodelEditorPlugin.INSTANCE.getImage("full/wizban/NewGraph")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : graphPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)graphPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = graphFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class GraphModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class GraphModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return NestedconstraintmodelEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new GraphModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphModelWizard_label"));
+ newFileCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphModelWizard_description"));
+ newFileCreationPage.setFileName(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new GraphModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_GraphModelWizard_label"));
+ initialObjectCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionActionBarContributor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionActionBarContributor.java
new file mode 100644
index 0000000..482f194
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionActionBarContributor.java
@@ -0,0 +1,425 @@
+/**
+ */
+package laxcondition.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the Laxcondition model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxconditionActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("laxcondition-settings"));
+ toolBarManager.add(new Separator("laxcondition-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionEditor_menu"), "laxconditionMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionEditor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionEditor.java
new file mode 100644
index 0000000..cc16087
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionEditor.java
@@ -0,0 +1,1830 @@
+/**
+ */
+package laxcondition.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import laxcondition.provider.LaxconditionItemProviderAdapterFactory;
+
+import graph.provider.GraphItemProviderAdapterFactory;
+
+import nestedcondition.provider.NestedconditionItemProviderAdapterFactory;
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a Laxcondition model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxconditionEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(LaxconditionEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(LaxconditionEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == LaxconditionEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(LaxconditionEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == LaxconditionEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(LaxconditionEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconstraintmodelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new GraphItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new LaxconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), LaxconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), LaxconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), LaxconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), LaxconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), LaxconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), LaxconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ LaxconditionEditor.this.setSelectionToViewer(selection);
+ LaxconditionEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionModelWizard.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionModelWizard.java
new file mode 100644
index 0000000..49f4fab
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/laxcondition/presentation/LaxconditionModelWizard.java
@@ -0,0 +1,630 @@
+/**
+ */
+package laxcondition.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import laxcondition.LaxconditionFactory;
+import laxcondition.LaxconditionPackage;
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxconditionModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LaxconditionPackage laxconditionPackage = LaxconditionPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LaxconditionFactory laxconditionFactory = laxconditionPackage.getLaxconditionFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LaxconditionModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LaxconditionModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(NestedconstraintmodelEditorPlugin.INSTANCE.getImage("full/wizban/NewLaxcondition")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : laxconditionPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)laxconditionPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = laxconditionFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class LaxconditionModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class LaxconditionModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return NestedconstraintmodelEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new LaxconditionModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionModelWizard_label"));
+ newFileCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionModelWizard_description"));
+ newFileCreationPage.setFileName(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new LaxconditionModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_LaxconditionModelWizard_label"));
+ initialObjectCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionActionBarContributor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionActionBarContributor.java
new file mode 100644
index 0000000..e6079b8
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionActionBarContributor.java
@@ -0,0 +1,425 @@
+/**
+ */
+package nestedcondition.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the Nestedcondition model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconditionActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("nestedcondition-settings"));
+ toolBarManager.add(new Separator("nestedcondition-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionEditor_menu"), "nestedconditionMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionEditor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionEditor.java
new file mode 100644
index 0000000..b677abb
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionEditor.java
@@ -0,0 +1,1830 @@
+/**
+ */
+package nestedcondition.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import nestedcondition.provider.NestedconditionItemProviderAdapterFactory;
+
+import graph.provider.GraphItemProviderAdapterFactory;
+
+import laxcondition.provider.LaxconditionItemProviderAdapterFactory;
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a Nestedcondition model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconditionEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(NestedconditionEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(NestedconditionEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == NestedconditionEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(NestedconditionEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == NestedconditionEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(NestedconditionEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconstraintmodelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new GraphItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new LaxconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconditionEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ NestedconditionEditor.this.setSelectionToViewer(selection);
+ NestedconditionEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionModelWizard.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionModelWizard.java
new file mode 100644
index 0000000..c12579f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedcondition/presentation/NestedconditionModelWizard.java
@@ -0,0 +1,630 @@
+/**
+ */
+package nestedcondition.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+
+import nestedconstraintmodel.presentation.NestedconstraintmodelEditorPlugin;
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconditionModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconditionPackage nestedconditionPackage = NestedconditionPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconditionFactory nestedconditionFactory = nestedconditionPackage.getNestedconditionFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconditionModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconditionModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(NestedconstraintmodelEditorPlugin.INSTANCE.getImage("full/wizban/NewNestedcondition")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : nestedconditionPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)nestedconditionPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = nestedconditionFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class NestedconditionModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class NestedconditionModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return NestedconstraintmodelEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new NestedconditionModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionModelWizard_label"));
+ newFileCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionModelWizard_description"));
+ newFileCreationPage.setFileName(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new NestedconditionModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconditionModelWizard_label"));
+ initialObjectCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelActionBarContributor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelActionBarContributor.java
new file mode 100644
index 0000000..5c50d88
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelActionBarContributor.java
@@ -0,0 +1,423 @@
+/**
+ */
+package nestedconstraintmodel.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the Nestedconstraintmodel model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconstraintmodelActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("nestedconstraintmodel-settings"));
+ toolBarManager.add(new Separator("nestedconstraintmodel-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelEditor_menu"), "nestedconstraintmodelMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelEditor.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelEditor.java
new file mode 100644
index 0000000..696c825
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelEditor.java
@@ -0,0 +1,1828 @@
+/**
+ */
+package nestedconstraintmodel.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import nestedconstraintmodel.provider.NestedconstraintmodelItemProviderAdapterFactory;
+
+import graph.provider.GraphItemProviderAdapterFactory;
+
+import laxcondition.provider.LaxconditionItemProviderAdapterFactory;
+
+import nestedcondition.provider.NestedconditionItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a Nestedconstraintmodel model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconstraintmodelEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(NestedconstraintmodelEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(NestedconstraintmodelEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == NestedconstraintmodelEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(NestedconstraintmodelEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == NestedconstraintmodelEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(NestedconstraintmodelEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconstraintmodelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NestedconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new GraphItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new LaxconditionItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "de.unimarburg.swt.ocl2ac.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconstraintmodelEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconstraintmodelEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconstraintmodelEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconstraintmodelEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconstraintmodelEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NestedconstraintmodelEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ NestedconstraintmodelEditor.this.setSelectionToViewer(selection);
+ NestedconstraintmodelEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelEditorPlugin.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelEditorPlugin.java
new file mode 100644
index 0000000..cb7d8c3
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelEditorPlugin.java
@@ -0,0 +1,91 @@
+/**
+ */
+package nestedconstraintmodel.presentation;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the Nestedconstraintmodel editor plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class NestedconstraintmodelEditorPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final NestedconstraintmodelEditorPlugin INSTANCE = new NestedconstraintmodelEditorPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelEditorPlugin() {
+ super
+ (new ResourceLocator [] {
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipseUIPlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelModelWizard.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelModelWizard.java
new file mode 100644
index 0000000..5fa36ba
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model.editor/src/nestedconstraintmodel/presentation/NestedconstraintmodelModelWizard.java
@@ -0,0 +1,628 @@
+/**
+ */
+package nestedconstraintmodel.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import nestedconstraintmodel.NestedconstraintmodelFactory;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+import nestedconstraintmodel.provider.NestedconstraintmodelEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconstraintmodelModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconstraintmodelPackage nestedconstraintmodelPackage = NestedconstraintmodelPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconstraintmodelFactory nestedconstraintmodelFactory = nestedconstraintmodelPackage.getNestedconstraintmodelFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconstraintmodelModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconstraintmodelModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(NestedconstraintmodelEditorPlugin.INSTANCE.getImage("full/wizban/NewNestedconstraintmodel")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : nestedconstraintmodelPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)nestedconstraintmodelPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = nestedconstraintmodelFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class NestedconstraintmodelModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(NestedconstraintmodelEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class NestedconstraintmodelModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return NestedconstraintmodelEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ NestedconstraintmodelEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new NestedconstraintmodelModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelModelWizard_label"));
+ newFileCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelModelWizard_description"));
+ newFileCreationPage.setFileName(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new NestedconstraintmodelModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_NestedconstraintmodelModelWizard_label"));
+ initialObjectCreationPage.setDescription(NestedconstraintmodelEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/.classpath b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/.classpath
new file mode 100644
index 0000000..eca7bdb
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/.project b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/.project
new file mode 100644
index 0000000..b3c52f8
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.unimarburg.swt.ocl2ac.model</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/META-INF/MANIFEST.MF b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..155d7d5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/META-INF/MANIFEST.MF
@@ -0,0 +1,38 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: de.unimarburg.swt.ocl2ac.model;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-Activator: de.unimarburg.swt.ocl2ac.model.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ de.unimarburg.swt.ocl2ac.model;visibility:=reexport,
+ org.eclipse.core.resources;bundle-version="3.11.1",
+ org.eclipse.emf.ecore.editor;bundle-version="2.12.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: compactconditionmodel,
+ compactconditionmodel.impl,
+ compactconditionmodel.util,
+ graph,
+ graph.impl,
+ graph.util,
+ graph.util.extensions,
+ laxcondition,
+ laxcondition.impl,
+ laxcondition.util,
+ laxcondition.util.extensions,
+ morphisms,
+ morphisms.impl,
+ morphisms.util,
+ nestedcondition,
+ nestedcondition.impl,
+ nestedcondition.util,
+ nestedcondition.util.extensions,
+ nestedconstraintmodel,
+ nestedconstraintmodel.impl,
+ nestedconstraintmodel.util
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/build.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/build.properties
new file mode 100644
index 0000000..4465407
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/CompactCondition.ecore b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/CompactCondition.ecore
new file mode 100644
index 0000000..6f81efc
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/CompactCondition.ecore
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="compactconditionmodel" nsURI="http://www.example.org/CompactConditionModel"
+ nsPrefix="compactconditionmodel">
+ <eClassifiers xsi:type="ecore:EClass" name="CompactConditionModel">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="compactconditions" upperBound="-1"
+ eType="ecore:EClass ../../de.unimarburg.swt.laxcondition/model/laxcondition.ecore#//Condition"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="typeGraph" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/graph.ecore b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/graph.ecore
new file mode 100644
index 0000000..3ba57e0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/graph.ecore
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="graph" nsURI="http://www.example.org/graph" nsPrefix="graph">
+ <eAnnotations source="http://www.eclipse.org/OCL/Import">
+ <details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="Graph">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="CorrectlyTypedNodes"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="CorrectlyTypedNodes" value="self.nodes -> forAll(node | self.typegraph.eClassifiers -> includes(node.type))"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="edges" upperBound="-1"
+ eType="#//Edge" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
+ eType="#//Node" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="typegraph" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Node">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="CorrectlyTypedAttributes"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="CorrectlyTypedAttributes" value="self.attributes -> forAll(attr | self.type.eAllAttributes -> includes(attr.type))"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
+ eType="#//Attribute" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="outgoing" upperBound="-1"
+ eType="#//Edge" eOpposite="#//Edge/source"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="incoming" upperBound="-1"
+ eType="#//Edge" eOpposite="#//Edge/target"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Edge">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="CorrectlyTypedEdgesSourceNode CorrectlyTypedEdgesTargetNode"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="CorrectlyTypedEdgesSourceNode" value="self.source.type.eAllReferences -> includes(self.type)"/>
+ <details key="CorrectlyTypedEdgesTargetNode" value="(self.target.type = self.type.eReferenceType) or (self.target.type.eAllSuperTypes -> includes(self.type.eReferenceType))"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="source" lowerBound="1"
+ eType="#//Node" eOpposite="#//Node/outgoing"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1"
+ eType="#//Node" eOpposite="#//Node/incoming"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Attribute">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="op" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EAttribute"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/laxcondition.ecore b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/laxcondition.ecore
new file mode 100644
index 0000000..0f9df76
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/laxcondition.ecore
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="laxcondition" nsURI="http://www.example.org/laxcondition" nsPrefix="laxcondition">
+ <eAnnotations source="http://www.eclipse.org/OCL/Import">
+ <details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore"/>
+ <details key="graph_0" value="graph.ecore#/"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="Condition">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="TypeGraphConsistency"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="TypeGraphConsistency" value="graph_0::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="typeGraph" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="laxCondition" lowerBound="1"
+ eType="#//LaxCondition" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="LaxCondition" abstract="true">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="formula" eType="#//Formula"
+ eOpposite="#//Formula/arguments"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="QuantifiedLaxCondition" eSuperTypes="#//LaxCondition">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="HostGraphConsistency"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="HostGraphConsistency" value="self.graph.edges -> forAll(e|self.graph.nodes -> includes(e.source) and self.graph.nodes -> includes(e.target))"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="graph" lowerBound="1" eType="ecore:EClass graph.ecore#//Graph"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="condition" lowerBound="1"
+ eType="#//LaxCondition" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="quantifier" lowerBound="1"
+ eType="#//Quantifier" defaultValueLiteral="EXISTS"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="variables" upperBound="-1"
+ eType="#//Variable" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="True" eSuperTypes="#//LaxCondition"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Formula" eSuperTypes="#//LaxCondition">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="OneArgumentForNOT AtLeastTwoArgumentForANDOR TwoArgumentForIMPLEQUALXOR"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="OneArgumentForNOT" value="(self.op = Operator::NOT) implies (self.arguments -> size() = 1)"/>
+ <details key="AtLeastTwoArgumentForANDOR" value="((self.op = Operator::AND) or (self.op = Operator::OR)) implies (self.arguments -> size() > 1)"/>
+ <details key="TwoArgumentForIMPLEQUALXOR" value="((self.op = Operator::IMPLIES) or (self.op = Operator::EQUIVALENT) or (self.op = Operator::XOR)) implies (self.arguments -> size() = 2)"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="op" lowerBound="1" eType="#//Operator"
+ defaultValueLiteral="NOT"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="arguments" lowerBound="1"
+ upperBound="-1" eType="#//LaxCondition" containment="true" eOpposite="#//LaxCondition/formula"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="Quantifier">
+ <eLiterals name="EXISTS"/>
+ <eLiterals name="FORALL" value="1"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="Operator">
+ <eLiterals name="NOT"/>
+ <eLiterals name="AND" value="1"/>
+ <eLiterals name="OR" value="2"/>
+ <eLiterals name="IMPLIES" value="3"/>
+ <eLiterals name="EQUIVALENT" value="4"/>
+ <eLiterals name="XOR" value="5"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Variable">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/morphisms.ecore b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/morphisms.ecore
new file mode 100644
index 0000000..fcce3a1
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/morphisms.ecore
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="morphisms" nsURI="http://www.example.org/morphisms" nsPrefix="morphisms">
+ <eAnnotations source="http://www.eclipse.org/OCL/Import">
+ <details key="graph" value="graph.ecore#/"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="Morphism">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="domain" eType="ecore:EClass graph.ecore#//Graph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="codomain" eType="ecore:EClass graph.ecore#//Graph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="mappings" upperBound="-1"
+ eType="#//Mapping" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Mapping">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="origin" lowerBound="1"
+ eType="ecore:EClass graph.ecore#//Node"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="image" lowerBound="1" eType="ecore:EClass graph.ecore#//Node"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Pair">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="a" lowerBound="1" eType="#//Morphism"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="b" lowerBound="1" eType="#//Morphism"
+ containment="true"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/morphisms.genmodel b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/morphisms.genmodel
new file mode 100644
index 0000000..f0b5b65
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/morphisms.genmodel
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/de.unimarburg.swt.ocl2ac.model/src" modelPluginID="de.unimarburg.swt.ocl2ac.model"
+ modelName="Morphisms" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
+ usedGenPackages="nestedconstraintmodel.genmodel#//graph" operationReflection="true"
+ importOrganizing="true">
+ <foreignModel>morphisms.ecore</foreignModel>
+ <genPackages prefix="Morphisms" disposableProviderFactory="true" ecorePackage="morphisms.ecore#/">
+ <genClasses ecoreClass="morphisms.ecore#//Morphism">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference morphisms.ecore#//Morphism/domain"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference morphisms.ecore#//Morphism/codomain"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference morphisms.ecore#//Morphism/mappings"/>
+ </genClasses>
+ <genClasses ecoreClass="morphisms.ecore#//Mapping">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference morphisms.ecore#//Mapping/origin"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference morphisms.ecore#//Mapping/image"/>
+ </genClasses>
+ <genClasses ecoreClass="morphisms.ecore#//Pair">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference morphisms.ecore#//Pair/a"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference morphisms.ecore#//Pair/b"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedcondition.ecore b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedcondition.ecore
new file mode 100644
index 0000000..135002f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedcondition.ecore
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="nestedcondition" nsURI="http://www.example.org/nestedcondition"
+ nsPrefix="nestedcondition">
+ <eAnnotations source="http://www.eclipse.org/OCL/Import">
+ <details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore#/"/>
+ <details key="graph" value="graph.ecore#/"/>
+ <details key="laxcondition" value="laxcondition.ecore#/"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="NestedConstraint">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="ConstraintDomainIsEmpty RootConditionDomainIsConatraintDomain TypeGraphConsistency HostGraphConsistency"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="ConstraintDomainIsEmpty" value="self.domain.nodes -> isEmpty() and self.domain.edges -> isEmpty()"/>
+ <details key="RootConditionDomainIsConatraintDomain" value="self.condition.domain = self.domain"/>
+ <details key="TypeGraphConsistency" value="graph::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)"/>
+ <details key="HostGraphConsistency" value="graph::Graph.allInstances() -> forAll(g|g.edges -> forAll(e|g.nodes -> includes(e.source) and g.nodes -> includes(e.target)))"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="typeGraph" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="condition" lowerBound="1"
+ eType="#//NestedCondition" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="domain" lowerBound="1"
+ eType="ecore:EClass graph.ecore#//Graph" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NestedCondition" abstract="true">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="variables" upperBound="-1"
+ eType="#//Variable" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="domain" lowerBound="1"
+ eType="ecore:EClass graph.ecore#//Graph"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Variable">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="QuantifiedCondition" eSuperTypes="#//NestedCondition">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="NestedDomainIsCoDomain MorphismIsFromDomainToCoDomain"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="NestedDomainIsCoDomain" value="self.condition.domain = self.codomain"/>
+ <details key="MorphismIsFromDomainToCoDomain" value="self.morphism.from = self.domain and self.morphism.to = self.codomain"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="quantifier" eType="ecore:EEnum laxcondition.ecore#//Quantifier"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="condition" lowerBound="1"
+ eType="#//NestedCondition" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="morphism" lowerBound="1"
+ eType="#//Morphism" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="codomain" lowerBound="1"
+ eType="ecore:EClass graph.ecore#//Graph" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="True" eSuperTypes="#//NestedCondition"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Formula" eSuperTypes="#//NestedCondition">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="ArgumentsDomainConsistency OneArgumentForNOT AtLeastTwoArgumentForANDOR TwoArgumentForIMPLEQUALXOR"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="ArgumentsDomainConsistency" value="self.arguments -> forAll(cond|cond.domain = self.domain)"/>
+ <details key="OneArgumentForNOT" value="(self.operator = laxcondition::Operator::NOT) implies (self.arguments -> size() = 1)"/>
+ <details key="AtLeastTwoArgumentForANDOR" value="((self.operator = laxcondition::Operator::AND) or (self.operator = laxcondition::Operator::OR)) implies (self.arguments -> size() > 1)"/>
+ <details key="TwoArgumentForIMPLEQUALXOR" value="((self.operator = laxcondition::Operator::IMPLIES) or (self.operator = laxcondition::Operator::EQUIVALENT) or (self.operator = laxcondition::Operator::XOR)) implies (self.arguments -> size() = 2)"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="operator" eType="ecore:EEnum laxcondition.ecore#//Operator"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="arguments" lowerBound="1"
+ upperBound="-1" eType="#//NestedCondition" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Morphism">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="constraints" value="NodeMappingIsFromDomainToCoDomain EdgeMappingIsFromDomainToCoDomain EdgeMappingConsistency"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
+ <details key="NodeMappingIsFromDomainToCoDomain" value="self.nodeMappings -> forAll(m|self.from.nodes -> includes(m.origin) and self.to.nodes -> includes(m.image))"/>
+ <details key="EdgeMappingIsFromDomainToCoDomain" value="self.edgeMappings -> forAll(m|self.from.edges -> includes(m.origin) and self.to.edges -> includes(m.image))"/>
+ <details key="EdgeMappingConsistency" value="self.edgeMappings -> forAll(em|self.nodeMappings -> exists(nm|nm.origin = em.origin.source and nm.image = em.image.source) and self.nodeMappings -> exists(nm|nm.origin = em.origin.target and nm.image = em.image.target))"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="nodeMappings" upperBound="-1"
+ eType="#//NodeMapping" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass graph.ecore#//Graph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="ecore:EClass graph.ecore#//Graph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="edgeMappings" upperBound="-1"
+ eType="#//EdgeMapping" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeMapping">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="origin" lowerBound="1"
+ eType="ecore:EClass graph.ecore#//Node"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="image" lowerBound="1" eType="ecore:EClass graph.ecore#//Node"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="EdgeMapping">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="origin" lowerBound="1"
+ eType="ecore:EClass graph.ecore#//Edge"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="image" lowerBound="1" eType="ecore:EClass graph.ecore#//Edge"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedconstraintmodel.ecore b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedconstraintmodel.ecore
new file mode 100644
index 0000000..6379365
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedconstraintmodel.ecore
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="nestedconstraintmodel" nsURI="http://www.example.org/nestedconstraintmodel"
+ nsPrefix="nestedconstraintmodel">
+ <eClassifiers xsi:type="ecore:EClass" name="NestedConstraintModel">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="nestedconstrainmodels"
+ upperBound="-1" eType="ecore:EClass nestedcondition.ecore#//NestedConstraint"
+ containment="true"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedconstraintmodel.genmodel b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedconstraintmodel.genmodel
new file mode 100644
index 0000000..902eb1f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/model/nestedconstraintmodel.genmodel
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/de.unimarburg.swt.ocl2ac.model/src" modelPluginID="de.unimarburg.swt.ocl2ac.model"
+ modelName="Nestedconstraintmodel" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>nestedconstraintmodel.ecore</foreignModel>
+ <genPackages prefix="Nestedconstraintmodel" disposableProviderFactory="true" ecorePackage="nestedconstraintmodel.ecore#/">
+ <genClasses ecoreClass="nestedconstraintmodel.ecore#//NestedConstraintModel">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute nestedconstraintmodel.ecore#//NestedConstraintModel/name"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedconstraintmodel.ecore#//NestedConstraintModel/nestedconstrainmodels"/>
+ </genClasses>
+ </genPackages>
+ <genPackages prefix="Nestedcondition" disposableProviderFactory="true" ecorePackage="nestedcondition.ecore#/">
+ <genClasses ecoreClass="nestedcondition.ecore#//NestedConstraint">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute nestedcondition.ecore#//NestedConstraint/name"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NestedConstraint/typeGraph"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NestedConstraint/condition"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NestedConstraint/domain"/>
+ </genClasses>
+ <genClasses image="false" ecoreClass="nestedcondition.ecore#//NestedCondition">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NestedCondition/variables"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NestedCondition/domain"/>
+ </genClasses>
+ <genClasses ecoreClass="nestedcondition.ecore#//Variable">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute nestedcondition.ecore#//Variable/name"/>
+ </genClasses>
+ <genClasses ecoreClass="nestedcondition.ecore#//QuantifiedCondition">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute nestedcondition.ecore#//QuantifiedCondition/quantifier"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//QuantifiedCondition/condition"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//QuantifiedCondition/morphism"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//QuantifiedCondition/codomain"/>
+ </genClasses>
+ <genClasses ecoreClass="nestedcondition.ecore#//True"/>
+ <genClasses ecoreClass="nestedcondition.ecore#//Formula">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute nestedcondition.ecore#//Formula/operator"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//Formula/arguments"/>
+ </genClasses>
+ <genClasses ecoreClass="nestedcondition.ecore#//Morphism">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//Morphism/nodeMappings"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//Morphism/from"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//Morphism/to"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//Morphism/edgeMappings"/>
+ </genClasses>
+ <genClasses ecoreClass="nestedcondition.ecore#//NodeMapping">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NodeMapping/origin"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//NodeMapping/image"/>
+ </genClasses>
+ <genClasses ecoreClass="nestedcondition.ecore#//EdgeMapping">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//EdgeMapping/origin"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nestedcondition.ecore#//EdgeMapping/image"/>
+ </genClasses>
+ </genPackages>
+ <genPackages prefix="Graph" disposableProviderFactory="true" ecorePackage="graph.ecore#/">
+ <genClasses ecoreClass="graph.ecore#//Graph">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference graph.ecore#//Graph/edges"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference graph.ecore#//Graph/nodes"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Graph/typegraph"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute graph.ecore#//Graph/name"/>
+ </genClasses>
+ <genClasses ecoreClass="graph.ecore#//Node">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference graph.ecore#//Node/attributes"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Node/outgoing"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute graph.ecore#//Node/name"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Node/incoming"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Node/type"/>
+ </genClasses>
+ <genClasses ecoreClass="graph.ecore#//Edge">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Edge/source"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Edge/target"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Edge/type"/>
+ </genClasses>
+ <genClasses ecoreClass="graph.ecore#//Attribute">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute graph.ecore#//Attribute/op"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute graph.ecore#//Attribute/value"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference graph.ecore#//Attribute/type"/>
+ </genClasses>
+ </genPackages>
+ <genPackages prefix="Laxcondition" disposableProviderFactory="true" ecorePackage="laxcondition.ecore#/">
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="laxcondition.ecore#//Quantifier">
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Quantifier/EXISTS"/>
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Quantifier/FORALL"/>
+ </genEnums>
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="laxcondition.ecore#//Operator">
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Operator/NOT"/>
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Operator/AND"/>
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Operator/OR"/>
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Operator/IMPLIES"/>
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Operator/EQUIVALENT"/>
+ <genEnumLiterals ecoreEnumLiteral="laxcondition.ecore#//Operator/XOR"/>
+ </genEnums>
+ <genClasses ecoreClass="laxcondition.ecore#//Condition">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference laxcondition.ecore#//Condition/typeGraph"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute laxcondition.ecore#//Condition/name"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference laxcondition.ecore#//Condition/laxCondition"/>
+ </genClasses>
+ <genClasses image="false" ecoreClass="laxcondition.ecore#//LaxCondition">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference laxcondition.ecore#//LaxCondition/formula"/>
+ </genClasses>
+ <genClasses ecoreClass="laxcondition.ecore#//QuantifiedLaxCondition">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference laxcondition.ecore#//QuantifiedLaxCondition/graph"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference laxcondition.ecore#//QuantifiedLaxCondition/condition"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute laxcondition.ecore#//QuantifiedLaxCondition/quantifier"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference laxcondition.ecore#//QuantifiedLaxCondition/variables"/>
+ </genClasses>
+ <genClasses ecoreClass="laxcondition.ecore#//True"/>
+ <genClasses ecoreClass="laxcondition.ecore#//Formula">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute laxcondition.ecore#//Formula/op"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference laxcondition.ecore#//Formula/arguments"/>
+ </genClasses>
+ <genClasses ecoreClass="laxcondition.ecore#//Variable">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute laxcondition.ecore#//Variable/name"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/plugin.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/plugin.properties
new file mode 100644
index 0000000..6ecc597
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = CompactCondition Model
+providerName = www.example.org
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/plugin.xml b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/plugin.xml
new file mode 100644
index 0000000..18decee
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/plugin.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated CompactCondition -->
+ <package
+ uri="http://www.example.org/CompactConditionModel"
+ class="compactconditionmodel.CompactconditionmodelPackage"
+ genModel="model/CompactCondition.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated nestedconstraintmodel -->
+ <package
+ uri="http://www.example.org/nestedconstraintmodel"
+ class="nestedconstraintmodel.NestedconstraintmodelPackage"
+ genModel="model/nestedconstraintmodel.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated nestedconstraintmodel -->
+ <package
+ uri="http://www.example.org/nestedcondition"
+ class="nestedcondition.NestedconditionPackage"
+ genModel="model/nestedconstraintmodel.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated nestedconstraintmodel -->
+ <package
+ uri="http://www.example.org/graph"
+ class="graph.GraphPackage"
+ genModel="model/nestedconstraintmodel.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated nestedconstraintmodel -->
+ <package
+ uri="http://www.example.org/laxcondition"
+ class="laxcondition.LaxconditionPackage"
+ genModel="model/nestedconstraintmodel.genmodel"/>
+ </extension>
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated morphisms -->
+ <package
+ uri="http://www.example.org/morphisms"
+ class="morphisms.MorphismsPackage"
+ genModel="model/morphisms.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactConditionModel.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactConditionModel.java
new file mode 100644
index 0000000..40c550a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactConditionModel.java
@@ -0,0 +1,99 @@
+/**
+ */
+package compactconditionmodel;
+
+import laxcondition.Condition;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Compact Condition Model</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link compactconditionmodel.CompactConditionModel#getName <em>Name</em>}</li>
+ * <li>{@link compactconditionmodel.CompactConditionModel#getCompactconditions <em>Compactconditions</em>}</li>
+ * <li>{@link compactconditionmodel.CompactConditionModel#getTypeGraph <em>Type Graph</em>}</li>
+ * </ul>
+ *
+ * @see compactconditionmodel.CompactconditionmodelPackage#getCompactConditionModel()
+ * @model
+ * @generated
+ */
+public interface CompactConditionModel extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see compactconditionmodel.CompactconditionmodelPackage#getCompactConditionModel_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link compactconditionmodel.CompactConditionModel#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Compactconditions</b></em>' containment reference list.
+ * The list contents are of type {@link laxcondition.Condition}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Compactconditions</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Compactconditions</em>' containment reference list.
+ * @see compactconditionmodel.CompactconditionmodelPackage#getCompactConditionModel_Compactconditions()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Condition> getCompactconditions();
+
+ /**
+ * Returns the value of the '<em><b>Type Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Graph</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Graph</em>' reference.
+ * @see #setTypeGraph(EPackage)
+ * @see compactconditionmodel.CompactconditionmodelPackage#getCompactConditionModel_TypeGraph()
+ * @model required="true"
+ * @generated
+ */
+ EPackage getTypeGraph();
+
+ /**
+ * Sets the value of the '{@link compactconditionmodel.CompactConditionModel#getTypeGraph <em>Type Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type Graph</em>' reference.
+ * @see #getTypeGraph()
+ * @generated
+ */
+ void setTypeGraph(EPackage value);
+
+} // CompactConditionModel
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactconditionmodelFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactconditionmodelFactory.java
new file mode 100644
index 0000000..cb13b8e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactconditionmodelFactory.java
@@ -0,0 +1,42 @@
+/**
+ */
+package compactconditionmodel;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see compactconditionmodel.CompactconditionmodelPackage
+ * @generated
+ */
+public interface CompactconditionmodelFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ CompactconditionmodelFactory eINSTANCE = compactconditionmodel.impl.CompactconditionmodelFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Compact Condition Model</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Compact Condition Model</em>'.
+ * @generated
+ */
+ CompactConditionModel createCompactConditionModel();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ CompactconditionmodelPackage getCompactconditionmodelPackage();
+
+} //CompactconditionmodelFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactconditionmodelPackage.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactconditionmodelPackage.java
new file mode 100644
index 0000000..5abc209
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/CompactconditionmodelPackage.java
@@ -0,0 +1,217 @@
+/**
+ */
+package compactconditionmodel;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see compactconditionmodel.CompactconditionmodelFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface CompactconditionmodelPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "compactconditionmodel";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.example.org/CompactConditionModel";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "compactconditionmodel";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ CompactconditionmodelPackage eINSTANCE = compactconditionmodel.impl.CompactconditionmodelPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link compactconditionmodel.impl.CompactConditionModelImpl <em>Compact Condition Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see compactconditionmodel.impl.CompactConditionModelImpl
+ * @see compactconditionmodel.impl.CompactconditionmodelPackageImpl#getCompactConditionModel()
+ * @generated
+ */
+ int COMPACT_CONDITION_MODEL = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPACT_CONDITION_MODEL__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Compactconditions</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPACT_CONDITION_MODEL__COMPACTCONDITIONS = 1;
+
+ /**
+ * The feature id for the '<em><b>Type Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPACT_CONDITION_MODEL__TYPE_GRAPH = 2;
+
+ /**
+ * The number of structural features of the '<em>Compact Condition Model</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPACT_CONDITION_MODEL_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>Compact Condition Model</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPACT_CONDITION_MODEL_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link compactconditionmodel.CompactConditionModel <em>Compact Condition Model</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Compact Condition Model</em>'.
+ * @see compactconditionmodel.CompactConditionModel
+ * @generated
+ */
+ EClass getCompactConditionModel();
+
+ /**
+ * Returns the meta object for the attribute '{@link compactconditionmodel.CompactConditionModel#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see compactconditionmodel.CompactConditionModel#getName()
+ * @see #getCompactConditionModel()
+ * @generated
+ */
+ EAttribute getCompactConditionModel_Name();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link compactconditionmodel.CompactConditionModel#getCompactconditions <em>Compactconditions</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Compactconditions</em>'.
+ * @see compactconditionmodel.CompactConditionModel#getCompactconditions()
+ * @see #getCompactConditionModel()
+ * @generated
+ */
+ EReference getCompactConditionModel_Compactconditions();
+
+ /**
+ * Returns the meta object for the reference '{@link compactconditionmodel.CompactConditionModel#getTypeGraph <em>Type Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Type Graph</em>'.
+ * @see compactconditionmodel.CompactConditionModel#getTypeGraph()
+ * @see #getCompactConditionModel()
+ * @generated
+ */
+ EReference getCompactConditionModel_TypeGraph();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ CompactconditionmodelFactory getCompactconditionmodelFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link compactconditionmodel.impl.CompactConditionModelImpl <em>Compact Condition Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see compactconditionmodel.impl.CompactConditionModelImpl
+ * @see compactconditionmodel.impl.CompactconditionmodelPackageImpl#getCompactConditionModel()
+ * @generated
+ */
+ EClass COMPACT_CONDITION_MODEL = eINSTANCE.getCompactConditionModel();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute COMPACT_CONDITION_MODEL__NAME = eINSTANCE.getCompactConditionModel_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Compactconditions</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference COMPACT_CONDITION_MODEL__COMPACTCONDITIONS = eINSTANCE.getCompactConditionModel_Compactconditions();
+
+ /**
+ * The meta object literal for the '<em><b>Type Graph</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference COMPACT_CONDITION_MODEL__TYPE_GRAPH = eINSTANCE.getCompactConditionModel_TypeGraph();
+
+ }
+
+} //CompactconditionmodelPackage
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactConditionModelImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactConditionModelImpl.java
new file mode 100644
index 0000000..88e8704
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactConditionModelImpl.java
@@ -0,0 +1,284 @@
+/**
+ */
+package compactconditionmodel.impl;
+
+import compactconditionmodel.CompactConditionModel;
+import compactconditionmodel.CompactconditionmodelPackage;
+
+import java.util.Collection;
+
+import laxcondition.Condition;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Compact Condition Model</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link compactconditionmodel.impl.CompactConditionModelImpl#getName <em>Name</em>}</li>
+ * <li>{@link compactconditionmodel.impl.CompactConditionModelImpl#getCompactconditions <em>Compactconditions</em>}</li>
+ * <li>{@link compactconditionmodel.impl.CompactConditionModelImpl#getTypeGraph <em>Type Graph</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class CompactConditionModelImpl extends MinimalEObjectImpl.Container implements CompactConditionModel {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getCompactconditions() <em>Compactconditions</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompactconditions()
+ * @generated
+ * @ordered
+ */
+ protected EList<Condition> compactconditions;
+
+ /**
+ * The cached value of the '{@link #getTypeGraph() <em>Type Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeGraph()
+ * @generated
+ * @ordered
+ */
+ protected EPackage typeGraph;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CompactConditionModelImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return CompactconditionmodelPackage.Literals.COMPACT_CONDITION_MODEL;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Condition> getCompactconditions() {
+ if (compactconditions == null) {
+ compactconditions = new EObjectContainmentEList<Condition>(Condition.class, this, CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__COMPACTCONDITIONS);
+ }
+ return compactconditions;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage getTypeGraph() {
+ if (typeGraph != null && typeGraph.eIsProxy()) {
+ InternalEObject oldTypeGraph = (InternalEObject)typeGraph;
+ typeGraph = (EPackage)eResolveProxy(oldTypeGraph);
+ if (typeGraph != oldTypeGraph) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__TYPE_GRAPH, oldTypeGraph, typeGraph));
+ }
+ }
+ return typeGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage basicGetTypeGraph() {
+ return typeGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTypeGraph(EPackage newTypeGraph) {
+ EPackage oldTypeGraph = typeGraph;
+ typeGraph = newTypeGraph;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__TYPE_GRAPH, oldTypeGraph, typeGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__COMPACTCONDITIONS:
+ return ((InternalEList<?>)getCompactconditions()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__NAME:
+ return getName();
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__COMPACTCONDITIONS:
+ return getCompactconditions();
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__TYPE_GRAPH:
+ if (resolve) return getTypeGraph();
+ return basicGetTypeGraph();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__NAME:
+ setName((String)newValue);
+ return;
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__COMPACTCONDITIONS:
+ getCompactconditions().clear();
+ getCompactconditions().addAll((Collection<? extends Condition>)newValue);
+ return;
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__TYPE_GRAPH:
+ setTypeGraph((EPackage)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__COMPACTCONDITIONS:
+ getCompactconditions().clear();
+ return;
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__TYPE_GRAPH:
+ setTypeGraph((EPackage)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__COMPACTCONDITIONS:
+ return compactconditions != null && !compactconditions.isEmpty();
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL__TYPE_GRAPH:
+ return typeGraph != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //CompactConditionModelImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactconditionmodelFactoryImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactconditionmodelFactoryImpl.java
new file mode 100644
index 0000000..42d7032
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactconditionmodelFactoryImpl.java
@@ -0,0 +1,95 @@
+/**
+ */
+package compactconditionmodel.impl;
+
+import compactconditionmodel.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CompactconditionmodelFactoryImpl extends EFactoryImpl implements CompactconditionmodelFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static CompactconditionmodelFactory init() {
+ try {
+ CompactconditionmodelFactory theCompactconditionmodelFactory = (CompactconditionmodelFactory)EPackage.Registry.INSTANCE.getEFactory(CompactconditionmodelPackage.eNS_URI);
+ if (theCompactconditionmodelFactory != null) {
+ return theCompactconditionmodelFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new CompactconditionmodelFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CompactconditionmodelFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL: return createCompactConditionModel();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CompactConditionModel createCompactConditionModel() {
+ CompactConditionModelImpl compactConditionModel = new CompactConditionModelImpl();
+ return compactConditionModel;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CompactconditionmodelPackage getCompactconditionmodelPackage() {
+ return (CompactconditionmodelPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static CompactconditionmodelPackage getPackage() {
+ return CompactconditionmodelPackage.eINSTANCE;
+ }
+
+} //CompactconditionmodelFactoryImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactconditionmodelPackageImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactconditionmodelPackageImpl.java
new file mode 100644
index 0000000..60e9c88
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/impl/CompactconditionmodelPackageImpl.java
@@ -0,0 +1,208 @@
+/**
+ */
+package compactconditionmodel.impl;
+
+import compactconditionmodel.CompactConditionModel;
+import compactconditionmodel.CompactconditionmodelFactory;
+import compactconditionmodel.CompactconditionmodelPackage;
+
+import laxcondition.LaxconditionPackage;
+
+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 CompactconditionmodelPackageImpl extends EPackageImpl implements CompactconditionmodelPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass compactConditionModelEClass = 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 compactconditionmodel.CompactconditionmodelPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private CompactconditionmodelPackageImpl() {
+ super(eNS_URI, CompactconditionmodelFactory.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 CompactconditionmodelPackage#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 CompactconditionmodelPackage init() {
+ if (isInited) return (CompactconditionmodelPackage)EPackage.Registry.INSTANCE.getEPackage(CompactconditionmodelPackage.eNS_URI);
+
+ // Obtain or create and register package
+ CompactconditionmodelPackageImpl theCompactconditionmodelPackage = (CompactconditionmodelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CompactconditionmodelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CompactconditionmodelPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ LaxconditionPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theCompactconditionmodelPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theCompactconditionmodelPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theCompactconditionmodelPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(CompactconditionmodelPackage.eNS_URI, theCompactconditionmodelPackage);
+ return theCompactconditionmodelPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getCompactConditionModel() {
+ return compactConditionModelEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCompactConditionModel_Name() {
+ return (EAttribute)compactConditionModelEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCompactConditionModel_Compactconditions() {
+ return (EReference)compactConditionModelEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCompactConditionModel_TypeGraph() {
+ return (EReference)compactConditionModelEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CompactconditionmodelFactory getCompactconditionmodelFactory() {
+ return (CompactconditionmodelFactory)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
+ compactConditionModelEClass = createEClass(COMPACT_CONDITION_MODEL);
+ createEAttribute(compactConditionModelEClass, COMPACT_CONDITION_MODEL__NAME);
+ createEReference(compactConditionModelEClass, COMPACT_CONDITION_MODEL__COMPACTCONDITIONS);
+ createEReference(compactConditionModelEClass, COMPACT_CONDITION_MODEL__TYPE_GRAPH);
+ }
+
+ /**
+ * <!-- 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
+ LaxconditionPackage theLaxconditionPackage = (LaxconditionPackage)EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(compactConditionModelEClass, CompactConditionModel.class, "CompactConditionModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getCompactConditionModel_Name(), ecorePackage.getEString(), "name", null, 0, 1, CompactConditionModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCompactConditionModel_Compactconditions(), theLaxconditionPackage.getCondition(), null, "compactconditions", null, 0, -1, CompactConditionModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCompactConditionModel_TypeGraph(), ecorePackage.getEPackage(), null, "typeGraph", null, 1, 1, CompactConditionModel.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);
+ }
+
+} //CompactconditionmodelPackageImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/util/CompactconditionmodelAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/util/CompactconditionmodelAdapterFactory.java
new file mode 100644
index 0000000..373b3d5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/util/CompactconditionmodelAdapterFactory.java
@@ -0,0 +1,120 @@
+/**
+ */
+package compactconditionmodel.util;
+
+import compactconditionmodel.*;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see compactconditionmodel.CompactconditionmodelPackage
+ * @generated
+ */
+public class CompactconditionmodelAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static CompactconditionmodelPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CompactconditionmodelAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = CompactconditionmodelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CompactconditionmodelSwitch<Adapter> modelSwitch =
+ new CompactconditionmodelSwitch<Adapter>() {
+ @Override
+ public Adapter caseCompactConditionModel(CompactConditionModel object) {
+ return createCompactConditionModelAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link compactconditionmodel.CompactConditionModel <em>Compact Condition Model</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see compactconditionmodel.CompactConditionModel
+ * @generated
+ */
+ public Adapter createCompactConditionModelAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //CompactconditionmodelAdapterFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/util/CompactconditionmodelSwitch.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/util/CompactconditionmodelSwitch.java
new file mode 100644
index 0000000..38b6a3e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/compactconditionmodel/util/CompactconditionmodelSwitch.java
@@ -0,0 +1,110 @@
+/**
+ */
+package compactconditionmodel.util;
+
+import compactconditionmodel.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see compactconditionmodel.CompactconditionmodelPackage
+ * @generated
+ */
+public class CompactconditionmodelSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static CompactconditionmodelPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CompactconditionmodelSwitch() {
+ if (modelPackage == null) {
+ modelPackage = CompactconditionmodelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case CompactconditionmodelPackage.COMPACT_CONDITION_MODEL: {
+ CompactConditionModel compactConditionModel = (CompactConditionModel)theEObject;
+ T result = caseCompactConditionModel(compactConditionModel);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Compact Condition Model</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Compact Condition Model</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseCompactConditionModel(CompactConditionModel object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //CompactconditionmodelSwitch
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/de/unimarburg/swt/ocl2ac/model/Activator.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/de/unimarburg/swt/ocl2ac/model/Activator.java
new file mode 100644
index 0000000..217c124
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/de/unimarburg/swt/ocl2ac/model/Activator.java
@@ -0,0 +1,50 @@
+package de.unimarburg.swt.ocl2ac.model;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "de.unimarburg.swt.ocl2ac.model"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Attribute.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Attribute.java
new file mode 100644
index 0000000..c729ab0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Attribute.java
@@ -0,0 +1,105 @@
+/**
+ */
+package graph;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link graph.Attribute#getOp <em>Op</em>}</li>
+ * <li>{@link graph.Attribute#getValue <em>Value</em>}</li>
+ * <li>{@link graph.Attribute#getType <em>Type</em>}</li>
+ * </ul>
+ *
+ * @see graph.GraphPackage#getAttribute()
+ * @model
+ * @generated
+ */
+public interface Attribute extends EObject {
+ /**
+ * Returns the value of the '<em><b>Op</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Op</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Op</em>' attribute.
+ * @see #setOp(String)
+ * @see graph.GraphPackage#getAttribute_Op()
+ * @model
+ * @generated
+ */
+ String getOp();
+
+ /**
+ * Sets the value of the '{@link graph.Attribute#getOp <em>Op</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Op</em>' attribute.
+ * @see #getOp()
+ * @generated
+ */
+ void setOp(String value);
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Value</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Value</em>' attribute.
+ * @see #setValue(String)
+ * @see graph.GraphPackage#getAttribute_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link graph.Attribute#getValue <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Value</em>' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' reference.
+ * @see #setType(EAttribute)
+ * @see graph.GraphPackage#getAttribute_Type()
+ * @model required="true"
+ * @generated
+ */
+ EAttribute getType();
+
+ /**
+ * Sets the value of the '{@link graph.Attribute#getType <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' reference.
+ * @see #getType()
+ * @generated
+ */
+ void setType(EAttribute value);
+
+} // Attribute
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Edge.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Edge.java
new file mode 100644
index 0000000..7f74b84
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Edge.java
@@ -0,0 +1,110 @@
+/**
+ */
+package graph;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Edge</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link graph.Edge#getSource <em>Source</em>}</li>
+ * <li>{@link graph.Edge#getTarget <em>Target</em>}</li>
+ * <li>{@link graph.Edge#getType <em>Type</em>}</li>
+ * </ul>
+ *
+ * @see graph.GraphPackage#getEdge()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='CorrectlyTypedEdgesSourceNode CorrectlyTypedEdgesTargetNode'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot CorrectlyTypedEdgesSourceNode='self.source.type.eAllReferences -> includes(self.type)' CorrectlyTypedEdgesTargetNode='(self.target.type = self.type.eReferenceType) or (self.target.type.eAllSuperTypes -> includes(self.type.eReferenceType))'"
+ * @generated
+ */
+public interface Edge extends EObject {
+ /**
+ * Returns the value of the '<em><b>Source</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link graph.Node#getOutgoing <em>Outgoing</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Source</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Source</em>' reference.
+ * @see #setSource(Node)
+ * @see graph.GraphPackage#getEdge_Source()
+ * @see graph.Node#getOutgoing
+ * @model opposite="outgoing" required="true"
+ * @generated
+ */
+ Node getSource();
+
+ /**
+ * Sets the value of the '{@link graph.Edge#getSource <em>Source</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Source</em>' reference.
+ * @see #getSource()
+ * @generated
+ */
+ void setSource(Node value);
+
+ /**
+ * Returns the value of the '<em><b>Target</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link graph.Node#getIncoming <em>Incoming</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Target</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Target</em>' reference.
+ * @see #setTarget(Node)
+ * @see graph.GraphPackage#getEdge_Target()
+ * @see graph.Node#getIncoming
+ * @model opposite="incoming" required="true"
+ * @generated
+ */
+ Node getTarget();
+
+ /**
+ * Sets the value of the '{@link graph.Edge#getTarget <em>Target</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Target</em>' reference.
+ * @see #getTarget()
+ * @generated
+ */
+ void setTarget(Node value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' reference.
+ * @see #setType(EReference)
+ * @see graph.GraphPackage#getEdge_Type()
+ * @model required="true"
+ * @generated
+ */
+ EReference getType();
+
+ /**
+ * Sets the value of the '{@link graph.Edge#getType <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' reference.
+ * @see #getType()
+ * @generated
+ */
+ void setType(EReference value);
+
+} // Edge
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Graph.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Graph.java
new file mode 100644
index 0000000..2c3e84c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Graph.java
@@ -0,0 +1,115 @@
+/**
+ */
+package graph;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Graph</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link graph.Graph#getEdges <em>Edges</em>}</li>
+ * <li>{@link graph.Graph#getNodes <em>Nodes</em>}</li>
+ * <li>{@link graph.Graph#getTypegraph <em>Typegraph</em>}</li>
+ * <li>{@link graph.Graph#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @see graph.GraphPackage#getGraph()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='CorrectlyTypedNodes'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot CorrectlyTypedNodes='self.nodes -> forAll(node | self.typegraph.eClassifiers -> includes(node.type))'"
+ * @generated
+ */
+public interface Graph extends EObject {
+ /**
+ * Returns the value of the '<em><b>Edges</b></em>' containment reference list.
+ * The list contents are of type {@link graph.Edge}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Edges</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Edges</em>' containment reference list.
+ * @see graph.GraphPackage#getGraph_Edges()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Edge> getEdges();
+
+ /**
+ * Returns the value of the '<em><b>Nodes</b></em>' containment reference list.
+ * The list contents are of type {@link graph.Node}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Nodes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Nodes</em>' containment reference list.
+ * @see graph.GraphPackage#getGraph_Nodes()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Node> getNodes();
+
+ /**
+ * Returns the value of the '<em><b>Typegraph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Typegraph</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Typegraph</em>' reference.
+ * @see #setTypegraph(EPackage)
+ * @see graph.GraphPackage#getGraph_Typegraph()
+ * @model required="true"
+ * @generated
+ */
+ EPackage getTypegraph();
+
+ /**
+ * Sets the value of the '{@link graph.Graph#getTypegraph <em>Typegraph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Typegraph</em>' reference.
+ * @see #getTypegraph()
+ * @generated
+ */
+ void setTypegraph(EPackage value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see graph.GraphPackage#getGraph_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link graph.Graph#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // Graph
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/GraphFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/GraphFactory.java
new file mode 100644
index 0000000..4f1affc
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/GraphFactory.java
@@ -0,0 +1,69 @@
+/**
+ */
+package graph;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see graph.GraphPackage
+ * @generated
+ */
+public interface GraphFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ GraphFactory eINSTANCE = graph.impl.GraphFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Graph</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Graph</em>'.
+ * @generated
+ */
+ Graph createGraph();
+
+ /**
+ * Returns a new object of class '<em>Node</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Node</em>'.
+ * @generated
+ */
+ Node createNode();
+
+ /**
+ * Returns a new object of class '<em>Edge</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Edge</em>'.
+ * @generated
+ */
+ Edge createEdge();
+
+ /**
+ * Returns a new object of class '<em>Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Attribute</em>'.
+ * @generated
+ */
+ Attribute createAttribute();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ GraphPackage getGraphPackage();
+
+} //GraphFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/GraphPackage.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/GraphPackage.java
new file mode 100644
index 0000000..d248b79
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/GraphPackage.java
@@ -0,0 +1,699 @@
+/**
+ */
+package graph;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see graph.GraphFactory
+ * @model kind="package"
+ * annotation="http://www.eclipse.org/OCL/Import ecore='http://www.eclipse.org/emf/2002/Ecore'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore invocationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' settingDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' validationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot'"
+ * @generated
+ */
+public interface GraphPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "graph";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.example.org/graph";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "graph";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ GraphPackage eINSTANCE = graph.impl.GraphPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link graph.impl.GraphImpl <em>Graph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.GraphImpl
+ * @see graph.impl.GraphPackageImpl#getGraph()
+ * @generated
+ */
+ int GRAPH = 0;
+
+ /**
+ * The feature id for the '<em><b>Edges</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__EDGES = 0;
+
+ /**
+ * The feature id for the '<em><b>Nodes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__NODES = 1;
+
+ /**
+ * The feature id for the '<em><b>Typegraph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__TYPEGRAPH = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__NAME = 3;
+
+ /**
+ * The number of structural features of the '<em>Graph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_FEATURE_COUNT = 4;
+
+ /**
+ * The number of operations of the '<em>Graph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link graph.impl.NodeImpl <em>Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.NodeImpl
+ * @see graph.impl.GraphPackageImpl#getNode()
+ * @generated
+ */
+ int NODE = 1;
+
+ /**
+ * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__ATTRIBUTES = 0;
+
+ /**
+ * The feature id for the '<em><b>Outgoing</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__OUTGOING = 1;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__NAME = 2;
+
+ /**
+ * The feature id for the '<em><b>Incoming</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__INCOMING = 3;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__TYPE = 4;
+
+ /**
+ * The number of structural features of the '<em>Node</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_COUNT = 5;
+
+ /**
+ * The number of operations of the '<em>Node</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link graph.impl.EdgeImpl <em>Edge</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.EdgeImpl
+ * @see graph.impl.GraphPackageImpl#getEdge()
+ * @generated
+ */
+ int EDGE = 2;
+
+ /**
+ * The feature id for the '<em><b>Source</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE__SOURCE = 0;
+
+ /**
+ * The feature id for the '<em><b>Target</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE__TARGET = 1;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE__TYPE = 2;
+
+ /**
+ * The number of structural features of the '<em>Edge</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>Edge</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link graph.impl.AttributeImpl <em>Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.AttributeImpl
+ * @see graph.impl.GraphPackageImpl#getAttribute()
+ * @generated
+ */
+ int ATTRIBUTE = 3;
+
+ /**
+ * The feature id for the '<em><b>Op</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__OP = 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__VALUE = 1;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__TYPE = 2;
+
+ /**
+ * The number of structural features of the '<em>Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link graph.Graph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Graph</em>'.
+ * @see graph.Graph
+ * @generated
+ */
+ EClass getGraph();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link graph.Graph#getEdges <em>Edges</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Edges</em>'.
+ * @see graph.Graph#getEdges()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_Edges();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link graph.Graph#getNodes <em>Nodes</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Nodes</em>'.
+ * @see graph.Graph#getNodes()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_Nodes();
+
+ /**
+ * Returns the meta object for the reference '{@link graph.Graph#getTypegraph <em>Typegraph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Typegraph</em>'.
+ * @see graph.Graph#getTypegraph()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_Typegraph();
+
+ /**
+ * Returns the meta object for the attribute '{@link graph.Graph#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see graph.Graph#getName()
+ * @see #getGraph()
+ * @generated
+ */
+ EAttribute getGraph_Name();
+
+ /**
+ * Returns the meta object for class '{@link graph.Node <em>Node</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Node</em>'.
+ * @see graph.Node
+ * @generated
+ */
+ EClass getNode();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link graph.Node#getAttributes <em>Attributes</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Attributes</em>'.
+ * @see graph.Node#getAttributes()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Attributes();
+
+ /**
+ * Returns the meta object for the reference list '{@link graph.Node#getOutgoing <em>Outgoing</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Outgoing</em>'.
+ * @see graph.Node#getOutgoing()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Outgoing();
+
+ /**
+ * Returns the meta object for the attribute '{@link graph.Node#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see graph.Node#getName()
+ * @see #getNode()
+ * @generated
+ */
+ EAttribute getNode_Name();
+
+ /**
+ * Returns the meta object for the reference list '{@link graph.Node#getIncoming <em>Incoming</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Incoming</em>'.
+ * @see graph.Node#getIncoming()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Incoming();
+
+ /**
+ * Returns the meta object for the reference '{@link graph.Node#getType <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Type</em>'.
+ * @see graph.Node#getType()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Type();
+
+ /**
+ * Returns the meta object for class '{@link graph.Edge <em>Edge</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Edge</em>'.
+ * @see graph.Edge
+ * @generated
+ */
+ EClass getEdge();
+
+ /**
+ * Returns the meta object for the reference '{@link graph.Edge#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Source</em>'.
+ * @see graph.Edge#getSource()
+ * @see #getEdge()
+ * @generated
+ */
+ EReference getEdge_Source();
+
+ /**
+ * Returns the meta object for the reference '{@link graph.Edge#getTarget <em>Target</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Target</em>'.
+ * @see graph.Edge#getTarget()
+ * @see #getEdge()
+ * @generated
+ */
+ EReference getEdge_Target();
+
+ /**
+ * Returns the meta object for the reference '{@link graph.Edge#getType <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Type</em>'.
+ * @see graph.Edge#getType()
+ * @see #getEdge()
+ * @generated
+ */
+ EReference getEdge_Type();
+
+ /**
+ * Returns the meta object for class '{@link graph.Attribute <em>Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Attribute</em>'.
+ * @see graph.Attribute
+ * @generated
+ */
+ EClass getAttribute();
+
+ /**
+ * Returns the meta object for the attribute '{@link graph.Attribute#getOp <em>Op</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Op</em>'.
+ * @see graph.Attribute#getOp()
+ * @see #getAttribute()
+ * @generated
+ */
+ EAttribute getAttribute_Op();
+
+ /**
+ * Returns the meta object for the attribute '{@link graph.Attribute#getValue <em>Value</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Value</em>'.
+ * @see graph.Attribute#getValue()
+ * @see #getAttribute()
+ * @generated
+ */
+ EAttribute getAttribute_Value();
+
+ /**
+ * Returns the meta object for the reference '{@link graph.Attribute#getType <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Type</em>'.
+ * @see graph.Attribute#getType()
+ * @see #getAttribute()
+ * @generated
+ */
+ EReference getAttribute_Type();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ GraphFactory getGraphFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link graph.impl.GraphImpl <em>Graph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.GraphImpl
+ * @see graph.impl.GraphPackageImpl#getGraph()
+ * @generated
+ */
+ EClass GRAPH = eINSTANCE.getGraph();
+
+ /**
+ * The meta object literal for the '<em><b>Edges</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__EDGES = eINSTANCE.getGraph_Edges();
+
+ /**
+ * The meta object literal for the '<em><b>Nodes</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__NODES = eINSTANCE.getGraph_Nodes();
+
+ /**
+ * The meta object literal for the '<em><b>Typegraph</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__TYPEGRAPH = eINSTANCE.getGraph_Typegraph();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute GRAPH__NAME = eINSTANCE.getGraph_Name();
+
+ /**
+ * The meta object literal for the '{@link graph.impl.NodeImpl <em>Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.NodeImpl
+ * @see graph.impl.GraphPackageImpl#getNode()
+ * @generated
+ */
+ EClass NODE = eINSTANCE.getNode();
+
+ /**
+ * The meta object literal for the '<em><b>Attributes</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__ATTRIBUTES = eINSTANCE.getNode_Attributes();
+
+ /**
+ * The meta object literal for the '<em><b>Outgoing</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__OUTGOING = eINSTANCE.getNode_Outgoing();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NODE__NAME = eINSTANCE.getNode_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Incoming</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__INCOMING = eINSTANCE.getNode_Incoming();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__TYPE = eINSTANCE.getNode_Type();
+
+ /**
+ * The meta object literal for the '{@link graph.impl.EdgeImpl <em>Edge</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.EdgeImpl
+ * @see graph.impl.GraphPackageImpl#getEdge()
+ * @generated
+ */
+ EClass EDGE = eINSTANCE.getEdge();
+
+ /**
+ * The meta object literal for the '<em><b>Source</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EDGE__SOURCE = eINSTANCE.getEdge_Source();
+
+ /**
+ * The meta object literal for the '<em><b>Target</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EDGE__TARGET = eINSTANCE.getEdge_Target();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EDGE__TYPE = eINSTANCE.getEdge_Type();
+
+ /**
+ * The meta object literal for the '{@link graph.impl.AttributeImpl <em>Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see graph.impl.AttributeImpl
+ * @see graph.impl.GraphPackageImpl#getAttribute()
+ * @generated
+ */
+ EClass ATTRIBUTE = eINSTANCE.getAttribute();
+
+ /**
+ * The meta object literal for the '<em><b>Op</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ATTRIBUTE__OP = eINSTANCE.getAttribute_Op();
+
+ /**
+ * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ATTRIBUTE__VALUE = eINSTANCE.getAttribute_Value();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ATTRIBUTE__TYPE = eINSTANCE.getAttribute_Type();
+
+ }
+
+} //GraphPackage
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Node.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Node.java
new file mode 100644
index 0000000..38c456f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/Node.java
@@ -0,0 +1,144 @@
+/**
+ */
+package graph;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Node</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link graph.Node#getAttributes <em>Attributes</em>}</li>
+ * <li>{@link graph.Node#getOutgoing <em>Outgoing</em>}</li>
+ * <li>{@link graph.Node#getName <em>Name</em>}</li>
+ * <li>{@link graph.Node#getIncoming <em>Incoming</em>}</li>
+ * <li>{@link graph.Node#getType <em>Type</em>}</li>
+ * </ul>
+ *
+ * @see graph.GraphPackage#getNode()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='CorrectlyTypedAttributes'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot CorrectlyTypedAttributes='self.attributes -> forAll(attr | self.type.eAllAttributes -> includes(attr.type))'"
+ * @generated
+ */
+public interface Node extends EObject {
+ /**
+ * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
+ * The list contents are of type {@link graph.Attribute}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Attributes</em>' containment reference list.
+ * @see graph.GraphPackage#getNode_Attributes()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Attribute> getAttributes();
+
+ /**
+ * Returns the value of the '<em><b>Outgoing</b></em>' reference list.
+ * The list contents are of type {@link graph.Edge}.
+ * It is bidirectional and its opposite is '{@link graph.Edge#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Outgoing</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Outgoing</em>' reference list.
+ * @see graph.GraphPackage#getNode_Outgoing()
+ * @see graph.Edge#getSource
+ * @model opposite="source"
+ * @generated
+ */
+ EList<Edge> getOutgoing();
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see graph.GraphPackage#getNode_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ List<String> getNames();
+
+ void addNames(List<String> names);
+
+ void removeName(String name);
+
+ /**
+ * Sets the value of the '{@link graph.Node#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Incoming</b></em>' reference list.
+ * The list contents are of type {@link graph.Edge}.
+ * It is bidirectional and its opposite is '{@link graph.Edge#getTarget <em>Target</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Incoming</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Incoming</em>' reference list.
+ * @see graph.GraphPackage#getNode_Incoming()
+ * @see graph.Edge#getTarget
+ * @model opposite="target"
+ * @generated
+ */
+ EList<Edge> getIncoming();
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' reference.
+ * @see #setType(EClass)
+ * @see graph.GraphPackage#getNode_Type()
+ * @model required="true"
+ * @generated
+ */
+ EClass getType();
+
+ /**
+ * Sets the value of the '{@link graph.Node#getType <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' reference.
+ * @see #getType()
+ * @generated
+ */
+ void setType(EClass value);
+
+} // Node
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/AttributeImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/AttributeImpl.java
new file mode 100644
index 0000000..afc3cb0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/AttributeImpl.java
@@ -0,0 +1,279 @@
+/**
+ */
+package graph.impl;
+
+import graph.Attribute;
+import graph.GraphPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link graph.impl.AttributeImpl#getOp <em>Op</em>}</li>
+ * <li>{@link graph.impl.AttributeImpl#getValue <em>Value</em>}</li>
+ * <li>{@link graph.impl.AttributeImpl#getType <em>Type</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class AttributeImpl extends MinimalEObjectImpl.Container implements Attribute {
+ /**
+ * The default value of the '{@link #getOp() <em>Op</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOp()
+ * @generated
+ * @ordered
+ */
+ protected static final String OP_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOp() <em>Op</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOp()
+ * @generated
+ * @ordered
+ */
+ protected String op = OP_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected EAttribute type;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AttributeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphPackage.Literals.ATTRIBUTE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getOp() {
+ return op;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOp(String newOp) {
+ String oldOp = op;
+ op = newOp;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.ATTRIBUTE__OP, oldOp, op));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setValue(String newValue) {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.ATTRIBUTE__VALUE, oldValue, value));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getType() {
+ if (type != null && type.eIsProxy()) {
+ InternalEObject oldType = (InternalEObject)type;
+ type = (EAttribute)eResolveProxy(oldType);
+ if (type != oldType) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GraphPackage.ATTRIBUTE__TYPE, oldType, type));
+ }
+ }
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute basicGetType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(EAttribute newType) {
+ EAttribute oldType = type;
+ type = newType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.ATTRIBUTE__TYPE, oldType, type));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphPackage.ATTRIBUTE__OP:
+ return getOp();
+ case GraphPackage.ATTRIBUTE__VALUE:
+ return getValue();
+ case GraphPackage.ATTRIBUTE__TYPE:
+ if (resolve) return getType();
+ return basicGetType();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphPackage.ATTRIBUTE__OP:
+ setOp((String)newValue);
+ return;
+ case GraphPackage.ATTRIBUTE__VALUE:
+ setValue((String)newValue);
+ return;
+ case GraphPackage.ATTRIBUTE__TYPE:
+ setType((EAttribute)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphPackage.ATTRIBUTE__OP:
+ setOp(OP_EDEFAULT);
+ return;
+ case GraphPackage.ATTRIBUTE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ case GraphPackage.ATTRIBUTE__TYPE:
+ setType((EAttribute)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphPackage.ATTRIBUTE__OP:
+ return OP_EDEFAULT == null ? op != null : !OP_EDEFAULT.equals(op);
+ case GraphPackage.ATTRIBUTE__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ case GraphPackage.ATTRIBUTE__TYPE:
+ return type != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (op: ");
+ result.append(op);
+ result.append(", value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //AttributeImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/EdgeImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/EdgeImpl.java
new file mode 100644
index 0000000..0ae84f4
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/EdgeImpl.java
@@ -0,0 +1,359 @@
+/**
+ */
+package graph.impl;
+
+import graph.Edge;
+import graph.GraphPackage;
+import graph.Node;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Edge</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link graph.impl.EdgeImpl#getSource <em>Source</em>}</li>
+ * <li>{@link graph.impl.EdgeImpl#getTarget <em>Target</em>}</li>
+ * <li>{@link graph.impl.EdgeImpl#getType <em>Type</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class EdgeImpl extends MinimalEObjectImpl.Container implements Edge {
+ /**
+ * The cached value of the '{@link #getSource() <em>Source</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSource()
+ * @generated
+ * @ordered
+ */
+ protected Node source;
+
+ /**
+ * The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTarget()
+ * @generated
+ * @ordered
+ */
+ protected Node target;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected EReference type;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EdgeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphPackage.Literals.EDGE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getSource() {
+ if (source != null && source.eIsProxy()) {
+ InternalEObject oldSource = (InternalEObject)source;
+ source = (Node)eResolveProxy(oldSource);
+ if (source != oldSource) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GraphPackage.EDGE__SOURCE, oldSource, source));
+ }
+ }
+ return source;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetSource() {
+ return source;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetSource(Node newSource, NotificationChain msgs) {
+ Node oldSource = source;
+ source = newSource;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GraphPackage.EDGE__SOURCE, oldSource, newSource);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSource(Node newSource) {
+ if (newSource != source) {
+ NotificationChain msgs = null;
+ if (source != null)
+ msgs = ((InternalEObject)source).eInverseRemove(this, GraphPackage.NODE__OUTGOING, Node.class, msgs);
+ if (newSource != null)
+ msgs = ((InternalEObject)newSource).eInverseAdd(this, GraphPackage.NODE__OUTGOING, Node.class, msgs);
+ msgs = basicSetSource(newSource, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.EDGE__SOURCE, newSource, newSource));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getTarget() {
+ if (target != null && target.eIsProxy()) {
+ InternalEObject oldTarget = (InternalEObject)target;
+ target = (Node)eResolveProxy(oldTarget);
+ if (target != oldTarget) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GraphPackage.EDGE__TARGET, oldTarget, target));
+ }
+ }
+ return target;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetTarget() {
+ return target;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetTarget(Node newTarget, NotificationChain msgs) {
+ Node oldTarget = target;
+ target = newTarget;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GraphPackage.EDGE__TARGET, oldTarget, newTarget);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTarget(Node newTarget) {
+ if (newTarget != target) {
+ NotificationChain msgs = null;
+ if (target != null)
+ msgs = ((InternalEObject)target).eInverseRemove(this, GraphPackage.NODE__INCOMING, Node.class, msgs);
+ if (newTarget != null)
+ msgs = ((InternalEObject)newTarget).eInverseAdd(this, GraphPackage.NODE__INCOMING, Node.class, msgs);
+ msgs = basicSetTarget(newTarget, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.EDGE__TARGET, newTarget, newTarget));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getType() {
+ if (type != null && type.eIsProxy()) {
+ InternalEObject oldType = (InternalEObject)type;
+ type = (EReference)eResolveProxy(oldType);
+ if (type != oldType) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GraphPackage.EDGE__TYPE, oldType, type));
+ }
+ }
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference basicGetType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(EReference newType) {
+ EReference oldType = type;
+ type = newType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.EDGE__TYPE, oldType, type));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphPackage.EDGE__SOURCE:
+ if (source != null)
+ msgs = ((InternalEObject)source).eInverseRemove(this, GraphPackage.NODE__OUTGOING, Node.class, msgs);
+ return basicSetSource((Node)otherEnd, msgs);
+ case GraphPackage.EDGE__TARGET:
+ if (target != null)
+ msgs = ((InternalEObject)target).eInverseRemove(this, GraphPackage.NODE__INCOMING, Node.class, msgs);
+ return basicSetTarget((Node)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphPackage.EDGE__SOURCE:
+ return basicSetSource(null, msgs);
+ case GraphPackage.EDGE__TARGET:
+ return basicSetTarget(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphPackage.EDGE__SOURCE:
+ if (resolve) return getSource();
+ return basicGetSource();
+ case GraphPackage.EDGE__TARGET:
+ if (resolve) return getTarget();
+ return basicGetTarget();
+ case GraphPackage.EDGE__TYPE:
+ if (resolve) return getType();
+ return basicGetType();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphPackage.EDGE__SOURCE:
+ setSource((Node)newValue);
+ return;
+ case GraphPackage.EDGE__TARGET:
+ setTarget((Node)newValue);
+ return;
+ case GraphPackage.EDGE__TYPE:
+ setType((EReference)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphPackage.EDGE__SOURCE:
+ setSource((Node)null);
+ return;
+ case GraphPackage.EDGE__TARGET:
+ setTarget((Node)null);
+ return;
+ case GraphPackage.EDGE__TYPE:
+ setType((EReference)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphPackage.EDGE__SOURCE:
+ return source != null;
+ case GraphPackage.EDGE__TARGET:
+ return target != null;
+ case GraphPackage.EDGE__TYPE:
+ return type != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //EdgeImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphFactoryImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphFactoryImpl.java
new file mode 100644
index 0000000..f6d28e6
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphFactoryImpl.java
@@ -0,0 +1,128 @@
+/**
+ */
+package graph.impl;
+
+import graph.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphFactoryImpl extends EFactoryImpl implements GraphFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GraphFactory init() {
+ try {
+ GraphFactory theGraphFactory = (GraphFactory)EPackage.Registry.INSTANCE.getEFactory(GraphPackage.eNS_URI);
+ if (theGraphFactory != null) {
+ return theGraphFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new GraphFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case GraphPackage.GRAPH: return createGraph();
+ case GraphPackage.NODE: return createNode();
+ case GraphPackage.EDGE: return createEdge();
+ case GraphPackage.ATTRIBUTE: return createAttribute();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph createGraph() {
+ GraphImpl graph = new GraphImpl();
+ return graph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node createNode() {
+ NodeImpl node = new NodeImpl();
+ return node;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Edge createEdge() {
+ EdgeImpl edge = new EdgeImpl();
+ return edge;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Attribute createAttribute() {
+ AttributeImpl attribute = new AttributeImpl();
+ return attribute;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphPackage getGraphPackage() {
+ return (GraphPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static GraphPackage getPackage() {
+ return GraphPackage.eINSTANCE;
+ }
+
+} //GraphFactoryImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphImpl.java
new file mode 100644
index 0000000..6830d0e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphImpl.java
@@ -0,0 +1,320 @@
+/**
+ */
+package graph.impl;
+
+import graph.Edge;
+import graph.Graph;
+import graph.GraphPackage;
+import graph.Node;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Graph</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link graph.impl.GraphImpl#getEdges <em>Edges</em>}</li>
+ * <li>{@link graph.impl.GraphImpl#getNodes <em>Nodes</em>}</li>
+ * <li>{@link graph.impl.GraphImpl#getTypegraph <em>Typegraph</em>}</li>
+ * <li>{@link graph.impl.GraphImpl#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
+ /**
+ * The cached value of the '{@link #getEdges() <em>Edges</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEdges()
+ * @generated
+ * @ordered
+ */
+ protected EList<Edge> edges;
+
+ /**
+ * The cached value of the '{@link #getNodes() <em>Nodes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getNodes()
+ * @generated
+ * @ordered
+ */
+ protected EList<Node> nodes;
+
+ /**
+ * The cached value of the '{@link #getTypegraph() <em>Typegraph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypegraph()
+ * @generated
+ * @ordered
+ */
+ protected EPackage typegraph;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphPackage.Literals.GRAPH;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Edge> getEdges() {
+ if (edges == null) {
+ edges = new EObjectContainmentEList<Edge>(Edge.class, this, GraphPackage.GRAPH__EDGES);
+ }
+ return edges;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Node> getNodes() {
+ if (nodes == null) {
+ nodes = new EObjectContainmentEList<Node>(Node.class, this, GraphPackage.GRAPH__NODES);
+ }
+ return nodes;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage getTypegraph() {
+ if (typegraph != null && typegraph.eIsProxy()) {
+ InternalEObject oldTypegraph = (InternalEObject)typegraph;
+ typegraph = (EPackage)eResolveProxy(oldTypegraph);
+ if (typegraph != oldTypegraph) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GraphPackage.GRAPH__TYPEGRAPH, oldTypegraph, typegraph));
+ }
+ }
+ return typegraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage basicGetTypegraph() {
+ return typegraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTypegraph(EPackage newTypegraph) {
+ EPackage oldTypegraph = typegraph;
+ typegraph = newTypegraph;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.GRAPH__TYPEGRAPH, oldTypegraph, typegraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.GRAPH__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphPackage.GRAPH__EDGES:
+ return ((InternalEList<?>)getEdges()).basicRemove(otherEnd, msgs);
+ case GraphPackage.GRAPH__NODES:
+ return ((InternalEList<?>)getNodes()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphPackage.GRAPH__EDGES:
+ return getEdges();
+ case GraphPackage.GRAPH__NODES:
+ return getNodes();
+ case GraphPackage.GRAPH__TYPEGRAPH:
+ if (resolve) return getTypegraph();
+ return basicGetTypegraph();
+ case GraphPackage.GRAPH__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphPackage.GRAPH__EDGES:
+ getEdges().clear();
+ getEdges().addAll((Collection<? extends Edge>)newValue);
+ return;
+ case GraphPackage.GRAPH__NODES:
+ getNodes().clear();
+ getNodes().addAll((Collection<? extends Node>)newValue);
+ return;
+ case GraphPackage.GRAPH__TYPEGRAPH:
+ setTypegraph((EPackage)newValue);
+ return;
+ case GraphPackage.GRAPH__NAME:
+ setName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphPackage.GRAPH__EDGES:
+ getEdges().clear();
+ return;
+ case GraphPackage.GRAPH__NODES:
+ getNodes().clear();
+ return;
+ case GraphPackage.GRAPH__TYPEGRAPH:
+ setTypegraph((EPackage)null);
+ return;
+ case GraphPackage.GRAPH__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphPackage.GRAPH__EDGES:
+ return edges != null && !edges.isEmpty();
+ case GraphPackage.GRAPH__NODES:
+ return nodes != null && !nodes.isEmpty();
+ case GraphPackage.GRAPH__TYPEGRAPH:
+ return typegraph != null;
+ case GraphPackage.GRAPH__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //GraphImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphPackageImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphPackageImpl.java
new file mode 100644
index 0000000..a20484e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/GraphPackageImpl.java
@@ -0,0 +1,519 @@
+/**
+ */
+package graph.impl;
+
+import graph.Attribute;
+import graph.Edge;
+import graph.Graph;
+import graph.GraphFactory;
+import graph.GraphPackage;
+import graph.Node;
+
+import graph.util.GraphValidator;
+
+import laxcondition.LaxconditionPackage;
+
+import laxcondition.impl.LaxconditionPackageImpl;
+
+import nestedcondition.NestedconditionPackage;
+
+import nestedcondition.impl.NestedconditionPackageImpl;
+
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+import nestedconstraintmodel.impl.NestedconstraintmodelPackageImpl;
+
+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.EValidator;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphPackageImpl extends EPackageImpl implements GraphPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass graphEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nodeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass edgeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass attributeEClass = 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 graph.GraphPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private GraphPackageImpl() {
+ super(eNS_URI, GraphFactory.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 GraphPackage#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 GraphPackage init() {
+ if (isInited) return (GraphPackage)EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI);
+
+ // Obtain or create and register package
+ GraphPackageImpl theGraphPackage = (GraphPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GraphPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new GraphPackageImpl());
+
+ isInited = true;
+
+ // Obtain or create and register interdependencies
+ NestedconstraintmodelPackageImpl theNestedconstraintmodelPackage = (NestedconstraintmodelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI) instanceof NestedconstraintmodelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI) : NestedconstraintmodelPackage.eINSTANCE);
+ NestedconditionPackageImpl theNestedconditionPackage = (NestedconditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI) instanceof NestedconditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI) : NestedconditionPackage.eINSTANCE);
+ LaxconditionPackageImpl theLaxconditionPackage = (LaxconditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI) instanceof LaxconditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI) : LaxconditionPackage.eINSTANCE);
+
+ // Create package meta-data objects
+ theGraphPackage.createPackageContents();
+ theNestedconstraintmodelPackage.createPackageContents();
+ theNestedconditionPackage.createPackageContents();
+ theLaxconditionPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theGraphPackage.initializePackageContents();
+ theNestedconstraintmodelPackage.initializePackageContents();
+ theNestedconditionPackage.initializePackageContents();
+ theLaxconditionPackage.initializePackageContents();
+
+ // Register package validator
+ EValidator.Registry.INSTANCE.put
+ (theGraphPackage,
+ new EValidator.Descriptor() {
+ public EValidator getEValidator() {
+ return GraphValidator.INSTANCE;
+ }
+ });
+
+ // Mark meta-data to indicate it can't be changed
+ theGraphPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(GraphPackage.eNS_URI, theGraphPackage);
+ return theGraphPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGraph() {
+ return graphEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraph_Edges() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraph_Nodes() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraph_Typegraph() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getGraph_Name() {
+ return (EAttribute)graphEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNode() {
+ return nodeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Attributes() {
+ return (EReference)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 EAttribute getNode_Name() {
+ return (EAttribute)nodeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Incoming() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Type() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- 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 EReference getEdge_Type() {
+ return (EReference)edgeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getAttribute() {
+ return attributeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getAttribute_Op() {
+ return (EAttribute)attributeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getAttribute_Value() {
+ return (EAttribute)attributeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getAttribute_Type() {
+ return (EReference)attributeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphFactory getGraphFactory() {
+ return (GraphFactory)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__EDGES);
+ createEReference(graphEClass, GRAPH__NODES);
+ createEReference(graphEClass, GRAPH__TYPEGRAPH);
+ createEAttribute(graphEClass, GRAPH__NAME);
+
+ nodeEClass = createEClass(NODE);
+ createEReference(nodeEClass, NODE__ATTRIBUTES);
+ createEReference(nodeEClass, NODE__OUTGOING);
+ createEAttribute(nodeEClass, NODE__NAME);
+ createEReference(nodeEClass, NODE__INCOMING);
+ createEReference(nodeEClass, NODE__TYPE);
+
+ edgeEClass = createEClass(EDGE);
+ createEReference(edgeEClass, EDGE__SOURCE);
+ createEReference(edgeEClass, EDGE__TARGET);
+ createEReference(edgeEClass, EDGE__TYPE);
+
+ attributeEClass = createEClass(ATTRIBUTE);
+ createEAttribute(attributeEClass, ATTRIBUTE__OP);
+ createEAttribute(attributeEClass, ATTRIBUTE__VALUE);
+ createEReference(attributeEClass, ATTRIBUTE__TYPE);
+ }
+
+ /**
+ * <!-- 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
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(graphEClass, Graph.class, "Graph", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ 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);
+ 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_Typegraph(), ecorePackage.getEPackage(), null, "typegraph", null, 1, 1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getGraph_Name(), ecorePackage.getEString(), "name", null, 0, 1, Graph.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_Attributes(), this.getAttribute(), null, "attributes", 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_Outgoing(), this.getEdge(), this.getEdge_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);
+ 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_Incoming(), this.getEdge(), this.getEdge_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);
+ initEReference(getNode_Type(), ecorePackage.getEClass(), null, "type", null, 1, 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_Outgoing(), "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_Incoming(), "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);
+ initEReference(getEdge_Type(), ecorePackage.getEReference(), null, "type", null, 1, 1, Edge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(attributeEClass, Attribute.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getAttribute_Op(), ecorePackage.getEString(), "op", null, 0, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getAttribute_Value(), ecorePackage.getEString(), "value", null, 0, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getAttribute_Type(), ecorePackage.getEAttribute(), null, "type", null, 1, 1, Attribute.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
+ // http://www.eclipse.org/OCL/Import
+ createImportAnnotations();
+ // http://www.eclipse.org/emf/2002/Ecore
+ createEcoreAnnotations();
+ // http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
+ createPivotAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createImportAnnotations() {
+ String source = "http://www.eclipse.org/OCL/Import";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "ecore", "http://www.eclipse.org/emf/2002/Ecore"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createEcoreAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"
+ });
+ addAnnotation
+ (graphEClass,
+ source,
+ new String[] {
+ "constraints", "CorrectlyTypedNodes"
+ });
+ addAnnotation
+ (nodeEClass,
+ source,
+ new String[] {
+ "constraints", "CorrectlyTypedAttributes"
+ });
+ addAnnotation
+ (edgeEClass,
+ source,
+ new String[] {
+ "constraints", "CorrectlyTypedEdgesSourceNode CorrectlyTypedEdgesTargetNode"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createPivotAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
+ addAnnotation
+ (graphEClass,
+ source,
+ new String[] {
+ "CorrectlyTypedNodes", "self.nodes -> forAll(node | self.typegraph.eClassifiers -> includes(node.type))"
+ });
+ addAnnotation
+ (nodeEClass,
+ source,
+ new String[] {
+ "CorrectlyTypedAttributes", "self.attributes -> forAll(attr | self.type.eAllAttributes -> includes(attr.type))"
+ });
+ addAnnotation
+ (edgeEClass,
+ source,
+ new String[] {
+ "CorrectlyTypedEdgesSourceNode", "self.source.type.eAllReferences -> includes(self.type)",
+ "CorrectlyTypedEdgesTargetNode", "(self.target.type = self.type.eReferenceType) or (self.target.type.eAllSuperTypes -> includes(self.type.eReferenceType))"
+ });
+ }
+
+} //GraphPackageImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/NodeImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/NodeImpl.java
new file mode 100644
index 0000000..1630eb4
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/impl/NodeImpl.java
@@ -0,0 +1,398 @@
+/**
+ */
+package graph.impl;
+
+import graph.Attribute;
+import graph.Edge;
+import graph.GraphPackage;
+import graph.Node;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Node</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link graph.impl.NodeImpl#getAttributes <em>Attributes</em>}</li>
+ * <li>{@link graph.impl.NodeImpl#getOutgoing <em>Outgoing</em>}</li>
+ * <li>{@link graph.impl.NodeImpl#getName <em>Name</em>}</li>
+ * <li>{@link graph.impl.NodeImpl#getIncoming <em>Incoming</em>}</li>
+ * <li>{@link graph.impl.NodeImpl#getType <em>Type</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class NodeImpl extends MinimalEObjectImpl.Container implements Node {
+ /**
+ * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAttributes()
+ * @generated
+ * @ordered
+ */
+ protected EList<Attribute> attributes;
+
+ /**
+ * The cached value of the '{@link #getOutgoing() <em>Outgoing</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOutgoing()
+ * @generated
+ * @ordered
+ */
+ protected EList<Edge> outgoing;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getIncoming() <em>Incoming</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIncoming()
+ * @generated
+ * @ordered
+ */
+ protected EList<Edge> incoming;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected EClass type;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NodeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphPackage.Literals.NODE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Attribute> getAttributes() {
+ if (attributes == null) {
+ attributes = new EObjectContainmentEList<Attribute>(Attribute.class, this, GraphPackage.NODE__ATTRIBUTES);
+ }
+ return attributes;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Edge> getOutgoing() {
+ if (outgoing == null) {
+ outgoing = new EObjectWithInverseResolvingEList<Edge>(Edge.class, this, GraphPackage.NODE__OUTGOING, GraphPackage.EDGE__SOURCE);
+ }
+ return outgoing;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.NODE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Edge> getIncoming() {
+ if (incoming == null) {
+ incoming = new EObjectWithInverseResolvingEList<Edge>(Edge.class, this, GraphPackage.NODE__INCOMING, GraphPackage.EDGE__TARGET);
+ }
+ return incoming;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getType() {
+ if (type != null && type.eIsProxy()) {
+ InternalEObject oldType = (InternalEObject)type;
+ type = (EClass)eResolveProxy(oldType);
+ if (type != oldType) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GraphPackage.NODE__TYPE, oldType, type));
+ }
+ }
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass basicGetType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(EClass newType) {
+ EClass oldType = type;
+ type = newType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.NODE__TYPE, oldType, type));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphPackage.NODE__OUTGOING:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getOutgoing()).basicAdd(otherEnd, msgs);
+ case GraphPackage.NODE__INCOMING:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getIncoming()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphPackage.NODE__ATTRIBUTES:
+ return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs);
+ case GraphPackage.NODE__OUTGOING:
+ return ((InternalEList<?>)getOutgoing()).basicRemove(otherEnd, msgs);
+ case GraphPackage.NODE__INCOMING:
+ return ((InternalEList<?>)getIncoming()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphPackage.NODE__ATTRIBUTES:
+ return getAttributes();
+ case GraphPackage.NODE__OUTGOING:
+ return getOutgoing();
+ case GraphPackage.NODE__NAME:
+ return getName();
+ case GraphPackage.NODE__INCOMING:
+ return getIncoming();
+ case GraphPackage.NODE__TYPE:
+ if (resolve) return getType();
+ return basicGetType();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphPackage.NODE__ATTRIBUTES:
+ getAttributes().clear();
+ getAttributes().addAll((Collection<? extends Attribute>)newValue);
+ return;
+ case GraphPackage.NODE__OUTGOING:
+ getOutgoing().clear();
+ getOutgoing().addAll((Collection<? extends Edge>)newValue);
+ return;
+ case GraphPackage.NODE__NAME:
+ setName((String)newValue);
+ return;
+ case GraphPackage.NODE__INCOMING:
+ getIncoming().clear();
+ getIncoming().addAll((Collection<? extends Edge>)newValue);
+ return;
+ case GraphPackage.NODE__TYPE:
+ setType((EClass)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphPackage.NODE__ATTRIBUTES:
+ getAttributes().clear();
+ return;
+ case GraphPackage.NODE__OUTGOING:
+ getOutgoing().clear();
+ return;
+ case GraphPackage.NODE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case GraphPackage.NODE__INCOMING:
+ getIncoming().clear();
+ return;
+ case GraphPackage.NODE__TYPE:
+ setType((EClass)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphPackage.NODE__ATTRIBUTES:
+ return attributes != null && !attributes.isEmpty();
+ case GraphPackage.NODE__OUTGOING:
+ return outgoing != null && !outgoing.isEmpty();
+ case GraphPackage.NODE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case GraphPackage.NODE__INCOMING:
+ return incoming != null && !incoming.isEmpty();
+ case GraphPackage.NODE__TYPE:
+ return type != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+ public List<String> getNames() {
+ String[] names = name.split("=");
+ return Arrays.asList(names);
+ }
+
+ public void removeName(String name) {
+ String[] names = this.name.split("=");
+ this.name = names[0];
+ for (int i=1; i < names.length; i++) {
+ if (! names[i].equals(name)) {
+ this.name += "=" + names[i];
+ }
+ }
+ }
+
+ public void addNames(List<String> names) {
+ for (String str : names) {
+ if (! getNames().contains(str))
+ this.name += "=" + str;
+ }
+ }
+
+} //NodeImpl
+
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphAdapterFactory.java
new file mode 100644
index 0000000..c22de38
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphAdapterFactory.java
@@ -0,0 +1,174 @@
+/**
+ */
+package graph.util;
+
+import graph.*;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see graph.GraphPackage
+ * @generated
+ */
+public class GraphAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static GraphPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = GraphPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphSwitch<Adapter> modelSwitch =
+ new GraphSwitch<Adapter>() {
+ @Override
+ public Adapter caseGraph(Graph object) {
+ return createGraphAdapter();
+ }
+ @Override
+ public Adapter caseNode(Node object) {
+ return createNodeAdapter();
+ }
+ @Override
+ public Adapter caseEdge(Edge object) {
+ return createEdgeAdapter();
+ }
+ @Override
+ public Adapter caseAttribute(Attribute object) {
+ return createAttributeAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link graph.Graph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see graph.Graph
+ * @generated
+ */
+ public Adapter createGraphAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link graph.Node <em>Node</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see graph.Node
+ * @generated
+ */
+ public Adapter createNodeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link graph.Edge <em>Edge</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see graph.Edge
+ * @generated
+ */
+ public Adapter createEdgeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link graph.Attribute <em>Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see graph.Attribute
+ * @generated
+ */
+ public Adapter createAttributeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //GraphAdapterFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphSwitch.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphSwitch.java
new file mode 100644
index 0000000..c185991
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphSwitch.java
@@ -0,0 +1,173 @@
+/**
+ */
+package graph.util;
+
+import graph.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see graph.GraphPackage
+ * @generated
+ */
+public class GraphSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static GraphPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphSwitch() {
+ if (modelPackage == null) {
+ modelPackage = GraphPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case GraphPackage.GRAPH: {
+ Graph graph = (Graph)theEObject;
+ T result = caseGraph(graph);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphPackage.NODE: {
+ Node node = (Node)theEObject;
+ T result = caseNode(node);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphPackage.EDGE: {
+ Edge edge = (Edge)theEObject;
+ T result = caseEdge(edge);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphPackage.ATTRIBUTE: {
+ Attribute attribute = (Attribute)theEObject;
+ T result = caseAttribute(attribute);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Graph</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Graph</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGraph(Graph object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Node</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Node</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNode(Node object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Edge</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Edge</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEdge(Edge object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Attribute</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAttribute(Attribute object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //GraphSwitch
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphValidator.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphValidator.java
new file mode 100644
index 0000000..d0993c1
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/GraphValidator.java
@@ -0,0 +1,299 @@
+/**
+ */
+package graph.util;
+
+import graph.*;
+
+import java.util.Map;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.EObjectValidator;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Validator</b> for the model.
+ * <!-- end-user-doc -->
+ * @see graph.GraphPackage
+ * @generated
+ */
+public class GraphValidator extends EObjectValidator {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final GraphValidator INSTANCE = new GraphValidator();
+
+ /**
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.common.util.Diagnostic#getSource()
+ * @see org.eclipse.emf.common.util.Diagnostic#getCode()
+ * @generated
+ */
+ public static final String DIAGNOSTIC_SOURCE = "graph";
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphValidator() {
+ super();
+ }
+
+ /**
+ * Returns the package of this validator switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EPackage getEPackage() {
+ return GraphPackage.eINSTANCE;
+ }
+
+ /**
+ * Calls <code>validateXXX</code> for the corresponding classifier of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ switch (classifierID) {
+ case GraphPackage.GRAPH:
+ return validateGraph((Graph)value, diagnostics, context);
+ case GraphPackage.NODE:
+ return validateNode((Node)value, diagnostics, context);
+ case GraphPackage.EDGE:
+ return validateEdge((Edge)value, diagnostics, context);
+ case GraphPackage.ATTRIBUTE:
+ return validateAttribute((Attribute)value, diagnostics, context);
+ default:
+ return true;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateGraph(Graph graph, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(graph, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(graph, diagnostics, context);
+ if (result || diagnostics != null) result &= validateGraph_CorrectlyTypedNodes(graph, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the CorrectlyTypedNodes constraint of '<em>Graph</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String GRAPH__CORRECTLY_TYPED_NODES__EEXPRESSION = "self.nodes -> forAll(node | self.typegraph.eClassifiers -> includes(node.type))";
+
+ /**
+ * Validates the CorrectlyTypedNodes constraint of '<em>Graph</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateGraph_CorrectlyTypedNodes(Graph graph, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (GraphPackage.Literals.GRAPH,
+ graph,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "CorrectlyTypedNodes",
+ GRAPH__CORRECTLY_TYPED_NODES__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNode(Node node, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(node, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(node, diagnostics, context);
+ if (result || diagnostics != null) result &= validateNode_CorrectlyTypedAttributes(node, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the CorrectlyTypedAttributes constraint of '<em>Node</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String NODE__CORRECTLY_TYPED_ATTRIBUTES__EEXPRESSION = "self.attributes -> forAll(attr | self.type.eAllAttributes -> includes(attr.type))";
+
+ /**
+ * Validates the CorrectlyTypedAttributes constraint of '<em>Node</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNode_CorrectlyTypedAttributes(Node node, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (GraphPackage.Literals.NODE,
+ node,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "CorrectlyTypedAttributes",
+ NODE__CORRECTLY_TYPED_ATTRIBUTES__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateEdge(Edge edge, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(edge, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validateEdge_CorrectlyTypedEdgesSourceNode(edge, diagnostics, context);
+ if (result || diagnostics != null) result &= validateEdge_CorrectlyTypedEdgesTargetNode(edge, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the CorrectlyTypedEdgesSourceNode constraint of '<em>Edge</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String EDGE__CORRECTLY_TYPED_EDGES_SOURCE_NODE__EEXPRESSION = "self.source.type.eAllReferences -> includes(self.type)";
+
+ /**
+ * Validates the CorrectlyTypedEdgesSourceNode constraint of '<em>Edge</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateEdge_CorrectlyTypedEdgesSourceNode(Edge edge, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (GraphPackage.Literals.EDGE,
+ edge,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "CorrectlyTypedEdgesSourceNode",
+ EDGE__CORRECTLY_TYPED_EDGES_SOURCE_NODE__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the CorrectlyTypedEdgesTargetNode constraint of '<em>Edge</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String EDGE__CORRECTLY_TYPED_EDGES_TARGET_NODE__EEXPRESSION = "(self.target.type = self.type.eReferenceType) or (self.target.type.eAllSuperTypes -> includes(self.type.eReferenceType))";
+
+ /**
+ * Validates the CorrectlyTypedEdgesTargetNode constraint of '<em>Edge</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateEdge_CorrectlyTypedEdgesTargetNode(Edge edge, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (GraphPackage.Literals.EDGE,
+ edge,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "CorrectlyTypedEdgesTargetNode",
+ EDGE__CORRECTLY_TYPED_EDGES_TARGET_NODE__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateAttribute(Attribute attribute, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(attribute, diagnostics, context);
+ }
+
+ /**
+ * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ // TODO
+ // Specialize this to return a resource locator for messages specific to this validator.
+ // Ensure that you remove @generated or mark it @generated NOT
+ return super.getResourceLocator();
+ }
+
+} //GraphValidator
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/Constants.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/Constants.java
new file mode 100644
index 0000000..4db920c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/Constants.java
@@ -0,0 +1,60 @@
+package graph.util.extensions;
+
+public class Constants {
+
+ public static final String DOCUMENTCLASS = "\\documentclass[12pt]{article}\n";
+ public static final String DOCUMENTCLASS2 = "\\documentclass[12pt]{standalone}\n";
+ public static final String TIKZ_CELLULAR = "\\usepackage{texstyles/tikz-cellular}\n";
+ public static final String TIKZ_VCOND = "\\usepackage{texstyles/tikz-vcond}\n";
+ public static final String TIKZ_EXTENSION = "\\usepackage{texstyles/tikz-extension}\n";
+ public static final String TIKZ_ARROWS = "\\usetikzlibrary{arrows,arrows.meta}\n";
+
+ public static final String AMSSYMB = "\\usepackage{amssymb}\n";
+
+ public static final String BEGIN_DOCUMENT = "\\begin{document}\n";
+ public static final String END_DOCUMENT = "\n\\end{document}";
+
+ public static final String EMPTYSET = "\\emptyset";
+ public static final String TIKZ = "\\tikz";
+ public static final String SETBRACKETOPEN = " { ";
+ public static final String SETBRACKETCLOSE = " } ";
+
+ public static final String COMMA = ",";
+ public static final String NODE = "\\node";
+ public static final String BRACKETOPEN = " (";
+ public static final String BRACKETCLOSE = ") ";
+ public static final String SCLASS = "[SClass";
+ public static final String CLASSCLOSE = "]";
+ public static final String COLON = ":";
+ public static final String NORMALCLASS = "[Class";
+ public static final String GNODELABELCLASS = "\\gnodelabelClass";
+ public static final Object DOUBLEBS = " \\\\ ";
+ public static final String SEMICOLON = " ; ";
+ public static final String NEWLINE = "\n";
+ public static final String UNDERSCORE = "\\_";
+
+ public static final String SPACE = " ";
+
+ public static final String GEQ = ">=";
+ public static final String $GEQ$ = "$\\geq$";
+ public static final String NOTEQUALS = "<>";
+ public static final String NOTEQUALS2 = "!=";
+ public static final String $NOTEQUALS$ = "$<>$";
+ public static final String $NOTEQUALS2$ = "$!=$";
+ public static final String GRTH = ">";
+ public static final String $GRTH$ = "$>$";
+ public static final String EQUALS = "=";
+ public static final String $EQUALS$ = "$=$";
+ public static final String LSTH = "<";
+ public static final String $LSTH$ = "$<$";
+
+ public static final String DRAW = "\\draw [->] (";
+ public static final String DRAWCONTAINMENT = "\\draw [{Diamond}-{Stealth}] (";
+ public static final String TONODE = " to node [above,sloped] { \\tiny ";
+
+ public static final String TEXFOLDER = "\\tex\\";
+ public static final String TEXSTYLEFOLDER = "\\texstyles\\";
+ public static final String GRAPH = "graph";
+ public static final String TEX = ".tex";
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/ExtendedNode.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/ExtendedNode.java
new file mode 100644
index 0000000..3f31eb5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/ExtendedNode.java
@@ -0,0 +1,57 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package graph.util.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import graph.Node;
+
+public class ExtendedNode {
+
+ private Node node = null;
+ private ExtendedNode predecessor = null;
+ private List<ExtendedNode> successors;
+
+ public ExtendedNode(Node n) {
+ node = n;
+ successors = new ArrayList<ExtendedNode>();
+ }
+
+ public ExtendedNode getPredecessor() {
+ return predecessor;
+ }
+
+ public void setPredecessor(ExtendedNode predecessor) {
+ this.predecessor = predecessor;
+ }
+
+ public List<ExtendedNode> getSuccessors() {
+ return successors;
+ }
+
+ public void addSuccessor(ExtendedNode successor) {
+ Node successorNode = successor.getNode();
+ boolean exists = false;
+ for (ExtendedNode extendedNode : successors) {
+ if (extendedNode.getNode() == successorNode) {
+ exists = true;
+ break;
+ }
+ }
+ if (!exists)
+ this.successors.add(successor);
+ }
+
+ public Node getNode() {
+ return node;
+ }
+
+ public void setNode(Node node) {
+ this.node = node;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/GraphPrinter.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/GraphPrinter.java
new file mode 100644
index 0000000..23433d8
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/graph/util/extensions/GraphPrinter.java
@@ -0,0 +1,284 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package graph.util.extensions;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+import graph.Attribute;
+import graph.Edge;
+import graph.Graph;
+import graph.Node;
+
+public class GraphPrinter {
+
+ private Graph graph;
+ private int lastPrinted;
+ private StringBuffer result;
+
+ public GraphPrinter(Graph graph) {
+ this.graph = graph;
+ this.lastPrinted = -1;
+ }
+
+ private List<ExtendedNode> getExtendedNodes(Graph graph) {
+ List<ExtendedNode> extNodes = new ArrayList<ExtendedNode>();
+ // create extended nodes
+ for (Node n : graph.getNodes()) {
+ extNodes.add(new ExtendedNode(n));
+ }
+ // add predecessor and successors
+ for (ExtendedNode extNode : extNodes) {
+ for (Edge edge : graph.getEdges()) {
+ if (extNode.getNode() == edge.getTarget()) {
+ extNode.setPredecessor(getExtendedNode(extNodes, edge.getSource()));
+ }
+ if (extNode.getNode() == edge.getSource()) {
+ extNode.addSuccessor(getExtendedNode(extNodes, edge.getTarget()));
+ }
+ }
+ }
+ // reduce roots
+ List<ExtendedNode> rootExtNodes = new ArrayList<ExtendedNode>();
+ for (ExtendedNode extNode : extNodes) {
+ if (extNode.getPredecessor() == null) {
+ rootExtNodes.add(extNode);
+ }
+ }
+ return rootExtNodes;
+ }
+
+ private ExtendedNode getExtendedNode(List<ExtendedNode> extNodes, Node node) {
+ for (ExtendedNode extNode : extNodes) {
+ if (extNode.getNode() == node) {
+ return extNode;
+ }
+ }
+ return null;
+ }
+
+ public void printDocument() {
+ result = new StringBuffer(printPreambel());
+ result.append(Constants.BEGIN_DOCUMENT);
+ result.append(printGraph());
+ result.append(Constants.END_DOCUMENT);
+ saveFile();
+ }
+
+ public String printPreambel() {
+ StringBuffer preambel = new StringBuffer(Constants.DOCUMENTCLASS);
+ preambel.append(Constants.TIKZ_CELLULAR);
+ preambel.append(Constants.TIKZ_VCOND);
+ preambel.append(Constants.TIKZ_EXTENSION);
+ preambel.append(Constants.AMSSYMB);
+ return preambel.toString();
+ }
+
+ public String printPreambel2() {
+ StringBuffer preambel = new StringBuffer(Constants.DOCUMENTCLASS2);
+ preambel.append(Constants.TIKZ_CELLULAR);
+ preambel.append(Constants.TIKZ_VCOND);
+ preambel.append(Constants.TIKZ_EXTENSION);
+ preambel.append(Constants.TIKZ_ARROWS);
+ preambel.append(Constants.AMSSYMB);
+ return preambel.toString();
+ }
+
+ public String printGraph() {
+ StringBuffer ret;
+ if (graph.getNodes().isEmpty()) {
+ ret = new StringBuffer(Constants.EMPTYSET);
+ } else {
+ ret = new StringBuffer(Constants.TIKZ + Constants.SETBRACKETOPEN);
+ ret.append(printExtendedNodes(getExtendedNodes(graph), false));
+ for (Edge edge : graph.getEdges()) {
+ ret.append(printEdge(edge));
+ }
+ ret.append(Constants.SETBRACKETCLOSE);
+ }
+ lastPrinted = -1;
+ return ret.toString();
+ }
+
+ private String printEdge(Edge edge) {
+ EList<Node> nodes = graph.getNodes();
+ StringBuffer ret;
+ if (edge.getType().isContainment())
+ ret = new StringBuffer(
+ Constants.DRAWCONTAINMENT + getNodeName(nodes, edge.getSource()) + Constants.BRACKETCLOSE);
+ else
+ ret = new StringBuffer(Constants.DRAW + getNodeName(nodes, edge.getSource()) + Constants.BRACKETCLOSE);
+ ret.append(Constants.TONODE + edge.getType().getName() + Constants.SETBRACKETCLOSE);
+ ret.append(Constants.BRACKETOPEN + getNodeName(nodes, edge.getTarget()) + Constants.BRACKETCLOSE
+ + Constants.SEMICOLON + Constants.NEWLINE);
+ return ret.toString();
+ }
+
+ private String printExtendedNodes(List<ExtendedNode> extendedNodes, boolean succ) {
+ int source = -1;
+ if (succ && !extendedNodes.isEmpty()) {
+ source = graph.getNodes().indexOf(extendedNodes.get(0).getPredecessor().getNode());
+ }
+ StringBuffer ret = new StringBuffer();
+ for (int i = 0; i < extendedNodes.size(); i++) {
+ ret.append(printNode(extendedNodes.get(i).getNode(), i, succ, source));
+ this.lastPrinted = graph.getNodes().indexOf(extendedNodes.get(i).getNode());
+ }
+ for (int i = 0; i < extendedNodes.size(); i++) {
+ ret.append(printExtendedNodes(extendedNodes.get(i).getSuccessors(), true));
+ }
+ return ret.toString();
+ }
+
+ private String printNode(Node node, int index, boolean succ, int source) {
+ EList<Node> nodes = graph.getNodes();
+ String sro = "";
+ if (lastPrinted > -1) {
+ sro = Constants.COMMA;
+ if (source < 0) {
+ sro += " strictly below of= " + getNodeName(nodes, nodes.get(lastPrinted)) + ",node distance=4em";
+ } else {
+ sro += " strictly right of= " + getNodeName(nodes, nodes.get(source)) + ",node distance=4em";
+ }
+ if (succ && index > 0) {
+ if (index == 1) {
+ sro += Constants.COMMA + " above=4ex";
+ } else {
+ sro += Constants.COMMA + " below=4ex";
+ }
+ }
+ }
+ StringBuffer ret = new StringBuffer(
+ Constants.NODE + Constants.BRACKETOPEN + getNodeName(nodes, node) + Constants.BRACKETCLOSE);
+ if (node.getAttributes().isEmpty()) {
+ ret.append(Constants.SCLASS + sro + Constants.CLASSCLOSE + Constants.SETBRACKETOPEN);
+ if (node.getName() != null && !node.getName().isEmpty()) {
+ ret.append(node.getName());
+ }
+ ret.append(Constants.COLON + node.getType().getName());
+ ret.append(Constants.SETBRACKETCLOSE);
+ } else {
+ ret.append(Constants.NORMALCLASS + sro + Constants.CLASSCLOSE + Constants.SETBRACKETOPEN);
+ ret.append(Constants.GNODELABELCLASS + Constants.SETBRACKETOPEN);
+ if (node.getName() != null && !node.getName().isEmpty()) {
+ ret.append(node.getName());
+ }
+ ret.append(Constants.COLON + node.getType().getName() + Constants.SETBRACKETCLOSE);
+ if (!node.getAttributes().isEmpty())
+ ret.append(Constants.SETBRACKETOPEN);
+ for (Attribute attr : node.getAttributes()) {
+ if (node.getAttributes().indexOf(attr) != 0)
+ ret.append(Constants.DOUBLEBS);
+ ret.append(printAttribute(attr));
+ }
+ if (!node.getAttributes().isEmpty())
+ ret.append(Constants.SETBRACKETCLOSE);
+ ret.append(Constants.SETBRACKETCLOSE);
+ }
+ ret.append(Constants.SEMICOLON + Constants.NEWLINE);
+ return ret.toString();
+ }
+
+ private String getNodeName(EList<Node> nodes, Node n) {
+ if (n.getName() != null && !n.getName().isEmpty()) {
+ return n.getName();
+ } else {
+ return "n" + String.valueOf(nodes.indexOf(n));
+ }
+ }
+
+ private String printAttribute(Attribute attr) {
+ StringBuffer ret = new StringBuffer(attr.getType().getName());
+ ret.append(Constants.SPACE);
+ ret.append(printOp(attr.getOp()));
+ ret.append(Constants.SPACE);
+ if (attr.getValue() == null || attr.getValue().isEmpty())
+ ret.append("' '");
+ else
+ ret.append(attr.getValue());
+ return ret.toString();
+ }
+
+ private String printOp(String op) {
+ // TODO to be extended
+ if (op.equals(Constants.GEQ)) {
+ return Constants.$GEQ$;
+ }
+ if (op.equals(Constants.NOTEQUALS)) {
+ return Constants.$NOTEQUALS$;
+ }
+
+ if (op.equals(Constants.NOTEQUALS2)) {
+ return Constants.$NOTEQUALS2$;
+ }
+
+ if (op.equals(Constants.GRTH)) {
+ return Constants.$GRTH$;
+ }
+ if (op.equals(Constants.EQUALS)) {
+ return Constants.$EQUALS$;
+ }
+ if (op.equals(Constants.LSTH)) {
+ return Constants.$LSTH$;
+ }
+ return "TODO";
+ }
+
+ private void saveFile() {
+ URI uri = getActualProject().getLocationURI();
+ String path = uri.getPath().concat(Constants.TEXFOLDER + Constants.GRAPH + Constants.TEX);
+ File file = new File(path);
+ Writer writer = null;
+ try {
+ writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file)));
+ writer.write(result.toString());
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ writer.close();
+ getActualProject().refreshLocal(IProject.DEPTH_INFINITE, null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @SuppressWarnings("finally")
+ private IProject getActualProject() {
+ IProject actualProject = null;
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ try {
+ IEditorPart editorPart = window.getActivePage().getActiveEditor();
+ if (editorPart != null) {
+ IEditorInput input = editorPart.getEditorInput();
+ if (input instanceof IFileEditorInput) {
+ IFileEditorInput fileInput = (IFileEditorInput) input;
+ actualProject = fileInput.getFile().getProject();
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ return actualProject;
+ }
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Condition.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Condition.java
new file mode 100644
index 0000000..9982fe8
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Condition.java
@@ -0,0 +1,106 @@
+/**
+ */
+package laxcondition;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Condition</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.Condition#getTypeGraph <em>Type Graph</em>}</li>
+ * <li>{@link laxcondition.Condition#getName <em>Name</em>}</li>
+ * <li>{@link laxcondition.Condition#getLaxCondition <em>Lax Condition</em>}</li>
+ * </ul>
+ *
+ * @see laxcondition.LaxconditionPackage#getCondition()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='TypeGraphConsistency'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot TypeGraphConsistency='graph_0::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)'"
+ * @generated
+ */
+public interface Condition extends EObject {
+ /**
+ * Returns the value of the '<em><b>Type Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Graph</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Graph</em>' reference.
+ * @see #setTypeGraph(EPackage)
+ * @see laxcondition.LaxconditionPackage#getCondition_TypeGraph()
+ * @model required="true"
+ * @generated
+ */
+ EPackage getTypeGraph();
+
+ /**
+ * Sets the value of the '{@link laxcondition.Condition#getTypeGraph <em>Type Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type Graph</em>' reference.
+ * @see #getTypeGraph()
+ * @generated
+ */
+ void setTypeGraph(EPackage value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see laxcondition.LaxconditionPackage#getCondition_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link laxcondition.Condition#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Lax Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Lax Condition</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Lax Condition</em>' containment reference.
+ * @see #setLaxCondition(LaxCondition)
+ * @see laxcondition.LaxconditionPackage#getCondition_LaxCondition()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ LaxCondition getLaxCondition();
+
+ /**
+ * Sets the value of the '{@link laxcondition.Condition#getLaxCondition <em>Lax Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Lax Condition</em>' containment reference.
+ * @see #getLaxCondition()
+ * @generated
+ */
+ void setLaxCondition(LaxCondition value);
+
+} // Condition
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Formula.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Formula.java
new file mode 100644
index 0000000..bbe2968
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Formula.java
@@ -0,0 +1,74 @@
+/**
+ */
+package laxcondition;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Formula</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.Formula#getOp <em>Op</em>}</li>
+ * <li>{@link laxcondition.Formula#getArguments <em>Arguments</em>}</li>
+ * </ul>
+ *
+ * @see laxcondition.LaxconditionPackage#getFormula()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='OneArgumentForNOT AtLeastTwoArgumentForANDOR TwoArgumentForIMPLEQUALXOR'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot OneArgumentForNOT='(self.op = Operator::NOT) implies (self.arguments -> size() = 1)' AtLeastTwoArgumentForANDOR='((self.op = Operator::AND) or (self.op = Operator::OR)) implies (self.arguments -> size() > 1)' TwoArgumentForIMPLEQUALXOR='((self.op = Operator::IMPLIES) or (self.op = Operator::EQUIVALENT) or (self.op = Operator::XOR)) implies (self.arguments -> size() = 2)'"
+ * @generated
+ */
+public interface Formula extends LaxCondition {
+ /**
+ * Returns the value of the '<em><b>Op</b></em>' attribute.
+ * The default value is <code>"NOT"</code>.
+ * The literals are from the enumeration {@link laxcondition.Operator}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Op</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Op</em>' attribute.
+ * @see laxcondition.Operator
+ * @see #setOp(Operator)
+ * @see laxcondition.LaxconditionPackage#getFormula_Op()
+ * @model default="NOT" required="true"
+ * @generated
+ */
+ Operator getOp();
+
+ /**
+ * Sets the value of the '{@link laxcondition.Formula#getOp <em>Op</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Op</em>' attribute.
+ * @see laxcondition.Operator
+ * @see #getOp()
+ * @generated
+ */
+ void setOp(Operator value);
+
+ /**
+ * Returns the value of the '<em><b>Arguments</b></em>' containment reference list.
+ * The list contents are of type {@link laxcondition.LaxCondition}.
+ * It is bidirectional and its opposite is '{@link laxcondition.LaxCondition#getFormula <em>Formula</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Arguments</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Arguments</em>' containment reference list.
+ * @see laxcondition.LaxconditionPackage#getFormula_Arguments()
+ * @see laxcondition.LaxCondition#getFormula
+ * @model opposite="formula" containment="true" required="true"
+ * @generated
+ */
+ EList<LaxCondition> getArguments();
+
+} // Formula
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxCondition.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxCondition.java
new file mode 100644
index 0000000..768c742
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxCondition.java
@@ -0,0 +1,52 @@
+/**
+ */
+package laxcondition;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Lax Condition</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.LaxCondition#getFormula <em>Formula</em>}</li>
+ * </ul>
+ *
+ * @see laxcondition.LaxconditionPackage#getLaxCondition()
+ * @model abstract="true"
+ * @generated
+ */
+public interface LaxCondition extends EObject {
+ /**
+ * Returns the value of the '<em><b>Formula</b></em>' container reference.
+ * It is bidirectional and its opposite is '{@link laxcondition.Formula#getArguments <em>Arguments</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Formula</em>' container reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Formula</em>' container reference.
+ * @see #setFormula(Formula)
+ * @see laxcondition.LaxconditionPackage#getLaxCondition_Formula()
+ * @see laxcondition.Formula#getArguments
+ * @model opposite="arguments" transient="false"
+ * @generated
+ */
+ Formula getFormula();
+
+ /**
+ * Sets the value of the '{@link laxcondition.LaxCondition#getFormula <em>Formula</em>}' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Formula</em>' container reference.
+ * @see #getFormula()
+ * @generated
+ */
+ void setFormula(Formula value);
+
+} // LaxCondition
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxconditionFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxconditionFactory.java
new file mode 100644
index 0000000..acbb796
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxconditionFactory.java
@@ -0,0 +1,78 @@
+/**
+ */
+package laxcondition;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionPackage
+ * @generated
+ */
+public interface LaxconditionFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ LaxconditionFactory eINSTANCE = laxcondition.impl.LaxconditionFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Condition</em>'.
+ * @generated
+ */
+ Condition createCondition();
+
+ /**
+ * Returns a new object of class '<em>Quantified Lax Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quantified Lax Condition</em>'.
+ * @generated
+ */
+ QuantifiedLaxCondition createQuantifiedLaxCondition();
+
+ /**
+ * Returns a new object of class '<em>True</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>True</em>'.
+ * @generated
+ */
+ True createTrue();
+
+ /**
+ * Returns a new object of class '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Formula</em>'.
+ * @generated
+ */
+ Formula createFormula();
+
+ /**
+ * Returns a new object of class '<em>Variable</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Variable</em>'.
+ * @generated
+ */
+ Variable createVariable();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ LaxconditionPackage getLaxconditionPackage();
+
+} //LaxconditionFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxconditionPackage.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxconditionPackage.java
new file mode 100644
index 0000000..2878925
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/LaxconditionPackage.java
@@ -0,0 +1,771 @@
+/**
+ */
+package laxcondition;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionFactory
+ * @model kind="package"
+ * annotation="http://www.eclipse.org/OCL/Import ecore='http://www.eclipse.org/emf/2002/Ecore' graph_0='graph.ecore#/'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore invocationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' settingDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' validationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot'"
+ * @generated
+ */
+public interface LaxconditionPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "laxcondition";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.example.org/laxcondition";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "laxcondition";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ LaxconditionPackage eINSTANCE = laxcondition.impl.LaxconditionPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link laxcondition.impl.ConditionImpl <em>Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.ConditionImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getCondition()
+ * @generated
+ */
+ int CONDITION = 0;
+
+ /**
+ * The feature id for the '<em><b>Type Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONDITION__TYPE_GRAPH = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONDITION__NAME = 1;
+
+ /**
+ * The feature id for the '<em><b>Lax Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONDITION__LAX_CONDITION = 2;
+
+ /**
+ * The number of structural features of the '<em>Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONDITION_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONDITION_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link laxcondition.impl.LaxConditionImpl <em>Lax Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.LaxConditionImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getLaxCondition()
+ * @generated
+ */
+ int LAX_CONDITION = 1;
+
+ /**
+ * The feature id for the '<em><b>Formula</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAX_CONDITION__FORMULA = 0;
+
+ /**
+ * The number of structural features of the '<em>Lax Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAX_CONDITION_FEATURE_COUNT = 1;
+
+ /**
+ * The number of operations of the '<em>Lax Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAX_CONDITION_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link laxcondition.impl.QuantifiedLaxConditionImpl <em>Quantified Lax Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.QuantifiedLaxConditionImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getQuantifiedLaxCondition()
+ * @generated
+ */
+ int QUANTIFIED_LAX_CONDITION = 2;
+
+ /**
+ * The feature id for the '<em><b>Formula</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION__FORMULA = LAX_CONDITION__FORMULA;
+
+ /**
+ * The feature id for the '<em><b>Graph</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION__GRAPH = LAX_CONDITION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION__CONDITION = LAX_CONDITION_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Quantifier</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION__QUANTIFIER = LAX_CONDITION_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Variables</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION__VARIABLES = LAX_CONDITION_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Quantified Lax Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION_FEATURE_COUNT = LAX_CONDITION_FEATURE_COUNT + 4;
+
+ /**
+ * The number of operations of the '<em>Quantified Lax Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_LAX_CONDITION_OPERATION_COUNT = LAX_CONDITION_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link laxcondition.impl.TrueImpl <em>True</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.TrueImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getTrue()
+ * @generated
+ */
+ int TRUE = 3;
+
+ /**
+ * The feature id for the '<em><b>Formula</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE__FORMULA = LAX_CONDITION__FORMULA;
+
+ /**
+ * The number of structural features of the '<em>True</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE_FEATURE_COUNT = LAX_CONDITION_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>True</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE_OPERATION_COUNT = LAX_CONDITION_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link laxcondition.impl.FormulaImpl <em>Formula</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.FormulaImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getFormula()
+ * @generated
+ */
+ int FORMULA = 4;
+
+ /**
+ * The feature id for the '<em><b>Formula</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__FORMULA = LAX_CONDITION__FORMULA;
+
+ /**
+ * The feature id for the '<em><b>Op</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__OP = LAX_CONDITION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Arguments</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__ARGUMENTS = LAX_CONDITION_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Formula</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA_FEATURE_COUNT = LAX_CONDITION_FEATURE_COUNT + 2;
+
+ /**
+ * The number of operations of the '<em>Formula</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA_OPERATION_COUNT = LAX_CONDITION_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link laxcondition.impl.VariableImpl <em>Variable</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.VariableImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getVariable()
+ * @generated
+ */
+ int VARIABLE = 5;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VARIABLE__NAME = 0;
+
+ /**
+ * The number of structural features of the '<em>Variable</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VARIABLE_FEATURE_COUNT = 1;
+
+ /**
+ * The number of operations of the '<em>Variable</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VARIABLE_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link laxcondition.Quantifier <em>Quantifier</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.Quantifier
+ * @see laxcondition.impl.LaxconditionPackageImpl#getQuantifier()
+ * @generated
+ */
+ int QUANTIFIER = 6;
+
+ /**
+ * The meta object id for the '{@link laxcondition.Operator <em>Operator</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.Operator
+ * @see laxcondition.impl.LaxconditionPackageImpl#getOperator()
+ * @generated
+ */
+ int OPERATOR = 7;
+
+
+ /**
+ * Returns the meta object for class '{@link laxcondition.Condition <em>Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Condition</em>'.
+ * @see laxcondition.Condition
+ * @generated
+ */
+ EClass getCondition();
+
+ /**
+ * Returns the meta object for the reference '{@link laxcondition.Condition#getTypeGraph <em>Type Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Type Graph</em>'.
+ * @see laxcondition.Condition#getTypeGraph()
+ * @see #getCondition()
+ * @generated
+ */
+ EReference getCondition_TypeGraph();
+
+ /**
+ * Returns the meta object for the attribute '{@link laxcondition.Condition#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see laxcondition.Condition#getName()
+ * @see #getCondition()
+ * @generated
+ */
+ EAttribute getCondition_Name();
+
+ /**
+ * Returns the meta object for the containment reference '{@link laxcondition.Condition#getLaxCondition <em>Lax Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Lax Condition</em>'.
+ * @see laxcondition.Condition#getLaxCondition()
+ * @see #getCondition()
+ * @generated
+ */
+ EReference getCondition_LaxCondition();
+
+ /**
+ * Returns the meta object for class '{@link laxcondition.LaxCondition <em>Lax Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Lax Condition</em>'.
+ * @see laxcondition.LaxCondition
+ * @generated
+ */
+ EClass getLaxCondition();
+
+ /**
+ * Returns the meta object for the container reference '{@link laxcondition.LaxCondition#getFormula <em>Formula</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the container reference '<em>Formula</em>'.
+ * @see laxcondition.LaxCondition#getFormula()
+ * @see #getLaxCondition()
+ * @generated
+ */
+ EReference getLaxCondition_Formula();
+
+ /**
+ * Returns the meta object for class '{@link laxcondition.QuantifiedLaxCondition <em>Quantified Lax Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Quantified Lax Condition</em>'.
+ * @see laxcondition.QuantifiedLaxCondition
+ * @generated
+ */
+ EClass getQuantifiedLaxCondition();
+
+ /**
+ * Returns the meta object for the containment reference '{@link laxcondition.QuantifiedLaxCondition#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Graph</em>'.
+ * @see laxcondition.QuantifiedLaxCondition#getGraph()
+ * @see #getQuantifiedLaxCondition()
+ * @generated
+ */
+ EReference getQuantifiedLaxCondition_Graph();
+
+ /**
+ * Returns the meta object for the containment reference '{@link laxcondition.QuantifiedLaxCondition#getCondition <em>Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Condition</em>'.
+ * @see laxcondition.QuantifiedLaxCondition#getCondition()
+ * @see #getQuantifiedLaxCondition()
+ * @generated
+ */
+ EReference getQuantifiedLaxCondition_Condition();
+
+ /**
+ * Returns the meta object for the attribute '{@link laxcondition.QuantifiedLaxCondition#getQuantifier <em>Quantifier</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Quantifier</em>'.
+ * @see laxcondition.QuantifiedLaxCondition#getQuantifier()
+ * @see #getQuantifiedLaxCondition()
+ * @generated
+ */
+ EAttribute getQuantifiedLaxCondition_Quantifier();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link laxcondition.QuantifiedLaxCondition#getVariables <em>Variables</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Variables</em>'.
+ * @see laxcondition.QuantifiedLaxCondition#getVariables()
+ * @see #getQuantifiedLaxCondition()
+ * @generated
+ */
+ EReference getQuantifiedLaxCondition_Variables();
+
+ /**
+ * Returns the meta object for class '{@link laxcondition.True <em>True</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>True</em>'.
+ * @see laxcondition.True
+ * @generated
+ */
+ EClass getTrue();
+
+ /**
+ * Returns the meta object for class '{@link laxcondition.Formula <em>Formula</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Formula</em>'.
+ * @see laxcondition.Formula
+ * @generated
+ */
+ EClass getFormula();
+
+ /**
+ * Returns the meta object for the attribute '{@link laxcondition.Formula#getOp <em>Op</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Op</em>'.
+ * @see laxcondition.Formula#getOp()
+ * @see #getFormula()
+ * @generated
+ */
+ EAttribute getFormula_Op();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link laxcondition.Formula#getArguments <em>Arguments</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Arguments</em>'.
+ * @see laxcondition.Formula#getArguments()
+ * @see #getFormula()
+ * @generated
+ */
+ EReference getFormula_Arguments();
+
+ /**
+ * Returns the meta object for class '{@link laxcondition.Variable <em>Variable</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Variable</em>'.
+ * @see laxcondition.Variable
+ * @generated
+ */
+ EClass getVariable();
+
+ /**
+ * Returns the meta object for the attribute '{@link laxcondition.Variable#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see laxcondition.Variable#getName()
+ * @see #getVariable()
+ * @generated
+ */
+ EAttribute getVariable_Name();
+
+ /**
+ * Returns the meta object for enum '{@link laxcondition.Quantifier <em>Quantifier</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Quantifier</em>'.
+ * @see laxcondition.Quantifier
+ * @generated
+ */
+ EEnum getQuantifier();
+
+ /**
+ * Returns the meta object for enum '{@link laxcondition.Operator <em>Operator</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Operator</em>'.
+ * @see laxcondition.Operator
+ * @generated
+ */
+ EEnum getOperator();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ LaxconditionFactory getLaxconditionFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link laxcondition.impl.ConditionImpl <em>Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.ConditionImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getCondition()
+ * @generated
+ */
+ EClass CONDITION = eINSTANCE.getCondition();
+
+ /**
+ * The meta object literal for the '<em><b>Type Graph</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference CONDITION__TYPE_GRAPH = eINSTANCE.getCondition_TypeGraph();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONDITION__NAME = eINSTANCE.getCondition_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Lax Condition</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference CONDITION__LAX_CONDITION = eINSTANCE.getCondition_LaxCondition();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.impl.LaxConditionImpl <em>Lax Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.LaxConditionImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getLaxCondition()
+ * @generated
+ */
+ EClass LAX_CONDITION = eINSTANCE.getLaxCondition();
+
+ /**
+ * The meta object literal for the '<em><b>Formula</b></em>' container reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LAX_CONDITION__FORMULA = eINSTANCE.getLaxCondition_Formula();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.impl.QuantifiedLaxConditionImpl <em>Quantified Lax Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.QuantifiedLaxConditionImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getQuantifiedLaxCondition()
+ * @generated
+ */
+ EClass QUANTIFIED_LAX_CONDITION = eINSTANCE.getQuantifiedLaxCondition();
+
+ /**
+ * The meta object literal for the '<em><b>Graph</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUANTIFIED_LAX_CONDITION__GRAPH = eINSTANCE.getQuantifiedLaxCondition_Graph();
+
+ /**
+ * The meta object literal for the '<em><b>Condition</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUANTIFIED_LAX_CONDITION__CONDITION = eINSTANCE.getQuantifiedLaxCondition_Condition();
+
+ /**
+ * The meta object literal for the '<em><b>Quantifier</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute QUANTIFIED_LAX_CONDITION__QUANTIFIER = eINSTANCE.getQuantifiedLaxCondition_Quantifier();
+
+ /**
+ * The meta object literal for the '<em><b>Variables</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUANTIFIED_LAX_CONDITION__VARIABLES = eINSTANCE.getQuantifiedLaxCondition_Variables();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.impl.TrueImpl <em>True</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.TrueImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getTrue()
+ * @generated
+ */
+ EClass TRUE = eINSTANCE.getTrue();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.impl.FormulaImpl <em>Formula</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.FormulaImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getFormula()
+ * @generated
+ */
+ EClass FORMULA = eINSTANCE.getFormula();
+
+ /**
+ * The meta object literal for the '<em><b>Op</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FORMULA__OP = eINSTANCE.getFormula_Op();
+
+ /**
+ * The meta object literal for the '<em><b>Arguments</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference FORMULA__ARGUMENTS = eINSTANCE.getFormula_Arguments();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.impl.VariableImpl <em>Variable</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.impl.VariableImpl
+ * @see laxcondition.impl.LaxconditionPackageImpl#getVariable()
+ * @generated
+ */
+ EClass VARIABLE = eINSTANCE.getVariable();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute VARIABLE__NAME = eINSTANCE.getVariable_Name();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.Quantifier <em>Quantifier</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.Quantifier
+ * @see laxcondition.impl.LaxconditionPackageImpl#getQuantifier()
+ * @generated
+ */
+ EEnum QUANTIFIER = eINSTANCE.getQuantifier();
+
+ /**
+ * The meta object literal for the '{@link laxcondition.Operator <em>Operator</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see laxcondition.Operator
+ * @see laxcondition.impl.LaxconditionPackageImpl#getOperator()
+ * @generated
+ */
+ EEnum OPERATOR = eINSTANCE.getOperator();
+
+ }
+
+} //LaxconditionPackage
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Operator.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Operator.java
new file mode 100644
index 0000000..bf742db
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Operator.java
@@ -0,0 +1,322 @@
+/**
+ */
+package laxcondition;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Operator</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionPackage#getOperator()
+ * @model
+ * @generated
+ */
+public enum Operator implements Enumerator {
+ /**
+ * The '<em><b>NOT</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #NOT_VALUE
+ * @generated
+ * @ordered
+ */
+ NOT(0, "NOT", "NOT"),
+
+ /**
+ * The '<em><b>AND</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #AND_VALUE
+ * @generated
+ * @ordered
+ */
+ AND(1, "AND", "AND"),
+
+ /**
+ * The '<em><b>OR</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #OR_VALUE
+ * @generated
+ * @ordered
+ */
+ OR(2, "OR", "OR"),
+
+ /**
+ * The '<em><b>IMPLIES</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #IMPLIES_VALUE
+ * @generated
+ * @ordered
+ */
+ IMPLIES(3, "IMPLIES", "IMPLIES"),
+
+ /**
+ * The '<em><b>EQUIVALENT</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #EQUIVALENT_VALUE
+ * @generated
+ * @ordered
+ */
+ EQUIVALENT(4, "EQUIVALENT", "EQUIVALENT"),
+
+ /**
+ * The '<em><b>XOR</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #XOR_VALUE
+ * @generated
+ * @ordered
+ */
+ XOR(5, "XOR", "XOR");
+
+ /**
+ * The '<em><b>NOT</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>NOT</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #NOT
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int NOT_VALUE = 0;
+
+ /**
+ * The '<em><b>AND</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>AND</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #AND
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int AND_VALUE = 1;
+
+ /**
+ * The '<em><b>OR</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>OR</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #OR
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int OR_VALUE = 2;
+
+ /**
+ * The '<em><b>IMPLIES</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>IMPLIES</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #IMPLIES
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int IMPLIES_VALUE = 3;
+
+ /**
+ * The '<em><b>EQUIVALENT</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>EQUIVALENT</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #EQUIVALENT
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int EQUIVALENT_VALUE = 4;
+
+ /**
+ * The '<em><b>XOR</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>XOR</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #XOR
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int XOR_VALUE = 5;
+
+ /**
+ * An array of all the '<em><b>Operator</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final Operator[] VALUES_ARRAY =
+ new Operator[] {
+ NOT,
+ AND,
+ OR,
+ IMPLIES,
+ EQUIVALENT,
+ XOR,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Operator</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<Operator> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Operator</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param literal the literal.
+ * @return the matching enumerator or <code>null</code>.
+ * @generated
+ */
+ public static Operator get(String literal) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ Operator result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Operator</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param name the name.
+ * @return the matching enumerator or <code>null</code>.
+ * @generated
+ */
+ public static Operator getByName(String name) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ Operator result = VALUES_ARRAY[i];
+ if (result.getName().equals(name)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Operator</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the integer value.
+ * @return the matching enumerator or <code>null</code>.
+ * @generated
+ */
+ public static Operator get(int value) {
+ switch (value) {
+ case NOT_VALUE: return NOT;
+ case AND_VALUE: return AND;
+ case OR_VALUE: return OR;
+ case IMPLIES_VALUE: return IMPLIES;
+ case EQUIVALENT_VALUE: return EQUIVALENT;
+ case XOR_VALUE: return XOR;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private Operator(int value, String name, String literal) {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral() {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ return literal;
+ }
+
+} //Operator
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/QuantifiedLaxCondition.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/QuantifiedLaxCondition.java
new file mode 100644
index 0000000..7ecedca
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/QuantifiedLaxCondition.java
@@ -0,0 +1,128 @@
+/**
+ */
+package laxcondition;
+
+import graph.Graph;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quantified Lax Condition</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.QuantifiedLaxCondition#getGraph <em>Graph</em>}</li>
+ * <li>{@link laxcondition.QuantifiedLaxCondition#getCondition <em>Condition</em>}</li>
+ * <li>{@link laxcondition.QuantifiedLaxCondition#getQuantifier <em>Quantifier</em>}</li>
+ * <li>{@link laxcondition.QuantifiedLaxCondition#getVariables <em>Variables</em>}</li>
+ * </ul>
+ *
+ * @see laxcondition.LaxconditionPackage#getQuantifiedLaxCondition()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='HostGraphConsistency'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot HostGraphConsistency='self.graph.edges -> forAll(e|self.graph.nodes -> includes(e.source) and self.graph.nodes -> includes(e.target))'"
+ * @generated
+ */
+public interface QuantifiedLaxCondition extends LaxCondition {
+ /**
+ * Returns the value of the '<em><b>Graph</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Graph</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Graph</em>' containment reference.
+ * @see #setGraph(Graph)
+ * @see laxcondition.LaxconditionPackage#getQuantifiedLaxCondition_Graph()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ Graph getGraph();
+
+ /**
+ * Sets the value of the '{@link laxcondition.QuantifiedLaxCondition#getGraph <em>Graph</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Graph</em>' containment reference.
+ * @see #getGraph()
+ * @generated
+ */
+ void setGraph(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Condition</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Condition</em>' containment reference.
+ * @see #setCondition(LaxCondition)
+ * @see laxcondition.LaxconditionPackage#getQuantifiedLaxCondition_Condition()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ LaxCondition getCondition();
+
+ /**
+ * Sets the value of the '{@link laxcondition.QuantifiedLaxCondition#getCondition <em>Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Condition</em>' containment reference.
+ * @see #getCondition()
+ * @generated
+ */
+ void setCondition(LaxCondition value);
+
+ /**
+ * Returns the value of the '<em><b>Quantifier</b></em>' attribute.
+ * The default value is <code>"EXISTS"</code>.
+ * The literals are from the enumeration {@link laxcondition.Quantifier}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quantifier</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quantifier</em>' attribute.
+ * @see laxcondition.Quantifier
+ * @see #setQuantifier(Quantifier)
+ * @see laxcondition.LaxconditionPackage#getQuantifiedLaxCondition_Quantifier()
+ * @model default="EXISTS" required="true"
+ * @generated
+ */
+ Quantifier getQuantifier();
+
+ /**
+ * Sets the value of the '{@link laxcondition.QuantifiedLaxCondition#getQuantifier <em>Quantifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Quantifier</em>' attribute.
+ * @see laxcondition.Quantifier
+ * @see #getQuantifier()
+ * @generated
+ */
+ void setQuantifier(Quantifier value);
+
+ /**
+ * Returns the value of the '<em><b>Variables</b></em>' containment reference list.
+ * The list contents are of type {@link laxcondition.Variable}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Variables</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Variables</em>' containment reference list.
+ * @see laxcondition.LaxconditionPackage#getQuantifiedLaxCondition_Variables()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Variable> getVariables();
+
+} // QuantifiedLaxCondition
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Quantifier.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Quantifier.java
new file mode 100644
index 0000000..d7501f8
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Quantifier.java
@@ -0,0 +1,214 @@
+/**
+ */
+package laxcondition;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Quantifier</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionPackage#getQuantifier()
+ * @model
+ * @generated
+ */
+public enum Quantifier implements Enumerator {
+ /**
+ * The '<em><b>EXISTS</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #EXISTS_VALUE
+ * @generated
+ * @ordered
+ */
+ EXISTS(0, "EXISTS", "EXISTS"),
+
+ /**
+ * The '<em><b>FORALL</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #FORALL_VALUE
+ * @generated
+ * @ordered
+ */
+ FORALL(1, "FORALL", "FORALL");
+
+ /**
+ * The '<em><b>EXISTS</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>EXISTS</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #EXISTS
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int EXISTS_VALUE = 0;
+
+ /**
+ * The '<em><b>FORALL</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>FORALL</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #FORALL
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int FORALL_VALUE = 1;
+
+ /**
+ * An array of all the '<em><b>Quantifier</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final Quantifier[] VALUES_ARRAY =
+ new Quantifier[] {
+ EXISTS,
+ FORALL,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Quantifier</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<Quantifier> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Quantifier</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param literal the literal.
+ * @return the matching enumerator or <code>null</code>.
+ * @generated
+ */
+ public static Quantifier get(String literal) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ Quantifier result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Quantifier</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param name the name.
+ * @return the matching enumerator or <code>null</code>.
+ * @generated
+ */
+ public static Quantifier getByName(String name) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ Quantifier result = VALUES_ARRAY[i];
+ if (result.getName().equals(name)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Quantifier</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the integer value.
+ * @return the matching enumerator or <code>null</code>.
+ * @generated
+ */
+ public static Quantifier get(int value) {
+ switch (value) {
+ case EXISTS_VALUE: return EXISTS;
+ case FORALL_VALUE: return FORALL;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private Quantifier(int value, String name, String literal) {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral() {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ return literal;
+ }
+
+} //Quantifier
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/True.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/True.java
new file mode 100644
index 0000000..fdb0fa2
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/True.java
@@ -0,0 +1,17 @@
+/**
+ */
+package laxcondition;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>True</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see laxcondition.LaxconditionPackage#getTrue()
+ * @model
+ * @generated
+ */
+public interface True extends LaxCondition {
+} // True
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Variable.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Variable.java
new file mode 100644
index 0000000..0155ac1
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/Variable.java
@@ -0,0 +1,50 @@
+/**
+ */
+package laxcondition;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Variable</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.Variable#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @see laxcondition.LaxconditionPackage#getVariable()
+ * @model
+ * @generated
+ */
+public interface Variable extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see laxcondition.LaxconditionPackage#getVariable_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link laxcondition.Variable#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // Variable
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/ConditionImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/ConditionImpl.java
new file mode 100644
index 0000000..578c761
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/ConditionImpl.java
@@ -0,0 +1,305 @@
+/**
+ */
+package laxcondition.impl;
+
+import laxcondition.Condition;
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Condition</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.impl.ConditionImpl#getTypeGraph <em>Type Graph</em>}</li>
+ * <li>{@link laxcondition.impl.ConditionImpl#getName <em>Name</em>}</li>
+ * <li>{@link laxcondition.impl.ConditionImpl#getLaxCondition <em>Lax Condition</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ConditionImpl extends MinimalEObjectImpl.Container implements Condition {
+ /**
+ * The cached value of the '{@link #getTypeGraph() <em>Type Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeGraph()
+ * @generated
+ * @ordered
+ */
+ protected EPackage typeGraph;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getLaxCondition() <em>Lax Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLaxCondition()
+ * @generated
+ * @ordered
+ */
+ protected LaxCondition laxCondition;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ConditionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LaxconditionPackage.Literals.CONDITION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage getTypeGraph() {
+ if (typeGraph != null && typeGraph.eIsProxy()) {
+ InternalEObject oldTypeGraph = (InternalEObject)typeGraph;
+ typeGraph = (EPackage)eResolveProxy(oldTypeGraph);
+ if (typeGraph != oldTypeGraph) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, LaxconditionPackage.CONDITION__TYPE_GRAPH, oldTypeGraph, typeGraph));
+ }
+ }
+ return typeGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage basicGetTypeGraph() {
+ return typeGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTypeGraph(EPackage newTypeGraph) {
+ EPackage oldTypeGraph = typeGraph;
+ typeGraph = newTypeGraph;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.CONDITION__TYPE_GRAPH, oldTypeGraph, typeGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.CONDITION__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxCondition getLaxCondition() {
+ return laxCondition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetLaxCondition(LaxCondition newLaxCondition, NotificationChain msgs) {
+ LaxCondition oldLaxCondition = laxCondition;
+ laxCondition = newLaxCondition;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LaxconditionPackage.CONDITION__LAX_CONDITION, oldLaxCondition, newLaxCondition);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLaxCondition(LaxCondition newLaxCondition) {
+ if (newLaxCondition != laxCondition) {
+ NotificationChain msgs = null;
+ if (laxCondition != null)
+ msgs = ((InternalEObject)laxCondition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LaxconditionPackage.CONDITION__LAX_CONDITION, null, msgs);
+ if (newLaxCondition != null)
+ msgs = ((InternalEObject)newLaxCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LaxconditionPackage.CONDITION__LAX_CONDITION, null, msgs);
+ msgs = basicSetLaxCondition(newLaxCondition, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.CONDITION__LAX_CONDITION, newLaxCondition, newLaxCondition));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LaxconditionPackage.CONDITION__LAX_CONDITION:
+ return basicSetLaxCondition(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LaxconditionPackage.CONDITION__TYPE_GRAPH:
+ if (resolve) return getTypeGraph();
+ return basicGetTypeGraph();
+ case LaxconditionPackage.CONDITION__NAME:
+ return getName();
+ case LaxconditionPackage.CONDITION__LAX_CONDITION:
+ return getLaxCondition();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LaxconditionPackage.CONDITION__TYPE_GRAPH:
+ setTypeGraph((EPackage)newValue);
+ return;
+ case LaxconditionPackage.CONDITION__NAME:
+ setName((String)newValue);
+ return;
+ case LaxconditionPackage.CONDITION__LAX_CONDITION:
+ setLaxCondition((LaxCondition)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.CONDITION__TYPE_GRAPH:
+ setTypeGraph((EPackage)null);
+ return;
+ case LaxconditionPackage.CONDITION__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case LaxconditionPackage.CONDITION__LAX_CONDITION:
+ setLaxCondition((LaxCondition)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.CONDITION__TYPE_GRAPH:
+ return typeGraph != null;
+ case LaxconditionPackage.CONDITION__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case LaxconditionPackage.CONDITION__LAX_CONDITION:
+ return laxCondition != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ConditionImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/FormulaImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/FormulaImpl.java
new file mode 100644
index 0000000..d612e61
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/FormulaImpl.java
@@ -0,0 +1,237 @@
+/**
+ */
+package laxcondition.impl;
+
+import java.util.Collection;
+
+import laxcondition.Formula;
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionPackage;
+import laxcondition.Operator;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Formula</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.impl.FormulaImpl#getOp <em>Op</em>}</li>
+ * <li>{@link laxcondition.impl.FormulaImpl#getArguments <em>Arguments</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class FormulaImpl extends LaxConditionImpl implements Formula {
+ /**
+ * The default value of the '{@link #getOp() <em>Op</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOp()
+ * @generated
+ * @ordered
+ */
+ protected static final Operator OP_EDEFAULT = Operator.NOT;
+
+ /**
+ * The cached value of the '{@link #getOp() <em>Op</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOp()
+ * @generated
+ * @ordered
+ */
+ protected Operator op = OP_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getArguments() <em>Arguments</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getArguments()
+ * @generated
+ * @ordered
+ */
+ protected EList<LaxCondition> arguments;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FormulaImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LaxconditionPackage.Literals.FORMULA;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Operator getOp() {
+ return op;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOp(Operator newOp) {
+ Operator oldOp = op;
+ op = newOp == null ? OP_EDEFAULT : newOp;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.FORMULA__OP, oldOp, op));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<LaxCondition> getArguments() {
+ if (arguments == null) {
+ arguments = new EObjectContainmentWithInverseEList<LaxCondition>(LaxCondition.class, this, LaxconditionPackage.FORMULA__ARGUMENTS, LaxconditionPackage.LAX_CONDITION__FORMULA);
+ }
+ return arguments;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getArguments()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ return ((InternalEList<?>)getArguments()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LaxconditionPackage.FORMULA__OP:
+ return getOp();
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ return getArguments();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LaxconditionPackage.FORMULA__OP:
+ setOp((Operator)newValue);
+ return;
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ getArguments().clear();
+ getArguments().addAll((Collection<? extends LaxCondition>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.FORMULA__OP:
+ setOp(OP_EDEFAULT);
+ return;
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ getArguments().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.FORMULA__OP:
+ return op != OP_EDEFAULT;
+ case LaxconditionPackage.FORMULA__ARGUMENTS:
+ return arguments != null && !arguments.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (op: ");
+ result.append(op);
+ result.append(')');
+ return result.toString();
+ }
+
+} //FormulaImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxConditionImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxConditionImpl.java
new file mode 100644
index 0000000..e701a6e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxConditionImpl.java
@@ -0,0 +1,196 @@
+/**
+ */
+package laxcondition.impl;
+
+import laxcondition.Formula;
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Lax Condition</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.impl.LaxConditionImpl#getFormula <em>Formula</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public abstract class LaxConditionImpl extends MinimalEObjectImpl.Container implements LaxCondition {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LaxConditionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LaxconditionPackage.Literals.LAX_CONDITION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Formula getFormula() {
+ if (eContainerFeatureID() != LaxconditionPackage.LAX_CONDITION__FORMULA) return null;
+ return (Formula)eInternalContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetFormula(Formula newFormula, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject)newFormula, LaxconditionPackage.LAX_CONDITION__FORMULA, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFormula(Formula newFormula) {
+ if (newFormula != eInternalContainer() || (eContainerFeatureID() != LaxconditionPackage.LAX_CONDITION__FORMULA && newFormula != null)) {
+ if (EcoreUtil.isAncestor(this, newFormula))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newFormula != null)
+ msgs = ((InternalEObject)newFormula).eInverseAdd(this, LaxconditionPackage.FORMULA__ARGUMENTS, Formula.class, msgs);
+ msgs = basicSetFormula(newFormula, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.LAX_CONDITION__FORMULA, newFormula, newFormula));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetFormula((Formula)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ return basicSetFormula(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID()) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ return eInternalContainer().eInverseRemove(this, LaxconditionPackage.FORMULA__ARGUMENTS, Formula.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ return getFormula();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ setFormula((Formula)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ setFormula((Formula)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.LAX_CONDITION__FORMULA:
+ return getFormula() != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //LaxConditionImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxconditionFactoryImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxconditionFactoryImpl.java
new file mode 100644
index 0000000..417b74b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxconditionFactoryImpl.java
@@ -0,0 +1,214 @@
+/**
+ */
+package laxcondition.impl;
+
+import laxcondition.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxconditionFactoryImpl extends EFactoryImpl implements LaxconditionFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static LaxconditionFactory init() {
+ try {
+ LaxconditionFactory theLaxconditionFactory = (LaxconditionFactory)EPackage.Registry.INSTANCE.getEFactory(LaxconditionPackage.eNS_URI);
+ if (theLaxconditionFactory != null) {
+ return theLaxconditionFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new LaxconditionFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case LaxconditionPackage.CONDITION: return createCondition();
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION: return createQuantifiedLaxCondition();
+ case LaxconditionPackage.TRUE: return createTrue();
+ case LaxconditionPackage.FORMULA: return createFormula();
+ case LaxconditionPackage.VARIABLE: return createVariable();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue) {
+ switch (eDataType.getClassifierID()) {
+ case LaxconditionPackage.QUANTIFIER:
+ return createQuantifierFromString(eDataType, initialValue);
+ case LaxconditionPackage.OPERATOR:
+ return createOperatorFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue) {
+ switch (eDataType.getClassifierID()) {
+ case LaxconditionPackage.QUANTIFIER:
+ return convertQuantifierToString(eDataType, instanceValue);
+ case LaxconditionPackage.OPERATOR:
+ return convertOperatorToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Condition createCondition() {
+ ConditionImpl condition = new ConditionImpl();
+ return condition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuantifiedLaxCondition createQuantifiedLaxCondition() {
+ QuantifiedLaxConditionImpl quantifiedLaxCondition = new QuantifiedLaxConditionImpl();
+ return quantifiedLaxCondition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public True createTrue() {
+ TrueImpl true_ = new TrueImpl();
+ return true_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Formula createFormula() {
+ FormulaImpl formula = new FormulaImpl();
+ return formula;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Variable createVariable() {
+ VariableImpl variable = new VariableImpl();
+ return variable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quantifier createQuantifierFromString(EDataType eDataType, String initialValue) {
+ Quantifier result = Quantifier.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertQuantifierToString(EDataType eDataType, Object instanceValue) {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Operator createOperatorFromString(EDataType eDataType, String initialValue) {
+ Operator result = Operator.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertOperatorToString(EDataType eDataType, Object instanceValue) {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionPackage getLaxconditionPackage() {
+ return (LaxconditionPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static LaxconditionPackage getPackage() {
+ return LaxconditionPackage.eINSTANCE;
+ }
+
+} //LaxconditionFactoryImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxconditionPackageImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxconditionPackageImpl.java
new file mode 100644
index 0000000..771b02f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/LaxconditionPackageImpl.java
@@ -0,0 +1,577 @@
+/**
+ */
+package laxcondition.impl;
+
+import graph.GraphPackage;
+
+import graph.impl.GraphPackageImpl;
+
+import laxcondition.Condition;
+import laxcondition.Formula;
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionFactory;
+import laxcondition.LaxconditionPackage;
+import laxcondition.Operator;
+import laxcondition.QuantifiedLaxCondition;
+import laxcondition.Quantifier;
+import laxcondition.True;
+import laxcondition.Variable;
+
+import laxcondition.util.LaxconditionValidator;
+
+import nestedcondition.NestedconditionPackage;
+
+import nestedcondition.impl.NestedconditionPackageImpl;
+
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+import nestedconstraintmodel.impl.NestedconstraintmodelPackageImpl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EValidator;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LaxconditionPackageImpl extends EPackageImpl implements LaxconditionPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass conditionEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass laxConditionEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass quantifiedLaxConditionEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass trueEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass formulaEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass variableEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum quantifierEEnum = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum operatorEEnum = 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 laxcondition.LaxconditionPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private LaxconditionPackageImpl() {
+ super(eNS_URI, LaxconditionFactory.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 LaxconditionPackage#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 LaxconditionPackage init() {
+ if (isInited) return (LaxconditionPackage)EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI);
+
+ // Obtain or create and register package
+ LaxconditionPackageImpl theLaxconditionPackage = (LaxconditionPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof LaxconditionPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new LaxconditionPackageImpl());
+
+ isInited = true;
+
+ // Obtain or create and register interdependencies
+ NestedconstraintmodelPackageImpl theNestedconstraintmodelPackage = (NestedconstraintmodelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI) instanceof NestedconstraintmodelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI) : NestedconstraintmodelPackage.eINSTANCE);
+ NestedconditionPackageImpl theNestedconditionPackage = (NestedconditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI) instanceof NestedconditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI) : NestedconditionPackage.eINSTANCE);
+ GraphPackageImpl theGraphPackage = (GraphPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI) instanceof GraphPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI) : GraphPackage.eINSTANCE);
+
+ // Create package meta-data objects
+ theLaxconditionPackage.createPackageContents();
+ theNestedconstraintmodelPackage.createPackageContents();
+ theNestedconditionPackage.createPackageContents();
+ theGraphPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theLaxconditionPackage.initializePackageContents();
+ theNestedconstraintmodelPackage.initializePackageContents();
+ theNestedconditionPackage.initializePackageContents();
+ theGraphPackage.initializePackageContents();
+
+ // Register package validator
+ EValidator.Registry.INSTANCE.put
+ (theLaxconditionPackage,
+ new EValidator.Descriptor() {
+ public EValidator getEValidator() {
+ return LaxconditionValidator.INSTANCE;
+ }
+ });
+
+ // Mark meta-data to indicate it can't be changed
+ theLaxconditionPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(LaxconditionPackage.eNS_URI, theLaxconditionPackage);
+ return theLaxconditionPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getCondition() {
+ return conditionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCondition_TypeGraph() {
+ return (EReference)conditionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCondition_Name() {
+ return (EAttribute)conditionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCondition_LaxCondition() {
+ return (EReference)conditionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getLaxCondition() {
+ return laxConditionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLaxCondition_Formula() {
+ return (EReference)laxConditionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getQuantifiedLaxCondition() {
+ return quantifiedLaxConditionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuantifiedLaxCondition_Graph() {
+ return (EReference)quantifiedLaxConditionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuantifiedLaxCondition_Condition() {
+ return (EReference)quantifiedLaxConditionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getQuantifiedLaxCondition_Quantifier() {
+ return (EAttribute)quantifiedLaxConditionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuantifiedLaxCondition_Variables() {
+ return (EReference)quantifiedLaxConditionEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getTrue() {
+ return trueEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getFormula() {
+ return formulaEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getFormula_Op() {
+ return (EAttribute)formulaEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getFormula_Arguments() {
+ return (EReference)formulaEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getVariable() {
+ return variableEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getVariable_Name() {
+ return (EAttribute)variableEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EEnum getQuantifier() {
+ return quantifierEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EEnum getOperator() {
+ return operatorEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionFactory getLaxconditionFactory() {
+ return (LaxconditionFactory)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
+ conditionEClass = createEClass(CONDITION);
+ createEReference(conditionEClass, CONDITION__TYPE_GRAPH);
+ createEAttribute(conditionEClass, CONDITION__NAME);
+ createEReference(conditionEClass, CONDITION__LAX_CONDITION);
+
+ laxConditionEClass = createEClass(LAX_CONDITION);
+ createEReference(laxConditionEClass, LAX_CONDITION__FORMULA);
+
+ quantifiedLaxConditionEClass = createEClass(QUANTIFIED_LAX_CONDITION);
+ createEReference(quantifiedLaxConditionEClass, QUANTIFIED_LAX_CONDITION__GRAPH);
+ createEReference(quantifiedLaxConditionEClass, QUANTIFIED_LAX_CONDITION__CONDITION);
+ createEAttribute(quantifiedLaxConditionEClass, QUANTIFIED_LAX_CONDITION__QUANTIFIER);
+ createEReference(quantifiedLaxConditionEClass, QUANTIFIED_LAX_CONDITION__VARIABLES);
+
+ trueEClass = createEClass(TRUE);
+
+ formulaEClass = createEClass(FORMULA);
+ createEAttribute(formulaEClass, FORMULA__OP);
+ createEReference(formulaEClass, FORMULA__ARGUMENTS);
+
+ variableEClass = createEClass(VARIABLE);
+ createEAttribute(variableEClass, VARIABLE__NAME);
+
+ // Create enums
+ quantifierEEnum = createEEnum(QUANTIFIER);
+ operatorEEnum = createEEnum(OPERATOR);
+ }
+
+ /**
+ * <!-- 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
+ GraphPackage theGraphPackage = (GraphPackage)EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ quantifiedLaxConditionEClass.getESuperTypes().add(this.getLaxCondition());
+ trueEClass.getESuperTypes().add(this.getLaxCondition());
+ formulaEClass.getESuperTypes().add(this.getLaxCondition());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(conditionEClass, Condition.class, "Condition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getCondition_TypeGraph(), ecorePackage.getEPackage(), null, "typeGraph", null, 1, 1, Condition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getCondition_Name(), ecorePackage.getEString(), "name", null, 0, 1, Condition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCondition_LaxCondition(), this.getLaxCondition(), null, "laxCondition", null, 1, 1, Condition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(laxConditionEClass, LaxCondition.class, "LaxCondition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getLaxCondition_Formula(), this.getFormula(), this.getFormula_Arguments(), "formula", null, 0, 1, LaxCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(quantifiedLaxConditionEClass, QuantifiedLaxCondition.class, "QuantifiedLaxCondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getQuantifiedLaxCondition_Graph(), theGraphPackage.getGraph(), null, "graph", null, 1, 1, QuantifiedLaxCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getQuantifiedLaxCondition_Condition(), this.getLaxCondition(), null, "condition", null, 1, 1, QuantifiedLaxCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuantifiedLaxCondition_Quantifier(), this.getQuantifier(), "quantifier", "EXISTS", 1, 1, QuantifiedLaxCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getQuantifiedLaxCondition_Variables(), this.getVariable(), null, "variables", null, 0, -1, QuantifiedLaxCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(trueEClass, True.class, "True", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(formulaEClass, Formula.class, "Formula", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getFormula_Op(), this.getOperator(), "op", "NOT", 1, 1, Formula.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getFormula_Arguments(), this.getLaxCondition(), this.getLaxCondition_Formula(), "arguments", null, 1, -1, Formula.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(variableEClass, Variable.class, "Variable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getVariable_Name(), ecorePackage.getEString(), "name", null, 0, 1, Variable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize enums and add enum literals
+ initEEnum(quantifierEEnum, Quantifier.class, "Quantifier");
+ addEEnumLiteral(quantifierEEnum, Quantifier.EXISTS);
+ addEEnumLiteral(quantifierEEnum, Quantifier.FORALL);
+
+ initEEnum(operatorEEnum, Operator.class, "Operator");
+ addEEnumLiteral(operatorEEnum, Operator.NOT);
+ addEEnumLiteral(operatorEEnum, Operator.AND);
+ addEEnumLiteral(operatorEEnum, Operator.OR);
+ addEEnumLiteral(operatorEEnum, Operator.IMPLIES);
+ addEEnumLiteral(operatorEEnum, Operator.EQUIVALENT);
+ addEEnumLiteral(operatorEEnum, Operator.XOR);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http://www.eclipse.org/OCL/Import
+ createImportAnnotations();
+ // http://www.eclipse.org/emf/2002/Ecore
+ createEcoreAnnotations();
+ // http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
+ createPivotAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createImportAnnotations() {
+ String source = "http://www.eclipse.org/OCL/Import";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "ecore", "http://www.eclipse.org/emf/2002/Ecore",
+ "graph_0", "graph.ecore#/"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createEcoreAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"
+ });
+ addAnnotation
+ (conditionEClass,
+ source,
+ new String[] {
+ "constraints", "TypeGraphConsistency"
+ });
+ addAnnotation
+ (quantifiedLaxConditionEClass,
+ source,
+ new String[] {
+ "constraints", "HostGraphConsistency"
+ });
+ addAnnotation
+ (formulaEClass,
+ source,
+ new String[] {
+ "constraints", "OneArgumentForNOT AtLeastTwoArgumentForANDOR TwoArgumentForIMPLEQUALXOR"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createPivotAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
+ addAnnotation
+ (conditionEClass,
+ source,
+ new String[] {
+ "TypeGraphConsistency", "graph_0::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)"
+ });
+ addAnnotation
+ (quantifiedLaxConditionEClass,
+ source,
+ new String[] {
+ "HostGraphConsistency", "self.graph.edges -> forAll(e|self.graph.nodes -> includes(e.source) and self.graph.nodes -> includes(e.target))"
+ });
+ addAnnotation
+ (formulaEClass,
+ source,
+ new String[] {
+ "OneArgumentForNOT", "(self.op = Operator::NOT) implies (self.arguments -> size() = 1)",
+ "AtLeastTwoArgumentForANDOR", "((self.op = Operator::AND) or (self.op = Operator::OR)) implies (self.arguments -> size() > 1)",
+ "TwoArgumentForIMPLEQUALXOR", "((self.op = Operator::IMPLIES) or (self.op = Operator::EQUIVALENT) or (self.op = Operator::XOR)) implies (self.arguments -> size() = 2)"
+ });
+ }
+
+} //LaxconditionPackageImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/QuantifiedLaxConditionImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/QuantifiedLaxConditionImpl.java
new file mode 100644
index 0000000..d8aa791
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/QuantifiedLaxConditionImpl.java
@@ -0,0 +1,357 @@
+/**
+ */
+package laxcondition.impl;
+
+import graph.Graph;
+
+import java.util.Collection;
+
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionPackage;
+import laxcondition.QuantifiedLaxCondition;
+import laxcondition.Quantifier;
+import laxcondition.Variable;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quantified Lax Condition</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.impl.QuantifiedLaxConditionImpl#getGraph <em>Graph</em>}</li>
+ * <li>{@link laxcondition.impl.QuantifiedLaxConditionImpl#getCondition <em>Condition</em>}</li>
+ * <li>{@link laxcondition.impl.QuantifiedLaxConditionImpl#getQuantifier <em>Quantifier</em>}</li>
+ * <li>{@link laxcondition.impl.QuantifiedLaxConditionImpl#getVariables <em>Variables</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class QuantifiedLaxConditionImpl extends LaxConditionImpl implements QuantifiedLaxCondition {
+ /**
+ * The cached value of the '{@link #getGraph() <em>Graph</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGraph()
+ * @generated
+ * @ordered
+ */
+ protected Graph graph;
+
+ /**
+ * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCondition()
+ * @generated
+ * @ordered
+ */
+ protected LaxCondition condition;
+
+ /**
+ * The default value of the '{@link #getQuantifier() <em>Quantifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuantifier()
+ * @generated
+ * @ordered
+ */
+ protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS;
+
+ /**
+ * The cached value of the '{@link #getQuantifier() <em>Quantifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuantifier()
+ * @generated
+ * @ordered
+ */
+ protected Quantifier quantifier = QUANTIFIER_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getVariables() <em>Variables</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVariables()
+ * @generated
+ * @ordered
+ */
+ protected EList<Variable> variables;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected QuantifiedLaxConditionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getGraph() {
+ return graph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetGraph(Graph newGraph, NotificationChain msgs) {
+ Graph oldGraph = graph;
+ graph = newGraph;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH, oldGraph, newGraph);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGraph(Graph newGraph) {
+ if (newGraph != graph) {
+ NotificationChain msgs = null;
+ if (graph != null)
+ msgs = ((InternalEObject)graph).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH, null, msgs);
+ if (newGraph != null)
+ msgs = ((InternalEObject)newGraph).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH, null, msgs);
+ msgs = basicSetGraph(newGraph, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH, newGraph, newGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxCondition getCondition() {
+ return condition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetCondition(LaxCondition newCondition, NotificationChain msgs) {
+ LaxCondition oldCondition = condition;
+ condition = newCondition;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION, oldCondition, newCondition);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCondition(LaxCondition newCondition) {
+ if (newCondition != condition) {
+ NotificationChain msgs = null;
+ if (condition != null)
+ msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION, null, msgs);
+ if (newCondition != null)
+ msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION, null, msgs);
+ msgs = basicSetCondition(newCondition, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION, newCondition, newCondition));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quantifier getQuantifier() {
+ return quantifier;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setQuantifier(Quantifier newQuantifier) {
+ Quantifier oldQuantifier = quantifier;
+ quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.QUANTIFIED_LAX_CONDITION__QUANTIFIER, oldQuantifier, quantifier));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Variable> getVariables() {
+ if (variables == null) {
+ variables = new EObjectContainmentEList<Variable>(Variable.class, this, LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES);
+ }
+ return variables;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH:
+ return basicSetGraph(null, msgs);
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION:
+ return basicSetCondition(null, msgs);
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES:
+ return ((InternalEList<?>)getVariables()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH:
+ return getGraph();
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION:
+ return getCondition();
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__QUANTIFIER:
+ return getQuantifier();
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES:
+ return getVariables();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH:
+ setGraph((Graph)newValue);
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION:
+ setCondition((LaxCondition)newValue);
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__QUANTIFIER:
+ setQuantifier((Quantifier)newValue);
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES:
+ getVariables().clear();
+ getVariables().addAll((Collection<? extends Variable>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH:
+ setGraph((Graph)null);
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION:
+ setCondition((LaxCondition)null);
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__QUANTIFIER:
+ setQuantifier(QUANTIFIER_EDEFAULT);
+ return;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES:
+ getVariables().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__GRAPH:
+ return graph != null;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__CONDITION:
+ return condition != null;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__QUANTIFIER:
+ return quantifier != QUANTIFIER_EDEFAULT;
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION__VARIABLES:
+ return variables != null && !variables.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (quantifier: ");
+ result.append(quantifier);
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuantifiedLaxConditionImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/TrueImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/TrueImpl.java
new file mode 100644
index 0000000..420f331
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/TrueImpl.java
@@ -0,0 +1,37 @@
+/**
+ */
+package laxcondition.impl;
+
+import laxcondition.LaxconditionPackage;
+import laxcondition.True;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>True</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class TrueImpl extends LaxConditionImpl implements True {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TrueImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LaxconditionPackage.Literals.TRUE;
+ }
+
+} //TrueImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/VariableImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/VariableImpl.java
new file mode 100644
index 0000000..9d1776e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/impl/VariableImpl.java
@@ -0,0 +1,163 @@
+/**
+ */
+package laxcondition.impl;
+
+import laxcondition.LaxconditionPackage;
+import laxcondition.Variable;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Variable</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link laxcondition.impl.VariableImpl#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class VariableImpl extends MinimalEObjectImpl.Container implements Variable {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected VariableImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LaxconditionPackage.Literals.VARIABLE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LaxconditionPackage.VARIABLE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LaxconditionPackage.VARIABLE__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LaxconditionPackage.VARIABLE__NAME:
+ setName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.VARIABLE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LaxconditionPackage.VARIABLE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //VariableImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionAdapterFactory.java
new file mode 100644
index 0000000..721b6bb
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionAdapterFactory.java
@@ -0,0 +1,210 @@
+/**
+ */
+package laxcondition.util;
+
+import laxcondition.*;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionPackage
+ * @generated
+ */
+public class LaxconditionAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static LaxconditionPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = LaxconditionPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LaxconditionSwitch<Adapter> modelSwitch =
+ new LaxconditionSwitch<Adapter>() {
+ @Override
+ public Adapter caseCondition(Condition object) {
+ return createConditionAdapter();
+ }
+ @Override
+ public Adapter caseLaxCondition(LaxCondition object) {
+ return createLaxConditionAdapter();
+ }
+ @Override
+ public Adapter caseQuantifiedLaxCondition(QuantifiedLaxCondition object) {
+ return createQuantifiedLaxConditionAdapter();
+ }
+ @Override
+ public Adapter caseTrue(True object) {
+ return createTrueAdapter();
+ }
+ @Override
+ public Adapter caseFormula(Formula object) {
+ return createFormulaAdapter();
+ }
+ @Override
+ public Adapter caseVariable(Variable object) {
+ return createVariableAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link laxcondition.Condition <em>Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see laxcondition.Condition
+ * @generated
+ */
+ public Adapter createConditionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link laxcondition.LaxCondition <em>Lax Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see laxcondition.LaxCondition
+ * @generated
+ */
+ public Adapter createLaxConditionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link laxcondition.QuantifiedLaxCondition <em>Quantified Lax Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see laxcondition.QuantifiedLaxCondition
+ * @generated
+ */
+ public Adapter createQuantifiedLaxConditionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link laxcondition.True <em>True</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see laxcondition.True
+ * @generated
+ */
+ public Adapter createTrueAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link laxcondition.Formula <em>Formula</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see laxcondition.Formula
+ * @generated
+ */
+ public Adapter createFormulaAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link laxcondition.Variable <em>Variable</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see laxcondition.Variable
+ * @generated
+ */
+ public Adapter createVariableAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //LaxconditionAdapterFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionSwitch.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionSwitch.java
new file mode 100644
index 0000000..dfa03b5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionSwitch.java
@@ -0,0 +1,218 @@
+/**
+ */
+package laxcondition.util;
+
+import laxcondition.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionPackage
+ * @generated
+ */
+public class LaxconditionSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static LaxconditionPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionSwitch() {
+ if (modelPackage == null) {
+ modelPackage = LaxconditionPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case LaxconditionPackage.CONDITION: {
+ Condition condition = (Condition)theEObject;
+ T result = caseCondition(condition);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LaxconditionPackage.LAX_CONDITION: {
+ LaxCondition laxCondition = (LaxCondition)theEObject;
+ T result = caseLaxCondition(laxCondition);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION: {
+ QuantifiedLaxCondition quantifiedLaxCondition = (QuantifiedLaxCondition)theEObject;
+ T result = caseQuantifiedLaxCondition(quantifiedLaxCondition);
+ if (result == null) result = caseLaxCondition(quantifiedLaxCondition);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LaxconditionPackage.TRUE: {
+ True true_ = (True)theEObject;
+ T result = caseTrue(true_);
+ if (result == null) result = caseLaxCondition(true_);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LaxconditionPackage.FORMULA: {
+ Formula formula = (Formula)theEObject;
+ T result = caseFormula(formula);
+ if (result == null) result = caseLaxCondition(formula);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LaxconditionPackage.VARIABLE: {
+ Variable variable = (Variable)theEObject;
+ T result = caseVariable(variable);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Condition</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Condition</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseCondition(Condition object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Lax Condition</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Lax Condition</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLaxCondition(LaxCondition object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Quantified Lax Condition</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Quantified Lax Condition</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseQuantifiedLaxCondition(QuantifiedLaxCondition object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>True</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>True</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTrue(True object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Formula</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseFormula(Formula object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Variable</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Variable</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseVariable(Variable object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //LaxconditionSwitch
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionValidator.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionValidator.java
new file mode 100644
index 0000000..148a695
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/LaxconditionValidator.java
@@ -0,0 +1,373 @@
+/**
+ */
+package laxcondition.util;
+
+import java.util.Map;
+
+import laxcondition.*;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.EObjectValidator;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Validator</b> for the model.
+ * <!-- end-user-doc -->
+ * @see laxcondition.LaxconditionPackage
+ * @generated
+ */
+public class LaxconditionValidator extends EObjectValidator {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final LaxconditionValidator INSTANCE = new LaxconditionValidator();
+
+ /**
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.common.util.Diagnostic#getSource()
+ * @see org.eclipse.emf.common.util.Diagnostic#getCode()
+ * @generated
+ */
+ public static final String DIAGNOSTIC_SOURCE = "laxcondition";
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LaxconditionValidator() {
+ super();
+ }
+
+ /**
+ * Returns the package of this validator switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EPackage getEPackage() {
+ return LaxconditionPackage.eINSTANCE;
+ }
+
+ /**
+ * Calls <code>validateXXX</code> for the corresponding classifier of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ switch (classifierID) {
+ case LaxconditionPackage.CONDITION:
+ return validateCondition((Condition)value, diagnostics, context);
+ case LaxconditionPackage.LAX_CONDITION:
+ return validateLaxCondition((LaxCondition)value, diagnostics, context);
+ case LaxconditionPackage.QUANTIFIED_LAX_CONDITION:
+ return validateQuantifiedLaxCondition((QuantifiedLaxCondition)value, diagnostics, context);
+ case LaxconditionPackage.TRUE:
+ return validateTrue((True)value, diagnostics, context);
+ case LaxconditionPackage.FORMULA:
+ return validateFormula((Formula)value, diagnostics, context);
+ case LaxconditionPackage.VARIABLE:
+ return validateVariable((Variable)value, diagnostics, context);
+ case LaxconditionPackage.QUANTIFIER:
+ return validateQuantifier((Quantifier)value, diagnostics, context);
+ case LaxconditionPackage.OPERATOR:
+ return validateOperator((Operator)value, diagnostics, context);
+ default:
+ return true;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateCondition(Condition condition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(condition, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(condition, diagnostics, context);
+ if (result || diagnostics != null) result &= validateCondition_TypeGraphConsistency(condition, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the TypeGraphConsistency constraint of '<em>Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String CONDITION__TYPE_GRAPH_CONSISTENCY__EEXPRESSION = "graph_0::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)";
+
+ /**
+ * Validates the TypeGraphConsistency constraint of '<em>Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateCondition_TypeGraphConsistency(Condition condition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (LaxconditionPackage.Literals.CONDITION,
+ condition,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "TypeGraphConsistency",
+ CONDITION__TYPE_GRAPH_CONSISTENCY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateLaxCondition(LaxCondition laxCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(laxCondition, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateQuantifiedLaxCondition(QuantifiedLaxCondition quantifiedLaxCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(quantifiedLaxCondition, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(quantifiedLaxCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validateQuantifiedLaxCondition_HostGraphConsistency(quantifiedLaxCondition, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the HostGraphConsistency constraint of '<em>Quantified Lax Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String QUANTIFIED_LAX_CONDITION__HOST_GRAPH_CONSISTENCY__EEXPRESSION = "self.graph.edges -> forAll(e|self.graph.nodes -> includes(e.source) and self.graph.nodes -> includes(e.target))";
+
+ /**
+ * Validates the HostGraphConsistency constraint of '<em>Quantified Lax Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateQuantifiedLaxCondition_HostGraphConsistency(QuantifiedLaxCondition quantifiedLaxCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (LaxconditionPackage.Literals.QUANTIFIED_LAX_CONDITION,
+ quantifiedLaxCondition,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "HostGraphConsistency",
+ QUANTIFIED_LAX_CONDITION__HOST_GRAPH_CONSISTENCY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateTrue(True true_, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(true_, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(formula, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_OneArgumentForNOT(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_AtLeastTwoArgumentForANDOR(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_TwoArgumentForIMPLEQUALXOR(formula, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the OneArgumentForNOT constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__ONE_ARGUMENT_FOR_NOT__EEXPRESSION = "(self.op = Operator::NOT) implies (self.arguments -> size() = 1)";
+
+ /**
+ * Validates the OneArgumentForNOT constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_OneArgumentForNOT(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (LaxconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "OneArgumentForNOT",
+ FORMULA__ONE_ARGUMENT_FOR_NOT__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the AtLeastTwoArgumentForANDOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__AT_LEAST_TWO_ARGUMENT_FOR_ANDOR__EEXPRESSION = "((self.op = Operator::AND) or (self.op = Operator::OR)) implies (self.arguments -> size() > 1)";
+
+ /**
+ * Validates the AtLeastTwoArgumentForANDOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_AtLeastTwoArgumentForANDOR(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (LaxconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "AtLeastTwoArgumentForANDOR",
+ FORMULA__AT_LEAST_TWO_ARGUMENT_FOR_ANDOR__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the TwoArgumentForIMPLEQUALXOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__TWO_ARGUMENT_FOR_IMPLEQUALXOR__EEXPRESSION = "((self.op = Operator::IMPLIES) or (self.op = Operator::EQUIVALENT) or (self.op = Operator::XOR)) implies (self.arguments -> size() = 2)";
+
+ /**
+ * Validates the TwoArgumentForIMPLEQUALXOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_TwoArgumentForIMPLEQUALXOR(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (LaxconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "TwoArgumentForIMPLEQUALXOR",
+ FORMULA__TWO_ARGUMENT_FOR_IMPLEQUALXOR__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateVariable(Variable variable, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(variable, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateQuantifier(Quantifier quantifier, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateOperator(Operator operator, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return true;
+ }
+
+ /**
+ * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ // TODO
+ // Specialize this to return a resource locator for messages specific to this validator.
+ // Ensure that you remove @generated or mark it @generated NOT
+ return super.getResourceLocator();
+ }
+
+} //LaxconditionValidator
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/EdgeMapping.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/EdgeMapping.java
new file mode 100644
index 0000000..feb2e94
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/EdgeMapping.java
@@ -0,0 +1,29 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package laxcondition.util.extensions;
+
+import graph.Edge;
+
+public class EdgeMapping {
+
+ private Edge sourceEdge;
+
+ public EdgeMapping(Edge sourceEdge, Edge targetEdge) {
+ this.sourceEdge = sourceEdge;
+ this.targetEdge = targetEdge;
+ }
+
+ private Edge targetEdge;
+
+ public Edge getSourceEdge() {
+ return sourceEdge;
+ }
+
+ public Edge getTargetEdge() {
+ return targetEdge;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/Intersection.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/Intersection.java
new file mode 100644
index 0000000..ae25244
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/Intersection.java
@@ -0,0 +1,113 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package laxcondition.util.extensions;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+
+import graph.Edge;
+import graph.Graph;
+import graph.Node;
+
+public class Intersection {
+
+ public Graph getSourceGraph() {
+ return (Graph) nodeMappings.get(0).getSourceNode().eContainer();
+ }
+
+ private EList<NodeMapping> nodeMappings;
+
+ public EList<NodeMapping> getNodeMappings() {
+ return nodeMappings;
+ }
+
+ public EList<EdgeMapping> getEdgeMappings() {
+ return edgeMappings;
+ }
+
+ private EList<EdgeMapping> edgeMappings;
+
+ public Intersection() {
+ nodeMappings = new BasicEList<NodeMapping>();
+ edgeMappings = new BasicEList<EdgeMapping>();
+ }
+
+ public void addNodeMapping(NodeMapping nodeMapping) {
+ nodeMappings.add(nodeMapping);
+ }
+
+ public void addEdgeMapping(EdgeMapping edgeMapping) {
+ edgeMappings.add(edgeMapping);
+ }
+
+ public boolean containsTarget(Node node) {
+ for (NodeMapping mapping : nodeMappings) {
+ if (mapping.getTargetNode() == node) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean containsTarget(Edge edge) {
+ for (EdgeMapping mapping : edgeMappings) {
+ if (mapping.getTargetEdge() == edge) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Node getSourceNode(Node node) {
+ for (NodeMapping mapping : nodeMappings) {
+ if (mapping.getTargetNode() == node) {
+ return mapping.getSourceNode();
+ }
+ }
+ return null;
+ }
+
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ result.append("Node Mappings:");
+ for (NodeMapping nodeMapping : nodeMappings) {
+ result.append("\n- from ");
+ result.append(nodeMapping.getSourceNode().toString());
+ result.append(" to ");
+ result.append(nodeMapping.getTargetNode().toString());
+ result.append("\n- graphs: " + nodeMapping.getSourceNode().eContainer() + " and "
+ + nodeMapping.getTargetNode().eContainer());
+ }
+ result.append("\nEdge Mappings: ");
+ for (EdgeMapping edgeMapping : edgeMappings) {
+ result.append("\n- between ");
+ result.append(edgeMapping.getSourceEdge().toString());
+ result.append(" and ");
+ result.append(edgeMapping.getTargetEdge().toString());
+ }
+ return result.toString();
+ }
+
+ public boolean containsSource(Node node) {
+ for (NodeMapping mapping : nodeMappings) {
+ Node sourceNode = mapping.getSourceNode();
+ if (sourceNode.getName().equals(node.getName()) && sourceNode.getType() == node.getType()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Node getSourceNode1(Node node) {
+ for (NodeMapping mapping : nodeMappings) {
+ Node targetNode = mapping.getTargetNode();
+ if (targetNode.getName().equals(node.getName()) && targetNode.getType() == node.getType()) {
+ return mapping.getSourceNode();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/LaxConditionConstants.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/LaxConditionConstants.java
new file mode 100644
index 0000000..66e86f0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/LaxConditionConstants.java
@@ -0,0 +1,30 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package laxcondition.util.extensions;
+
+public class LaxConditionConstants {
+
+ public static final String START = "\\[\\begin{array}{l} \n";
+ public static final String START2 = "$\\begin{array}{l} \n";
+ public static final String END = "\n\\end{array}\\]";
+ public static final String END2 = "\n\\end{array}$";
+
+ public static final String TRUE = "true";
+ public static final String NEG = "\\neg";
+ public static final String IMPL = "\\Rightarrow";
+ public static final String EQUIVALENT = "$\\Leftrightarrow$";
+ public static final String CRLEFT = "\\left. ";
+ public static final String CRCENTRE = "\\cr ";
+ public static final String CRRIGHT = "\\right. ";
+ public static final String LAND = "\\land";
+ public static final String LOR = "\\lor";
+ public static final String EXISTS = "\\exists";
+ public static final String FORALL = "\\forall";
+ public static final String LEFT = "\\left(";
+ public static final String RIGHT = "\\right)";
+ public static final String XOR = "\\veebar";
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/LaxConditionSimplifier.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/LaxConditionSimplifier.java
new file mode 100644
index 0000000..286c93c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/LaxConditionSimplifier.java
@@ -0,0 +1,797 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package laxcondition.util.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import graph.Edge;
+import graph.Graph;
+import graph.Node;
+import laxcondition.Condition;
+import laxcondition.Formula;
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionFactory;
+import laxcondition.Operator;
+import laxcondition.QuantifiedLaxCondition;
+import laxcondition.Quantifier;
+import laxcondition.True;
+
+public class LaxConditionSimplifier {
+
+ private Condition condition;
+ private LaxconditionFactory factory;
+
+ public LaxConditionSimplifier(Condition condition) {
+ this.condition = condition;
+ this.factory = LaxconditionFactory.eINSTANCE;
+ }
+
+ public boolean simplify() {
+ if (simplifyNames()) {
+ return simplify();
+ }
+ if (simplifyTrueOrFalseInFormula()) {
+ return simplify();
+ }
+ if (simplifyNotNot()) {
+ return simplify();
+ }
+
+ if (simplifyExists()) {
+ return simplify();
+ }
+ return true;
+ }
+
+ private boolean insert(EObject container, LaxCondition oldContent, LaxCondition newContent) {
+ if (container instanceof Condition) {
+ Condition constraint = (Condition) container;
+ constraint.setLaxCondition(newContent);
+ return true;
+ }
+ if (container instanceof QuantifiedLaxCondition) {
+ QuantifiedLaxCondition qlc = (QuantifiedLaxCondition) container;
+ qlc.setCondition(newContent);
+ return true;
+ }
+ if (container instanceof Formula) {
+ Formula f = (Formula) container;
+ int index = f.getArguments().indexOf(oldContent);
+ f.getArguments().set(index, newContent);
+ return true;
+ }
+ return false;
+ }
+
+ private boolean simplifyNames() {
+ TreeIterator<EObject> iter1 = condition.eAllContents();
+ while (iter1.hasNext()) {
+ EObject eObject1 = iter1.next();
+ if (eObject1 instanceof Node) {
+ Node node1 = (Node) eObject1;
+ if (node1.getNames().size() > 1) {
+ for (String name : node1.getNames()) {
+ boolean onlyOnce = true;
+ TreeIterator<EObject> iter2 = condition.eAllContents();
+ while (iter2.hasNext()) {
+ EObject eObject2 = iter2.next();
+ if (eObject2 instanceof Node) {
+ Node node2 = (Node) eObject2;
+ if (node1 != node2 && node2.getNames().contains(name)) {
+ onlyOnce = false;
+ break;
+ }
+ }
+ }
+ if (onlyOnce) {
+ node1.removeName(name);
+ System.out.println("Removing name: " + name);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean simplifyExists() {
+ TreeIterator<EObject> iter = condition.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isExistsCondition(eObject)) {
+ QuantifiedLaxCondition outerCondition = (QuantifiedLaxCondition) eObject;
+ LaxCondition cond = outerCondition.getCondition();
+ if (isExistsCondition(cond)) {
+ QuantifiedLaxCondition innerCondition = (QuantifiedLaxCondition) cond;
+ if (isTrue(innerCondition.getCondition())) {
+ Graph outerGraph = outerCondition.getGraph();
+ Graph innerGraph = innerCondition.getGraph();
+ if (isSubGraph(outerGraph, innerGraph)) {
+ outerCondition.setGraph(innerGraph);
+ outerCondition.setCondition(factory.createTrue());
+ System.out.println("Equivalence E1.c");
+ return true;
+ }
+ if (isSubGraph(innerGraph, outerGraph)) {
+ outerCondition.setCondition(factory.createTrue());
+ System.out.println("Equivalence E1.c");
+ return true;
+ }
+ if (areClanDisjoint(innerGraph, outerGraph)) {
+ EList<Node> innerNodes = innerGraph.getNodes();
+ innerGraph.getNodes().clear();
+ outerGraph.getNodes().addAll(innerNodes);
+ EList<Edge> innerEdges = innerGraph.getEdges();
+ innerGraph.getEdges().clear();
+ outerGraph.getEdges().addAll(innerEdges);
+ outerCondition.setCondition(factory.createTrue());
+ System.out.println("Equivalence E1.b");
+ return true;
+ }
+ if (haveIntersection(innerGraph, outerGraph)) {
+ EList<Intersection> intersections = getIntersections(outerGraph, innerGraph);
+ EObject container = outerCondition.eContainer();
+ if (intersections.size() == 1) {
+ QuantifiedLaxCondition condition = factory.createQuantifiedLaxCondition();
+ condition.setQuantifier(Quantifier.EXISTS);
+ condition.setGraph(glue(outerGraph, intersections.get(0), innerGraph));
+ condition.setCondition(factory.createTrue());
+ insert(container, outerCondition, condition);
+ System.out.println("Equivalence E1.a");
+ return true;
+ }
+ Formula formula = factory.createFormula();
+ formula.setOp(Operator.OR);
+ for (Intersection intersection : intersections) {
+ QuantifiedLaxCondition condition = factory.createQuantifiedLaxCondition();
+ condition.setQuantifier(Quantifier.EXISTS);
+ condition.setGraph(
+ glue(outerCondition.getGraph(), intersection, innerCondition.getGraph()));
+ condition.setCondition(factory.createTrue());
+ formula.getArguments().add(condition);
+ }
+ insert(container, outerCondition, formula);
+ System.out.println("Equivalence E1.a");
+ return true;
+ }
+ if (hasOnlyOneNode(innerGraph)) {
+ Node innerNode = innerGraph.getNodes().get(0);
+ if (hasTwoNames(innerNode)) {
+ String name1 = innerNode.getNames().get(0);
+ String name2 = innerNode.getNames().get(1);
+ if (containsExactlyOne(outerGraph, name1, name2)) {
+ rename(outerGraph, name1, name2);
+ outerCondition.setCondition(factory.createTrue());
+ System.out.println("Equivalence E3'");
+ return true;
+ }
+ }
+ }
+ }
+ }
+ if (isAndFormula(cond)) {
+ Formula andFormula = (Formula) cond;
+ if (andFormula.getArguments().size() == 2) {
+ if (isExistsCondition(andFormula.getArguments().get(0))
+ && isExistsCondition(andFormula.getArguments().get(1))) {
+ QuantifiedLaxCondition cond1 = (QuantifiedLaxCondition) andFormula.getArguments().get(0);
+ QuantifiedLaxCondition cond2 = (QuantifiedLaxCondition) andFormula.getArguments().get(1);
+ if (cond1.getCondition() instanceof True && cond2.getCondition() instanceof True) {
+ Graph gr = outerCondition.getGraph();
+ Graph gr1 = cond1.getGraph();
+ Graph gr2 = cond2.getGraph();
+ if (hasOnlyOneNode(gr) && hasOnlyOneNode(gr2)) {
+ Node node = gr.getNodes().get(0);
+ Node node2 = gr2.getNodes().get(0);
+ if (haveSameTypes(node, node2) && hasOneName(node) && hasTwoNames(node2)) {
+ String name = node.getName();
+ String name1 = node2.getName().split("=")[0];
+ String name2 = node2.getName().split("=")[1];
+ if (name.equals(name1) || name.equals(name2)) {
+ if (containsExactlyOne(gr1, name1, name2)) {
+ rename(gr1, name1, name2);
+ outerCondition.setCondition(cond1);
+ System.out.println("Equivalence E3");
+ return true;
+ }
+ }
+ }
+ }
+ if (hasOnlyOneNode(gr) && hasOnlyOneNode(gr1)) {
+ Node node = gr.getNodes().get(0);
+ Node node1 = gr1.getNodes().get(0);
+ if (haveSameTypes(node, node1) && hasOneName(node) && hasTwoNames(node1)) {
+ String name = node.getName();
+ String name1 = node1.getName().split("=")[0];
+ String name2 = node1.getName().split("=")[1];
+ if (name.equals(name1) || name.equals(name2)) {
+ if (containsExactlyOne(gr2, name1, name2)) {
+ rename(gr2, name1, name2);
+ outerCondition.setCondition(cond2);
+ System.out.println("Equivalence E3");
+ return true;
+ }
+ }
+ }
+ }
+ System.out.println("=> haveRecurringNodes: " + haveRecurringNodes(gr1, gr2));
+ System.out.println(
+ "=> containsEachRecurringNode: " + containsEachRecurringNode(gr, gr1, gr2));
+ if (haveRecurringNodes(gr1, gr2)) {
+ if (containsEachRecurringNode(gr, gr1, gr2)
+ || containsNoRecurringNodeType(gr, gr1, gr2)) {
+ if (haveIntersection(gr1, gr2)) {
+ EList<Intersection> intersections = getIntersections(gr1, gr2);
+ if (intersections.size() == 1) {
+ QuantifiedLaxCondition condition = factory
+ .createQuantifiedLaxCondition();
+ condition.setQuantifier(Quantifier.EXISTS);
+ condition.setGraph(glue(gr1, intersections.get(0), gr2));
+ condition.setCondition(factory.createTrue());
+ outerCondition.setCondition(condition);
+ System.out.println("Equivalence E2.a");
+ return true;
+ }
+ Formula formula = factory.createFormula();
+ formula.setOp(Operator.OR);
+ for (Intersection intersection : intersections) {
+ QuantifiedLaxCondition condition = factory
+ .createQuantifiedLaxCondition();
+ condition.setQuantifier(Quantifier.EXISTS);
+ condition.setGraph(glue(gr1, intersection, gr2));
+ condition.setCondition(factory.createTrue());
+ formula.getArguments().add(condition);
+ }
+ outerCondition.setCondition(formula);
+ System.out.println("Equivalence E2.a");
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (isAndFormula(eObject)) {
+ Formula andFormula = (Formula) eObject;
+ if (andFormula.getArguments().size() == 2) {
+ if (isExistsCondition(andFormula.getArguments().get(0))
+ && isExistsCondition(andFormula.getArguments().get(1))) {
+ QuantifiedLaxCondition cond1 = (QuantifiedLaxCondition) andFormula.getArguments().get(0);
+ QuantifiedLaxCondition cond2 = (QuantifiedLaxCondition) andFormula.getArguments().get(1);
+ if (cond1.getCondition() instanceof True && cond2.getCondition() instanceof True) {
+ Graph gr1 = cond1.getGraph();
+ Graph gr2 = cond2.getGraph();
+ if (areClanDisjoint(gr1, gr2) && areNodeNameDisjoint(gr1, gr2)) {
+ EList<Node> nodes = gr2.getNodes();
+ gr2.getNodes().clear();
+ gr1.getNodes().addAll(nodes);
+ EList<Edge> edges = gr2.getEdges();
+ gr2.getEdges().clear();
+ gr1.getEdges().addAll(edges);
+ EObject container = andFormula.eContainer();
+ insert(container, andFormula, cond1);
+ System.out.println("Equivalence E2.b");
+ return true;
+ }
+ }
+ }
+ }
+
+ }
+ }
+ return false;
+ }
+
+ private boolean haveRecurringNodes(Graph gr1, Graph gr2) {
+ EList<Node> recurringNodes = collectRecurringNodes(gr1, gr2);
+ return (!recurringNodes.isEmpty());
+ }
+
+ private boolean containsEachRecurringNode(Graph gr, Graph gr1, Graph gr2) {
+ EList<Node> recurringNodes = collectRecurringNodes(gr1, gr2);
+ for (Node recurringNode : recurringNodes) {
+ boolean occurs = false;
+ String nodeName = recurringNode.getName();
+ EClass type = recurringNode.getType();
+ for (Node node : gr.getNodes()) {
+ if (node.getName().equals(nodeName) && node.getType() == type) {
+ occurs = true;
+ break;
+ }
+ }
+ if (!occurs) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private boolean containsNoRecurringNodeType(Graph gr, Graph gr1, Graph gr2) {
+ EList<Node> recurringNodes = collectRecurringNodes(gr1, gr2);
+ boolean occurs = false;
+ for (Node recurringNode : recurringNodes) {
+ EClass type = recurringNode.getType();
+ for (Node node : gr.getNodes()) {
+ if (node.getType() == type) {
+ occurs = true;
+ break;
+ }
+ }
+ }
+ return !occurs;
+ }
+
+ private EList<Node> collectRecurringNodes(Graph gr1, Graph gr2) {
+ EList<Node> recurringNodes = new BasicEList<Node>();
+ for (Node node1 : gr1.getNodes()) {
+ String nodeName = node1.getName();
+ EClass type = node1.getType();
+ for (Node node2 : gr2.getNodes()) {
+ if (node2.getName().equals(nodeName) && node2.getType() == type) {
+ recurringNodes.add(node1);
+ break;
+ }
+ }
+ }
+ return recurringNodes;
+ }
+
+ private void rename(Graph graph, String name1, String name2) {
+ String newName = name1 + "=" + name2;
+ for (Node node : graph.getNodes()) {
+ if (node.getName().equals(name1) || node.getName().equals(name2)) {
+ node.setName(newName);
+ }
+ }
+ }
+
+ private boolean containsExactlyOne(Graph graph, String name1, String name2) {
+ boolean exists1 = false;
+ boolean exists2 = false;
+ for (Node node : graph.getNodes()) {
+ if (node.getName().equals(name1))
+ exists1 = true;
+ if (node.getName().equals(name2))
+ exists2 = true;
+ }
+ return ((exists1 && !exists2) || (!exists1 && exists2));
+ }
+
+ private boolean hasTwoNames(Node node) {
+ return (node.getName().split("=").length == 2);
+ }
+
+ private boolean hasOneName(Node node) {
+ return (node.getName().split("=").length == 1);
+ }
+
+ private boolean haveSameTypes(Node node1, Node node2) {
+ return (node1.getType() == node2.getType());
+ }
+
+ private boolean hasOnlyOneNode(Graph graph) {
+ return (graph.getNodes().size() == 1 && graph.getEdges().isEmpty());
+ }
+
+ private Graph glue(Graph gr1, Intersection intersection, Graph gr2) {
+ Graph graph = intersection.getSourceGraph();
+
+ for (Node node : gr1.getNodes()) {
+ if (!intersection.containsSource(node)) {
+ Node nodeCopy = EcoreUtil.copy(node);
+ intersection.addNodeMapping(new NodeMapping(nodeCopy, node));
+ graph.getNodes().add(nodeCopy);
+ }
+ }
+ for (Node node : gr2.getNodes()) {
+ if (!intersection.containsTarget(node)) {
+ Node nodeCopy = EcoreUtil.copy(node);
+ intersection.addNodeMapping(new NodeMapping(nodeCopy, node));
+ graph.getNodes().add(nodeCopy);
+ }
+ }
+
+ for (Edge edge : gr1.getEdges()) {
+ if (!intersection.containsTarget(edge)) {
+ Edge edgeCopy = EcoreUtil.copy(edge);
+ edgeCopy.setSource(intersection.getSourceNode1(edge.getSource()));
+ edgeCopy.setTarget(intersection.getSourceNode1(edge.getTarget()));
+ graph.getEdges().add(edgeCopy);
+ }
+ }
+ for (Edge edge : gr2.getEdges()) {
+ if (!intersection.containsTarget(edge)) {
+ Edge edgeCopy = EcoreUtil.copy(edge);
+ edgeCopy.setSource(intersection.getSourceNode(edge.getSource()));
+ edgeCopy.setTarget(intersection.getSourceNode(edge.getTarget()));
+ graph.getEdges().add(edgeCopy);
+ }
+ }
+ graph.setTypegraph(gr1.getTypegraph());
+ return graph;
+ }
+
+ private EList<Intersection> getIntersections(Graph gr1, Graph gr2) {
+ EList<Intersection> intersections = new BasicEList<Intersection>();
+ EList<Graph> subGraphs = new BasicEList<Graph>();
+ fillSubGraphs(subGraphs, gr1);
+ for (Graph graph : subGraphs) {
+ if (isSubGraph(graph, gr2)) {
+ intersections.add(getIntersection(graph, gr2));
+ }
+ }
+ return intersections;
+ }
+
+ private Intersection getIntersection(Graph subGraph, Graph graph) {
+ Intersection intersection = new Intersection();
+ for (Node n1 : subGraph.getNodes()) {
+ for (Node n2 : graph.getNodes()) {
+ if (n1.getType() == n2.getType() && n1.getName().equals(n2.getName())) {
+ intersection.addNodeMapping(new NodeMapping(n1, n2));
+ }
+ }
+ }
+ for (Edge e1 : subGraph.getEdges()) {
+ Node src1 = e1.getSource();
+ NodeMapping srcMapping = getMapping(intersection.getNodeMappings(), src1);
+ Node tgt1 = e1.getTarget();
+ NodeMapping tgtMapping = getMapping(intersection.getNodeMappings(), tgt1);
+ for (Edge e2 : graph.getEdges()) {
+ Node src2 = e2.getSource();
+ Node tgt2 = e2.getTarget();
+ if (e1.getType() == e2.getType() && srcMapping.getTargetNode() == src2
+ && tgtMapping.getTargetNode() == tgt2) {
+ intersection.addEdgeMapping(new EdgeMapping(e1, e2));
+ break;
+ }
+ }
+ }
+ return intersection;
+ }
+
+ private void fillSubGraphs(EList<Graph> subGraphs, Graph graph) {
+ EList<Edge> edges = cloneEdges(graph);
+ for (Edge edge : edges) {
+ graph.getEdges().remove(edge);
+ Graph gr = EcoreUtil.copy(graph);
+ graph.getEdges().add(edge);
+ testAndFill(subGraphs, gr);
+ }
+ EList<Node> nodes = cloneNodes(graph);
+ for (Node node : nodes) {
+ if (!isConnected(node, graph)) {
+ graph.getNodes().remove(node);
+ Graph gr = EcoreUtil.copy(graph);
+ graph.getNodes().add(node);
+ if (!isEmptyGraph(gr)) {
+ testAndFill(subGraphs, gr);
+ }
+ }
+ }
+ }
+
+ private boolean isEmptyGraph(Graph graph) {
+ return (graph.getNodes().isEmpty() && graph.getEdges().isEmpty());
+ }
+
+ private boolean isConnected(Node node, Graph graph) {
+ for (Edge edge : graph.getEdges()) {
+ if (edge.getSource() == node)
+ return true;
+ if (edge.getTarget() == node)
+ return true;
+ }
+ return false;
+ }
+
+ private void testAndFill(EList<Graph> graphs, Graph graph) {
+ if (!contains(graphs, graph)) {
+ graphs.add(graph);
+ fillSubGraphs(graphs, graph);
+ }
+ }
+
+ private boolean contains(EList<Graph> graphs, Graph graph) {
+ for (Graph gr : graphs) {
+ if (isSameGraph(gr, graph)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isSameGraph(Graph gr1, Graph gr2) {
+ return (isSubGraph(gr1, gr2) && isSubGraph(gr2, gr1));
+ }
+
+ private EList<Node> cloneNodes(Graph graph) {
+ EList<Node> nodes = new BasicEList<Node>();
+ for (Node node : graph.getNodes()) {
+ nodes.add(node);
+ }
+ return nodes;
+ }
+
+ private EList<Edge> cloneEdges(Graph graph) {
+ EList<Edge> edges = new BasicEList<Edge>();
+ for (Edge edge : graph.getEdges()) {
+ edges.add(edge);
+ }
+ return edges;
+ }
+
+ private boolean areNodeNameDisjoint(Graph gr1, Graph gr2) {
+ List<String> names1 = getNodeNames(gr1);
+ List<String> names2 = getNodeNames(gr2);
+ for (String str1 : names1) {
+ for (String str2 : names2) {
+ if (str1.equals(str2)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private List<String> getNodeNames(Graph graph) {
+ List<String> names = new ArrayList<String>();
+ for (Node node : graph.getNodes()) {
+ names.addAll(node.getNames());
+ }
+ return names;
+ }
+
+ private boolean haveIntersection(Graph gr1, Graph gr2) {
+ EList<Intersection> intersections = getIntersections(gr1, gr2);
+ return !intersections.isEmpty();
+ }
+
+ private boolean areClanDisjoint(Graph gr1, Graph gr2) {
+ for (Node n1 : gr1.getNodes()) {
+ EList<EClass> clan1 = getClan(n1.getType());
+ for (Node n2 : gr2.getNodes()) {
+ if (clan1.contains(n2.getType())) {
+ return false;
+ }
+ }
+ }
+ for (Node n2 : gr2.getNodes()) {
+ EList<EClass> clan2 = getClan(n2.getType());
+ for (Node n1 : gr1.getNodes()) {
+ if (clan2.contains(n1.getType())) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private EList<EClass> getClan(EClass eClass) {
+ EList<EClass> eClasses = new BasicEList<EClass>();
+ eClasses.add(eClass);
+ eClasses.addAll(getAllSubclasses(eClass));
+ return eClasses;
+ }
+
+ private EList<EClass> getAllSubclasses(EClass eClass) {
+ EList<EClass> eClasses = new BasicEList<EClass>();
+ EPackage ePackage = eClass.getEPackage();
+ TreeIterator<EObject> iter = ePackage.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (eObject instanceof EClass) {
+ EClass clazz = (EClass) eObject;
+ if (clazz.getEAllSuperTypes().contains(eClass)) {
+ eClasses.add(clazz);
+ }
+ }
+ }
+ return eClasses;
+ }
+
+ private boolean isSubGraph(Graph gr1, Graph gr2) {
+ EList<NodeMapping> nodeMappings = new BasicEList<NodeMapping>();
+ for (Node n1 : gr1.getNodes()) {
+ for (Node n2 : gr2.getNodes()) {
+ if (n1.getType() == n2.getType()) {
+ if (n2.getNames().containsAll(n1.getNames())) {
+ nodeMappings.add(new NodeMapping(n1, n2));
+ }
+ }
+ }
+ }
+ if (gr1.getNodes().size() != nodeMappings.size()) {
+ return false;
+ }
+ for (Edge e1 : gr1.getEdges()) {
+ Node src1 = e1.getSource();
+ NodeMapping srcMapping = getMapping(nodeMappings, src1);
+ Node tgt1 = e1.getTarget();
+ NodeMapping tgtMapping = getMapping(nodeMappings, tgt1);
+ boolean hasTarget = false;
+ for (Edge e2 : gr2.getEdges()) {
+ Node src2 = e2.getSource();
+ Node tgt2 = e2.getTarget();
+ if (e1.getType() == e2.getType() && srcMapping.getTargetNode() == src2
+ && tgtMapping.getTargetNode() == tgt2) {
+ hasTarget = true;
+ break;
+ }
+ }
+ if (!hasTarget) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private NodeMapping getMapping(EList<NodeMapping> nodeMappings, Node node) {
+ for (NodeMapping nm : nodeMappings) {
+ if (nm.getSourceNode() == node) {
+ return nm;
+ }
+ }
+ return null;
+ }
+
+ private boolean simplifyTrueOrFalseInFormula() {
+ TreeIterator<EObject> iter = condition.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isAndFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ EObject container = formula.eContainer();
+ LaxCondition arg1 = formula.getArguments().get(0);
+ LaxCondition arg2 = formula.getArguments().get(1);
+ if (isTrue(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ if (isTrue(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ if (isFalse(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ if (isFalse(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ }
+ if (isOrFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ EObject container = formula.eContainer();
+ LaxCondition arg1 = formula.getArguments().get(0);
+ LaxCondition arg2 = formula.getArguments().get(1);
+ if (isTrue(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ if (isTrue(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ if (isFalse(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ if (isFalse(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean removeArgument(Formula formula, LaxCondition cond) {
+ return formula.getArguments().remove(cond);
+ }
+
+ private boolean twoArguments(Formula formula) {
+ return (formula.getArguments().size() == 2);
+ }
+
+ private boolean isFalse(LaxCondition cond) {
+ if (isNotFormula(cond)) {
+ Formula formula = (Formula) cond;
+ return isTrue(formula.getArguments().get(0));
+ }
+ return false;
+ }
+
+ private boolean isTrue(LaxCondition cond) {
+ return (cond instanceof True);
+ }
+
+ private boolean simplifyNotNot() {
+ TreeIterator<EObject> iter = condition.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isNotFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ if (isNotFormula(formula.getArguments().get(0))) {
+ Formula innerFormula = (Formula) formula.getArguments().get(0);
+ LaxCondition innerCondition = innerFormula.getArguments().get(0);
+ EObject container = formula.eContainer();
+ return insert(container, formula, innerCondition);
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean isNotFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOp().equals(Operator.NOT));
+ }
+ return false;
+ }
+
+ private boolean isAndFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOp().equals(Operator.AND));
+ }
+ return false;
+ }
+
+ private boolean isOrFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOp().equals(Operator.OR));
+ }
+ return false;
+ }
+
+ private boolean isExistsCondition(EObject eObject) {
+ if (eObject instanceof QuantifiedLaxCondition) {
+ QuantifiedLaxCondition cond = (QuantifiedLaxCondition) eObject;
+ return (cond.getQuantifier().equals(Quantifier.EXISTS));
+ }
+ return false;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/NodeMapping.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/NodeMapping.java
new file mode 100644
index 0000000..f9c5ac9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/laxcondition/util/extensions/NodeMapping.java
@@ -0,0 +1,29 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package laxcondition.util.extensions;
+
+import graph.Node;
+
+public class NodeMapping {
+
+ private Node sourceNode;
+
+ public NodeMapping(Node sourceNode, Node targetNode) {
+ this.sourceNode = sourceNode;
+ this.targetNode = targetNode;
+ }
+
+ private Node targetNode;
+
+ public Node getSourceNode() {
+ return sourceNode;
+ }
+
+ public Node getTargetNode() {
+ return targetNode;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Mapping.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Mapping.java
new file mode 100644
index 0000000..3d5cc78
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Mapping.java
@@ -0,0 +1,79 @@
+/**
+ */
+package morphisms;
+
+import graph.Node;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link morphisms.Mapping#getOrigin <em>Origin</em>}</li>
+ * <li>{@link morphisms.Mapping#getImage <em>Image</em>}</li>
+ * </ul>
+ *
+ * @see morphisms.MorphismsPackage#getMapping()
+ * @model
+ * @generated
+ */
+public interface Mapping extends EObject {
+ /**
+ * Returns the value of the '<em><b>Origin</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Origin</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Origin</em>' reference.
+ * @see #setOrigin(Node)
+ * @see morphisms.MorphismsPackage#getMapping_Origin()
+ * @model required="true"
+ * @generated
+ */
+ Node getOrigin();
+
+ /**
+ * Sets the value of the '{@link morphisms.Mapping#getOrigin <em>Origin</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Origin</em>' reference.
+ * @see #getOrigin()
+ * @generated
+ */
+ void setOrigin(Node value);
+
+ /**
+ * Returns the value of the '<em><b>Image</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Image</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Image</em>' reference.
+ * @see #setImage(Node)
+ * @see morphisms.MorphismsPackage#getMapping_Image()
+ * @model required="true"
+ * @generated
+ */
+ Node getImage();
+
+ /**
+ * Sets the value of the '{@link morphisms.Mapping#getImage <em>Image</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Image</em>' reference.
+ * @see #getImage()
+ * @generated
+ */
+ void setImage(Node value);
+
+} // Mapping
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Morphism.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Morphism.java
new file mode 100644
index 0000000..633b869
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Morphism.java
@@ -0,0 +1,98 @@
+/**
+ */
+package morphisms;
+
+import graph.Graph;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Morphism</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link morphisms.Morphism#getDomain <em>Domain</em>}</li>
+ * <li>{@link morphisms.Morphism#getCodomain <em>Codomain</em>}</li>
+ * <li>{@link morphisms.Morphism#getMappings <em>Mappings</em>}</li>
+ * </ul>
+ *
+ * @see morphisms.MorphismsPackage#getMorphism()
+ * @model
+ * @generated
+ */
+public interface Morphism extends EObject {
+ /**
+ * Returns the value of the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Domain</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Domain</em>' reference.
+ * @see #setDomain(Graph)
+ * @see morphisms.MorphismsPackage#getMorphism_Domain()
+ * @model
+ * @generated
+ */
+ Graph getDomain();
+
+ /**
+ * Sets the value of the '{@link morphisms.Morphism#getDomain <em>Domain</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Domain</em>' reference.
+ * @see #getDomain()
+ * @generated
+ */
+ void setDomain(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Codomain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Codomain</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Codomain</em>' reference.
+ * @see #setCodomain(Graph)
+ * @see morphisms.MorphismsPackage#getMorphism_Codomain()
+ * @model
+ * @generated
+ */
+ Graph getCodomain();
+
+ /**
+ * Sets the value of the '{@link morphisms.Morphism#getCodomain <em>Codomain</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Codomain</em>' reference.
+ * @see #getCodomain()
+ * @generated
+ */
+ void setCodomain(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Mappings</b></em>' containment reference list.
+ * The list contents are of type {@link morphisms.Mapping}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mappings</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mappings</em>' containment reference list.
+ * @see morphisms.MorphismsPackage#getMorphism_Mappings()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Mapping> getMappings();
+
+} // Morphism
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/MorphismsFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/MorphismsFactory.java
new file mode 100644
index 0000000..1131dd9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/MorphismsFactory.java
@@ -0,0 +1,60 @@
+/**
+ */
+package morphisms;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see morphisms.MorphismsPackage
+ * @generated
+ */
+public interface MorphismsFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ MorphismsFactory eINSTANCE = morphisms.impl.MorphismsFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Morphism</em>'.
+ * @generated
+ */
+ Morphism createMorphism();
+
+ /**
+ * Returns a new object of class '<em>Mapping</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mapping</em>'.
+ * @generated
+ */
+ Mapping createMapping();
+
+ /**
+ * Returns a new object of class '<em>Pair</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Pair</em>'.
+ * @generated
+ */
+ Pair createPair();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ MorphismsPackage getMorphismsPackage();
+
+} //MorphismsFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/MorphismsPackage.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/MorphismsPackage.java
new file mode 100644
index 0000000..dace9fe
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/MorphismsPackage.java
@@ -0,0 +1,425 @@
+/**
+ */
+package morphisms;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see morphisms.MorphismsFactory
+ * @model kind="package"
+ * annotation="http://www.eclipse.org/OCL/Import graph='graph.ecore#/'"
+ * @generated
+ */
+public interface MorphismsPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "morphisms";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.example.org/morphisms";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "morphisms";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ MorphismsPackage eINSTANCE = morphisms.impl.MorphismsPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link morphisms.impl.MorphismImpl <em>Morphism</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see morphisms.impl.MorphismImpl
+ * @see morphisms.impl.MorphismsPackageImpl#getMorphism()
+ * @generated
+ */
+ int MORPHISM = 0;
+
+ /**
+ * The feature id for the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__DOMAIN = 0;
+
+ /**
+ * The feature id for the '<em><b>Codomain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__CODOMAIN = 1;
+
+ /**
+ * The feature id for the '<em><b>Mappings</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__MAPPINGS = 2;
+
+ /**
+ * The number of structural features of the '<em>Morphism</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>Morphism</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link morphisms.impl.MappingImpl <em>Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see morphisms.impl.MappingImpl
+ * @see morphisms.impl.MorphismsPackageImpl#getMapping()
+ * @generated
+ */
+ int MAPPING = 1;
+
+ /**
+ * The feature id for the '<em><b>Origin</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING__ORIGIN = 0;
+
+ /**
+ * The feature id for the '<em><b>Image</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING__IMAGE = 1;
+
+ /**
+ * The number of structural features of the '<em>Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link morphisms.impl.PairImpl <em>Pair</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see morphisms.impl.PairImpl
+ * @see morphisms.impl.MorphismsPackageImpl#getPair()
+ * @generated
+ */
+ int PAIR = 2;
+
+ /**
+ * The feature id for the '<em><b>A</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAIR__A = 0;
+
+ /**
+ * The feature id for the '<em><b>B</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAIR__B = 1;
+
+ /**
+ * The number of structural features of the '<em>Pair</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAIR_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Pair</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAIR_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link morphisms.Morphism <em>Morphism</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Morphism</em>'.
+ * @see morphisms.Morphism
+ * @generated
+ */
+ EClass getMorphism();
+
+ /**
+ * Returns the meta object for the reference '{@link morphisms.Morphism#getDomain <em>Domain</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Domain</em>'.
+ * @see morphisms.Morphism#getDomain()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_Domain();
+
+ /**
+ * Returns the meta object for the reference '{@link morphisms.Morphism#getCodomain <em>Codomain</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Codomain</em>'.
+ * @see morphisms.Morphism#getCodomain()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_Codomain();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link morphisms.Morphism#getMappings <em>Mappings</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Mappings</em>'.
+ * @see morphisms.Morphism#getMappings()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_Mappings();
+
+ /**
+ * Returns the meta object for class '{@link morphisms.Mapping <em>Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Mapping</em>'.
+ * @see morphisms.Mapping
+ * @generated
+ */
+ EClass getMapping();
+
+ /**
+ * Returns the meta object for the reference '{@link morphisms.Mapping#getOrigin <em>Origin</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Origin</em>'.
+ * @see morphisms.Mapping#getOrigin()
+ * @see #getMapping()
+ * @generated
+ */
+ EReference getMapping_Origin();
+
+ /**
+ * Returns the meta object for the reference '{@link morphisms.Mapping#getImage <em>Image</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Image</em>'.
+ * @see morphisms.Mapping#getImage()
+ * @see #getMapping()
+ * @generated
+ */
+ EReference getMapping_Image();
+
+ /**
+ * Returns the meta object for class '{@link morphisms.Pair <em>Pair</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Pair</em>'.
+ * @see morphisms.Pair
+ * @generated
+ */
+ EClass getPair();
+
+ /**
+ * Returns the meta object for the containment reference '{@link morphisms.Pair#getA <em>A</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>A</em>'.
+ * @see morphisms.Pair#getA()
+ * @see #getPair()
+ * @generated
+ */
+ EReference getPair_A();
+
+ /**
+ * Returns the meta object for the containment reference '{@link morphisms.Pair#getB <em>B</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>B</em>'.
+ * @see morphisms.Pair#getB()
+ * @see #getPair()
+ * @generated
+ */
+ EReference getPair_B();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ MorphismsFactory getMorphismsFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link morphisms.impl.MorphismImpl <em>Morphism</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see morphisms.impl.MorphismImpl
+ * @see morphisms.impl.MorphismsPackageImpl#getMorphism()
+ * @generated
+ */
+ EClass MORPHISM = eINSTANCE.getMorphism();
+
+ /**
+ * The meta object literal for the '<em><b>Domain</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__DOMAIN = eINSTANCE.getMorphism_Domain();
+
+ /**
+ * The meta object literal for the '<em><b>Codomain</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__CODOMAIN = eINSTANCE.getMorphism_Codomain();
+
+ /**
+ * The meta object literal for the '<em><b>Mappings</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__MAPPINGS = eINSTANCE.getMorphism_Mappings();
+
+ /**
+ * The meta object literal for the '{@link morphisms.impl.MappingImpl <em>Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see morphisms.impl.MappingImpl
+ * @see morphisms.impl.MorphismsPackageImpl#getMapping()
+ * @generated
+ */
+ EClass MAPPING = eINSTANCE.getMapping();
+
+ /**
+ * The meta object literal for the '<em><b>Origin</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MAPPING__ORIGIN = eINSTANCE.getMapping_Origin();
+
+ /**
+ * The meta object literal for the '<em><b>Image</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MAPPING__IMAGE = eINSTANCE.getMapping_Image();
+
+ /**
+ * The meta object literal for the '{@link morphisms.impl.PairImpl <em>Pair</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see morphisms.impl.PairImpl
+ * @see morphisms.impl.MorphismsPackageImpl#getPair()
+ * @generated
+ */
+ EClass PAIR = eINSTANCE.getPair();
+
+ /**
+ * The meta object literal for the '<em><b>A</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAIR__A = eINSTANCE.getPair_A();
+
+ /**
+ * The meta object literal for the '<em><b>B</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAIR__B = eINSTANCE.getPair_B();
+
+ }
+
+} //MorphismsPackage
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Pair.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Pair.java
new file mode 100644
index 0000000..ff9e3aa
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/Pair.java
@@ -0,0 +1,77 @@
+/**
+ */
+package morphisms;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Pair</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link morphisms.Pair#getA <em>A</em>}</li>
+ * <li>{@link morphisms.Pair#getB <em>B</em>}</li>
+ * </ul>
+ *
+ * @see morphisms.MorphismsPackage#getPair()
+ * @model
+ * @generated
+ */
+public interface Pair extends EObject {
+ /**
+ * Returns the value of the '<em><b>A</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' containment reference.
+ * @see #setA(Morphism)
+ * @see morphisms.MorphismsPackage#getPair_A()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ Morphism getA();
+
+ /**
+ * Sets the value of the '{@link morphisms.Pair#getA <em>A</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>A</em>' containment reference.
+ * @see #getA()
+ * @generated
+ */
+ void setA(Morphism value);
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' containment reference.
+ * @see #setB(Morphism)
+ * @see morphisms.MorphismsPackage#getPair_B()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ Morphism getB();
+
+ /**
+ * Sets the value of the '{@link morphisms.Pair#getB <em>B</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>B</em>' containment reference.
+ * @see #getB()
+ * @generated
+ */
+ void setB(Morphism value);
+
+} // Pair
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MappingImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MappingImpl.java
new file mode 100644
index 0000000..08fbf22
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MappingImpl.java
@@ -0,0 +1,218 @@
+/**
+ */
+package morphisms.impl;
+
+import graph.Node;
+
+import morphisms.Mapping;
+import morphisms.MorphismsPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link morphisms.impl.MappingImpl#getOrigin <em>Origin</em>}</li>
+ * <li>{@link morphisms.impl.MappingImpl#getImage <em>Image</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class MappingImpl extends MinimalEObjectImpl.Container implements Mapping {
+ /**
+ * The cached value of the '{@link #getOrigin() <em>Origin</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOrigin()
+ * @generated
+ * @ordered
+ */
+ protected Node origin;
+
+ /**
+ * The cached value of the '{@link #getImage() <em>Image</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImage()
+ * @generated
+ * @ordered
+ */
+ protected Node image;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MappingImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return MorphismsPackage.Literals.MAPPING;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getOrigin() {
+ if (origin != null && origin.eIsProxy()) {
+ InternalEObject oldOrigin = (InternalEObject)origin;
+ origin = (Node)eResolveProxy(oldOrigin);
+ if (origin != oldOrigin) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, MorphismsPackage.MAPPING__ORIGIN, oldOrigin, origin));
+ }
+ }
+ return origin;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetOrigin() {
+ return origin;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOrigin(Node newOrigin) {
+ Node oldOrigin = origin;
+ origin = newOrigin;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, MorphismsPackage.MAPPING__ORIGIN, oldOrigin, origin));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getImage() {
+ if (image != null && image.eIsProxy()) {
+ InternalEObject oldImage = (InternalEObject)image;
+ image = (Node)eResolveProxy(oldImage);
+ if (image != oldImage) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, MorphismsPackage.MAPPING__IMAGE, oldImage, image));
+ }
+ }
+ return image;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetImage() {
+ return image;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setImage(Node newImage) {
+ Node oldImage = image;
+ image = newImage;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, MorphismsPackage.MAPPING__IMAGE, oldImage, image));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case MorphismsPackage.MAPPING__ORIGIN:
+ if (resolve) return getOrigin();
+ return basicGetOrigin();
+ case MorphismsPackage.MAPPING__IMAGE:
+ if (resolve) return getImage();
+ return basicGetImage();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case MorphismsPackage.MAPPING__ORIGIN:
+ setOrigin((Node)newValue);
+ return;
+ case MorphismsPackage.MAPPING__IMAGE:
+ setImage((Node)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case MorphismsPackage.MAPPING__ORIGIN:
+ setOrigin((Node)null);
+ return;
+ case MorphismsPackage.MAPPING__IMAGE:
+ setImage((Node)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case MorphismsPackage.MAPPING__ORIGIN:
+ return origin != null;
+ case MorphismsPackage.MAPPING__IMAGE:
+ return image != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //MappingImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismImpl.java
new file mode 100644
index 0000000..f24bed4
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismImpl.java
@@ -0,0 +1,276 @@
+/**
+ */
+package morphisms.impl;
+
+import graph.Graph;
+
+import java.util.Collection;
+
+import morphisms.Mapping;
+import morphisms.Morphism;
+import morphisms.MorphismsPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Morphism</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link morphisms.impl.MorphismImpl#getDomain <em>Domain</em>}</li>
+ * <li>{@link morphisms.impl.MorphismImpl#getCodomain <em>Codomain</em>}</li>
+ * <li>{@link morphisms.impl.MorphismImpl#getMappings <em>Mappings</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class MorphismImpl extends MinimalEObjectImpl.Container implements Morphism {
+ /**
+ * The cached value of the '{@link #getDomain() <em>Domain</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDomain()
+ * @generated
+ * @ordered
+ */
+ protected Graph domain;
+
+ /**
+ * The cached value of the '{@link #getCodomain() <em>Codomain</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCodomain()
+ * @generated
+ * @ordered
+ */
+ protected Graph codomain;
+
+ /**
+ * The cached value of the '{@link #getMappings() <em>Mappings</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMappings()
+ * @generated
+ * @ordered
+ */
+ protected EList<Mapping> mappings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MorphismImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return MorphismsPackage.Literals.MORPHISM;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getDomain() {
+ if (domain != null && domain.eIsProxy()) {
+ InternalEObject oldDomain = (InternalEObject)domain;
+ domain = (Graph)eResolveProxy(oldDomain);
+ if (domain != oldDomain) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, MorphismsPackage.MORPHISM__DOMAIN, oldDomain, domain));
+ }
+ }
+ return domain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph basicGetDomain() {
+ return domain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDomain(Graph newDomain) {
+ Graph oldDomain = domain;
+ domain = newDomain;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, MorphismsPackage.MORPHISM__DOMAIN, oldDomain, domain));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getCodomain() {
+ if (codomain != null && codomain.eIsProxy()) {
+ InternalEObject oldCodomain = (InternalEObject)codomain;
+ codomain = (Graph)eResolveProxy(oldCodomain);
+ if (codomain != oldCodomain) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, MorphismsPackage.MORPHISM__CODOMAIN, oldCodomain, codomain));
+ }
+ }
+ return codomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph basicGetCodomain() {
+ return codomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCodomain(Graph newCodomain) {
+ Graph oldCodomain = codomain;
+ codomain = newCodomain;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, MorphismsPackage.MORPHISM__CODOMAIN, oldCodomain, codomain));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Mapping> getMappings() {
+ if (mappings == null) {
+ mappings = new EObjectContainmentEList<Mapping>(Mapping.class, this, MorphismsPackage.MORPHISM__MAPPINGS);
+ }
+ return mappings;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case MorphismsPackage.MORPHISM__MAPPINGS:
+ return ((InternalEList<?>)getMappings()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case MorphismsPackage.MORPHISM__DOMAIN:
+ if (resolve) return getDomain();
+ return basicGetDomain();
+ case MorphismsPackage.MORPHISM__CODOMAIN:
+ if (resolve) return getCodomain();
+ return basicGetCodomain();
+ case MorphismsPackage.MORPHISM__MAPPINGS:
+ return getMappings();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case MorphismsPackage.MORPHISM__DOMAIN:
+ setDomain((Graph)newValue);
+ return;
+ case MorphismsPackage.MORPHISM__CODOMAIN:
+ setCodomain((Graph)newValue);
+ return;
+ case MorphismsPackage.MORPHISM__MAPPINGS:
+ getMappings().clear();
+ getMappings().addAll((Collection<? extends Mapping>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case MorphismsPackage.MORPHISM__DOMAIN:
+ setDomain((Graph)null);
+ return;
+ case MorphismsPackage.MORPHISM__CODOMAIN:
+ setCodomain((Graph)null);
+ return;
+ case MorphismsPackage.MORPHISM__MAPPINGS:
+ getMappings().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case MorphismsPackage.MORPHISM__DOMAIN:
+ return domain != null;
+ case MorphismsPackage.MORPHISM__CODOMAIN:
+ return codomain != null;
+ case MorphismsPackage.MORPHISM__MAPPINGS:
+ return mappings != null && !mappings.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //MorphismImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismsFactoryImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismsFactoryImpl.java
new file mode 100644
index 0000000..43f1c56
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismsFactoryImpl.java
@@ -0,0 +1,117 @@
+/**
+ */
+package morphisms.impl;
+
+import morphisms.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class MorphismsFactoryImpl extends EFactoryImpl implements MorphismsFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static MorphismsFactory init() {
+ try {
+ MorphismsFactory theMorphismsFactory = (MorphismsFactory)EPackage.Registry.INSTANCE.getEFactory(MorphismsPackage.eNS_URI);
+ if (theMorphismsFactory != null) {
+ return theMorphismsFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new MorphismsFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MorphismsFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case MorphismsPackage.MORPHISM: return createMorphism();
+ case MorphismsPackage.MAPPING: return createMapping();
+ case MorphismsPackage.PAIR: return createPair();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Morphism createMorphism() {
+ MorphismImpl morphism = new MorphismImpl();
+ return morphism;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Mapping createMapping() {
+ MappingImpl mapping = new MappingImpl();
+ return mapping;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Pair createPair() {
+ PairImpl pair = new PairImpl();
+ return pair;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MorphismsPackage getMorphismsPackage() {
+ return (MorphismsPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static MorphismsPackage getPackage() {
+ return MorphismsPackage.eINSTANCE;
+ }
+
+} //MorphismsFactoryImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismsPackageImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismsPackageImpl.java
new file mode 100644
index 0000000..6abfd2e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/MorphismsPackageImpl.java
@@ -0,0 +1,313 @@
+/**
+ */
+package morphisms.impl;
+
+import graph.GraphPackage;
+
+import morphisms.Mapping;
+import morphisms.Morphism;
+import morphisms.MorphismsFactory;
+import morphisms.MorphismsPackage;
+import morphisms.Pair;
+
+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 MorphismsPackageImpl extends EPackageImpl implements MorphismsPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass morphismEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass mappingEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass pairEClass = 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 morphisms.MorphismsPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private MorphismsPackageImpl() {
+ super(eNS_URI, MorphismsFactory.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 MorphismsPackage#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 MorphismsPackage init() {
+ if (isInited) return (MorphismsPackage)EPackage.Registry.INSTANCE.getEPackage(MorphismsPackage.eNS_URI);
+
+ // Obtain or create and register package
+ MorphismsPackageImpl theMorphismsPackage = (MorphismsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MorphismsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MorphismsPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ GraphPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theMorphismsPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theMorphismsPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theMorphismsPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(MorphismsPackage.eNS_URI, theMorphismsPackage);
+ return theMorphismsPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getMorphism() {
+ return morphismEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_Domain() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_Codomain() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_Mappings() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getMapping() {
+ return mappingEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMapping_Origin() {
+ return (EReference)mappingEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMapping_Image() {
+ return (EReference)mappingEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPair() {
+ return pairEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPair_A() {
+ return (EReference)pairEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPair_B() {
+ return (EReference)pairEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MorphismsFactory getMorphismsFactory() {
+ return (MorphismsFactory)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
+ morphismEClass = createEClass(MORPHISM);
+ createEReference(morphismEClass, MORPHISM__DOMAIN);
+ createEReference(morphismEClass, MORPHISM__CODOMAIN);
+ createEReference(morphismEClass, MORPHISM__MAPPINGS);
+
+ mappingEClass = createEClass(MAPPING);
+ createEReference(mappingEClass, MAPPING__ORIGIN);
+ createEReference(mappingEClass, MAPPING__IMAGE);
+
+ pairEClass = createEClass(PAIR);
+ createEReference(pairEClass, PAIR__A);
+ createEReference(pairEClass, PAIR__B);
+ }
+
+ /**
+ * <!-- 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
+ GraphPackage theGraphPackage = (GraphPackage)EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(morphismEClass, Morphism.class, "Morphism", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getMorphism_Domain(), theGraphPackage.getGraph(), null, "domain", null, 0, 1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMorphism_Codomain(), theGraphPackage.getGraph(), null, "codomain", null, 0, 1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMorphism_Mappings(), this.getMapping(), null, "mappings", null, 0, -1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(mappingEClass, Mapping.class, "Mapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getMapping_Origin(), theGraphPackage.getNode(), null, "origin", null, 1, 1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMapping_Image(), theGraphPackage.getNode(), null, "image", null, 1, 1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(pairEClass, Pair.class, "Pair", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getPair_A(), this.getMorphism(), null, "a", null, 1, 1, Pair.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPair_B(), this.getMorphism(), null, "b", null, 1, 1, Pair.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
+ // http://www.eclipse.org/OCL/Import
+ createImportAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createImportAnnotations() {
+ String source = "http://www.eclipse.org/OCL/Import";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "graph", "graph.ecore#/"
+ });
+ }
+
+} //MorphismsPackageImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/PairImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/PairImpl.java
new file mode 100644
index 0000000..3f36ac5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/impl/PairImpl.java
@@ -0,0 +1,242 @@
+/**
+ */
+package morphisms.impl;
+
+import morphisms.Morphism;
+import morphisms.MorphismsPackage;
+import morphisms.Pair;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Pair</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link morphisms.impl.PairImpl#getA <em>A</em>}</li>
+ * <li>{@link morphisms.impl.PairImpl#getB <em>B</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class PairImpl extends MinimalEObjectImpl.Container implements Pair {
+ /**
+ * The cached value of the '{@link #getA() <em>A</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getA()
+ * @generated
+ * @ordered
+ */
+ protected Morphism a;
+
+ /**
+ * The cached value of the '{@link #getB() <em>B</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getB()
+ * @generated
+ * @ordered
+ */
+ protected Morphism b;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PairImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return MorphismsPackage.Literals.PAIR;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Morphism getA() {
+ return a;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetA(Morphism newA, NotificationChain msgs) {
+ Morphism oldA = a;
+ a = newA;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MorphismsPackage.PAIR__A, oldA, newA);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setA(Morphism newA) {
+ if (newA != a) {
+ NotificationChain msgs = null;
+ if (a != null)
+ msgs = ((InternalEObject)a).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MorphismsPackage.PAIR__A, null, msgs);
+ if (newA != null)
+ msgs = ((InternalEObject)newA).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MorphismsPackage.PAIR__A, null, msgs);
+ msgs = basicSetA(newA, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, MorphismsPackage.PAIR__A, newA, newA));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Morphism getB() {
+ return b;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetB(Morphism newB, NotificationChain msgs) {
+ Morphism oldB = b;
+ b = newB;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MorphismsPackage.PAIR__B, oldB, newB);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setB(Morphism newB) {
+ if (newB != b) {
+ NotificationChain msgs = null;
+ if (b != null)
+ msgs = ((InternalEObject)b).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MorphismsPackage.PAIR__B, null, msgs);
+ if (newB != null)
+ msgs = ((InternalEObject)newB).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MorphismsPackage.PAIR__B, null, msgs);
+ msgs = basicSetB(newB, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, MorphismsPackage.PAIR__B, newB, newB));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case MorphismsPackage.PAIR__A:
+ return basicSetA(null, msgs);
+ case MorphismsPackage.PAIR__B:
+ return basicSetB(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case MorphismsPackage.PAIR__A:
+ return getA();
+ case MorphismsPackage.PAIR__B:
+ return getB();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case MorphismsPackage.PAIR__A:
+ setA((Morphism)newValue);
+ return;
+ case MorphismsPackage.PAIR__B:
+ setB((Morphism)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case MorphismsPackage.PAIR__A:
+ setA((Morphism)null);
+ return;
+ case MorphismsPackage.PAIR__B:
+ setB((Morphism)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case MorphismsPackage.PAIR__A:
+ return a != null;
+ case MorphismsPackage.PAIR__B:
+ return b != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //PairImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/util/MorphismsAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/util/MorphismsAdapterFactory.java
new file mode 100644
index 0000000..e5c0eae
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/util/MorphismsAdapterFactory.java
@@ -0,0 +1,156 @@
+/**
+ */
+package morphisms.util;
+
+import morphisms.*;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see morphisms.MorphismsPackage
+ * @generated
+ */
+public class MorphismsAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static MorphismsPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MorphismsAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = MorphismsPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MorphismsSwitch<Adapter> modelSwitch =
+ new MorphismsSwitch<Adapter>() {
+ @Override
+ public Adapter caseMorphism(Morphism object) {
+ return createMorphismAdapter();
+ }
+ @Override
+ public Adapter caseMapping(Mapping object) {
+ return createMappingAdapter();
+ }
+ @Override
+ public Adapter casePair(Pair object) {
+ return createPairAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link morphisms.Morphism <em>Morphism</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see morphisms.Morphism
+ * @generated
+ */
+ public Adapter createMorphismAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link morphisms.Mapping <em>Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see morphisms.Mapping
+ * @generated
+ */
+ public Adapter createMappingAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link morphisms.Pair <em>Pair</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see morphisms.Pair
+ * @generated
+ */
+ public Adapter createPairAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //MorphismsAdapterFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/util/MorphismsSwitch.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/util/MorphismsSwitch.java
new file mode 100644
index 0000000..9c4bd29
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/morphisms/util/MorphismsSwitch.java
@@ -0,0 +1,152 @@
+/**
+ */
+package morphisms.util;
+
+import morphisms.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see morphisms.MorphismsPackage
+ * @generated
+ */
+public class MorphismsSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static MorphismsPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MorphismsSwitch() {
+ if (modelPackage == null) {
+ modelPackage = MorphismsPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case MorphismsPackage.MORPHISM: {
+ Morphism morphism = (Morphism)theEObject;
+ T result = caseMorphism(morphism);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case MorphismsPackage.MAPPING: {
+ Mapping mapping = (Mapping)theEObject;
+ T result = caseMapping(mapping);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case MorphismsPackage.PAIR: {
+ Pair pair = (Pair)theEObject;
+ T result = casePair(pair);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Morphism</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMorphism(Morphism object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Mapping</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Mapping</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMapping(Mapping object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Pair</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Pair</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePair(Pair object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //MorphismsSwitch
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/EdgeMapping.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/EdgeMapping.java
new file mode 100644
index 0000000..3ac8e0b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/EdgeMapping.java
@@ -0,0 +1,79 @@
+/**
+ */
+package nestedcondition;
+
+import graph.Edge;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Edge Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.EdgeMapping#getOrigin <em>Origin</em>}</li>
+ * <li>{@link nestedcondition.EdgeMapping#getImage <em>Image</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getEdgeMapping()
+ * @model
+ * @generated
+ */
+public interface EdgeMapping extends EObject {
+ /**
+ * Returns the value of the '<em><b>Origin</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Origin</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Origin</em>' reference.
+ * @see #setOrigin(Edge)
+ * @see nestedcondition.NestedconditionPackage#getEdgeMapping_Origin()
+ * @model required="true"
+ * @generated
+ */
+ Edge getOrigin();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.EdgeMapping#getOrigin <em>Origin</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Origin</em>' reference.
+ * @see #getOrigin()
+ * @generated
+ */
+ void setOrigin(Edge value);
+
+ /**
+ * Returns the value of the '<em><b>Image</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Image</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Image</em>' reference.
+ * @see #setImage(Edge)
+ * @see nestedcondition.NestedconditionPackage#getEdgeMapping_Image()
+ * @model required="true"
+ * @generated
+ */
+ Edge getImage();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.EdgeMapping#getImage <em>Image</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Image</em>' reference.
+ * @see #getImage()
+ * @generated
+ */
+ void setImage(Edge value);
+
+} // EdgeMapping
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Formula.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Formula.java
new file mode 100644
index 0000000..dae64b5
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Formula.java
@@ -0,0 +1,73 @@
+/**
+ */
+package nestedcondition;
+
+import laxcondition.Operator;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Formula</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.Formula#getOperator <em>Operator</em>}</li>
+ * <li>{@link nestedcondition.Formula#getArguments <em>Arguments</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getFormula()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='ArgumentsDomainConsistency OneArgumentForNOT AtLeastTwoArgumentForANDOR TwoArgumentForIMPLEQUALXOR'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot ArgumentsDomainConsistency='self.arguments -> forAll(cond|cond.domain = self.domain)' OneArgumentForNOT='(self.operator = laxcondition::Operator::NOT) implies (self.arguments -> size() = 1)' AtLeastTwoArgumentForANDOR='((self.operator = laxcondition::Operator::AND) or (self.operator = laxcondition::Operator::OR)) implies (self.arguments -> size() > 1)' TwoArgumentForIMPLEQUALXOR='((self.operator = laxcondition::Operator::IMPLIES) or (self.operator = laxcondition::Operator::EQUIVALENT) or (self.operator = laxcondition::Operator::XOR)) implies (self.arguments -> size() = 2)'"
+ * @generated
+ */
+public interface Formula extends NestedCondition {
+ /**
+ * Returns the value of the '<em><b>Operator</b></em>' attribute.
+ * The literals are from the enumeration {@link laxcondition.Operator}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Operator</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Operator</em>' attribute.
+ * @see laxcondition.Operator
+ * @see #setOperator(Operator)
+ * @see nestedcondition.NestedconditionPackage#getFormula_Operator()
+ * @model
+ * @generated
+ */
+ Operator getOperator();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.Formula#getOperator <em>Operator</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Operator</em>' attribute.
+ * @see laxcondition.Operator
+ * @see #getOperator()
+ * @generated
+ */
+ void setOperator(Operator value);
+
+ /**
+ * Returns the value of the '<em><b>Arguments</b></em>' containment reference list.
+ * The list contents are of type {@link nestedcondition.NestedCondition}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Arguments</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Arguments</em>' containment reference list.
+ * @see nestedcondition.NestedconditionPackage#getFormula_Arguments()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ EList<NestedCondition> getArguments();
+
+} // Formula
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Morphism.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Morphism.java
new file mode 100644
index 0000000..8349b1e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Morphism.java
@@ -0,0 +1,116 @@
+/**
+ */
+package nestedcondition;
+
+import graph.Graph;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Morphism</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.Morphism#getNodeMappings <em>Node Mappings</em>}</li>
+ * <li>{@link nestedcondition.Morphism#getFrom <em>From</em>}</li>
+ * <li>{@link nestedcondition.Morphism#getTo <em>To</em>}</li>
+ * <li>{@link nestedcondition.Morphism#getEdgeMappings <em>Edge Mappings</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getMorphism()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NodeMappingIsFromDomainToCoDomain EdgeMappingIsFromDomainToCoDomain EdgeMappingConsistency'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot NodeMappingIsFromDomainToCoDomain='self.nodeMappings -> forAll(m|self.from.nodes -> includes(m.origin) and self.to.nodes -> includes(m.image))' EdgeMappingIsFromDomainToCoDomain='self.edgeMappings -> forAll(m|self.from.edges -> includes(m.origin) and self.to.edges -> includes(m.image))' EdgeMappingConsistency='self.edgeMappings -> forAll(em|self.nodeMappings -> exists(nm|nm.origin = em.origin.source and nm.image = em.image.source) and self.nodeMappings -> exists(nm|nm.origin = em.origin.target and nm.image = em.image.target))'"
+ * @generated
+ */
+public interface Morphism extends EObject {
+ /**
+ * Returns the value of the '<em><b>Node Mappings</b></em>' containment reference list.
+ * The list contents are of type {@link nestedcondition.NodeMapping}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Node Mappings</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Node Mappings</em>' containment reference list.
+ * @see nestedcondition.NestedconditionPackage#getMorphism_NodeMappings()
+ * @model containment="true"
+ * @generated
+ */
+ EList<NodeMapping> getNodeMappings();
+
+ /**
+ * Returns the value of the '<em><b>From</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>From</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>From</em>' reference.
+ * @see #setFrom(Graph)
+ * @see nestedcondition.NestedconditionPackage#getMorphism_From()
+ * @model required="true"
+ * @generated
+ */
+ Graph getFrom();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.Morphism#getFrom <em>From</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>From</em>' reference.
+ * @see #getFrom()
+ * @generated
+ */
+ void setFrom(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>To</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>To</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>To</em>' reference.
+ * @see #setTo(Graph)
+ * @see nestedcondition.NestedconditionPackage#getMorphism_To()
+ * @model required="true"
+ * @generated
+ */
+ Graph getTo();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.Morphism#getTo <em>To</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>To</em>' reference.
+ * @see #getTo()
+ * @generated
+ */
+ void setTo(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Edge Mappings</b></em>' containment reference list.
+ * The list contents are of type {@link nestedcondition.EdgeMapping}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Edge Mappings</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Edge Mappings</em>' containment reference list.
+ * @see nestedcondition.NestedconditionPackage#getMorphism_EdgeMappings()
+ * @model containment="true"
+ * @generated
+ */
+ EList<EdgeMapping> getEdgeMappings();
+
+} // Morphism
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedCondition.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedCondition.java
new file mode 100644
index 0000000..62082c2
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedCondition.java
@@ -0,0 +1,71 @@
+/**
+ */
+package nestedcondition;
+
+import graph.Graph;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Nested Condition</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.NestedCondition#getVariables <em>Variables</em>}</li>
+ * <li>{@link nestedcondition.NestedCondition#getDomain <em>Domain</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getNestedCondition()
+ * @model abstract="true"
+ * @generated
+ */
+public interface NestedCondition extends EObject {
+ /**
+ * Returns the value of the '<em><b>Variables</b></em>' containment reference list.
+ * The list contents are of type {@link nestedcondition.Variable}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Variables</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Variables</em>' containment reference list.
+ * @see nestedcondition.NestedconditionPackage#getNestedCondition_Variables()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Variable> getVariables();
+
+ /**
+ * Returns the value of the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Domain</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Domain</em>' reference.
+ * @see #setDomain(Graph)
+ * @see nestedcondition.NestedconditionPackage#getNestedCondition_Domain()
+ * @model required="true"
+ * @generated
+ */
+ Graph getDomain();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NestedCondition#getDomain <em>Domain</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Domain</em>' reference.
+ * @see #getDomain()
+ * @generated
+ */
+ void setDomain(Graph value);
+
+} // NestedCondition
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedConstraint.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedConstraint.java
new file mode 100644
index 0000000..decdd14
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedConstraint.java
@@ -0,0 +1,135 @@
+/**
+ */
+package nestedcondition;
+
+import graph.Graph;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Nested Constraint</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.NestedConstraint#getName <em>Name</em>}</li>
+ * <li>{@link nestedcondition.NestedConstraint#getTypeGraph <em>Type Graph</em>}</li>
+ * <li>{@link nestedcondition.NestedConstraint#getCondition <em>Condition</em>}</li>
+ * <li>{@link nestedcondition.NestedConstraint#getDomain <em>Domain</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getNestedConstraint()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='ConstraintDomainIsEmpty RootConditionDomainIsConatraintDomain TypeGraphConsistency HostGraphConsistency'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot ConstraintDomainIsEmpty='self.domain.nodes -> isEmpty() and self.domain.edges -> isEmpty()' RootConditionDomainIsConatraintDomain='self.condition.domain = self.domain' TypeGraphConsistency='graph::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)' HostGraphConsistency='graph::Graph.allInstances() -> forAll(g|g.edges -> forAll(e|g.nodes -> includes(e.source) and g.nodes -> includes(e.target)))'"
+ * @generated
+ */
+public interface NestedConstraint extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see nestedcondition.NestedconditionPackage#getNestedConstraint_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NestedConstraint#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Graph</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Graph</em>' reference.
+ * @see #setTypeGraph(EPackage)
+ * @see nestedcondition.NestedconditionPackage#getNestedConstraint_TypeGraph()
+ * @model required="true"
+ * @generated
+ */
+ EPackage getTypeGraph();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NestedConstraint#getTypeGraph <em>Type Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type Graph</em>' reference.
+ * @see #getTypeGraph()
+ * @generated
+ */
+ void setTypeGraph(EPackage value);
+
+ /**
+ * Returns the value of the '<em><b>Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Condition</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Condition</em>' containment reference.
+ * @see #setCondition(NestedCondition)
+ * @see nestedcondition.NestedconditionPackage#getNestedConstraint_Condition()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ NestedCondition getCondition();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NestedConstraint#getCondition <em>Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Condition</em>' containment reference.
+ * @see #getCondition()
+ * @generated
+ */
+ void setCondition(NestedCondition value);
+
+ /**
+ * Returns the value of the '<em><b>Domain</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Domain</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Domain</em>' containment reference.
+ * @see #setDomain(Graph)
+ * @see nestedcondition.NestedconditionPackage#getNestedConstraint_Domain()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ Graph getDomain();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NestedConstraint#getDomain <em>Domain</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Domain</em>' containment reference.
+ * @see #getDomain()
+ * @generated
+ */
+ void setDomain(Graph value);
+
+} // NestedConstraint
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedconditionFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedconditionFactory.java
new file mode 100644
index 0000000..17e40be
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedconditionFactory.java
@@ -0,0 +1,105 @@
+/**
+ */
+package nestedcondition;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see nestedcondition.NestedconditionPackage
+ * @generated
+ */
+public interface NestedconditionFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ NestedconditionFactory eINSTANCE = nestedcondition.impl.NestedconditionFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Nested Constraint</em>'.
+ * @generated
+ */
+ NestedConstraint createNestedConstraint();
+
+ /**
+ * Returns a new object of class '<em>Variable</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Variable</em>'.
+ * @generated
+ */
+ Variable createVariable();
+
+ /**
+ * Returns a new object of class '<em>Quantified Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quantified Condition</em>'.
+ * @generated
+ */
+ QuantifiedCondition createQuantifiedCondition();
+
+ /**
+ * Returns a new object of class '<em>True</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>True</em>'.
+ * @generated
+ */
+ True createTrue();
+
+ /**
+ * Returns a new object of class '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Formula</em>'.
+ * @generated
+ */
+ Formula createFormula();
+
+ /**
+ * Returns a new object of class '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Morphism</em>'.
+ * @generated
+ */
+ Morphism createMorphism();
+
+ /**
+ * Returns a new object of class '<em>Node Mapping</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Node Mapping</em>'.
+ * @generated
+ */
+ NodeMapping createNodeMapping();
+
+ /**
+ * Returns a new object of class '<em>Edge Mapping</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Edge Mapping</em>'.
+ * @generated
+ */
+ EdgeMapping createEdgeMapping();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ NestedconditionPackage getNestedconditionPackage();
+
+} //NestedconditionFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedconditionPackage.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedconditionPackage.java
new file mode 100644
index 0000000..dd0a790
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NestedconditionPackage.java
@@ -0,0 +1,1161 @@
+/**
+ */
+package nestedcondition;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see nestedcondition.NestedconditionFactory
+ * @model kind="package"
+ * annotation="http://www.eclipse.org/OCL/Import ecore='http://www.eclipse.org/emf/2002/Ecore#/' graph='graph.ecore#/' laxcondition='laxcondition.ecore#/'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore invocationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' settingDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' validationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot'"
+ * @generated
+ */
+public interface NestedconditionPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "nestedcondition";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.example.org/nestedcondition";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "nestedcondition";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ NestedconditionPackage eINSTANCE = nestedcondition.impl.NestedconditionPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.NestedConstraintImpl <em>Nested Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.NestedConstraintImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getNestedConstraint()
+ * @generated
+ */
+ int NESTED_CONSTRAINT = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Type Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT__TYPE_GRAPH = 1;
+
+ /**
+ * The feature id for the '<em><b>Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT__CONDITION = 2;
+
+ /**
+ * The feature id for the '<em><b>Domain</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT__DOMAIN = 3;
+
+ /**
+ * The number of structural features of the '<em>Nested Constraint</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT_FEATURE_COUNT = 4;
+
+ /**
+ * The number of operations of the '<em>Nested Constraint</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.NestedConditionImpl <em>Nested Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.NestedConditionImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getNestedCondition()
+ * @generated
+ */
+ int NESTED_CONDITION = 1;
+
+ /**
+ * The feature id for the '<em><b>Variables</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONDITION__VARIABLES = 0;
+
+ /**
+ * The feature id for the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONDITION__DOMAIN = 1;
+
+ /**
+ * The number of structural features of the '<em>Nested Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONDITION_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Nested Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONDITION_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.VariableImpl <em>Variable</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.VariableImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getVariable()
+ * @generated
+ */
+ int VARIABLE = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VARIABLE__NAME = 0;
+
+ /**
+ * The number of structural features of the '<em>Variable</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VARIABLE_FEATURE_COUNT = 1;
+
+ /**
+ * The number of operations of the '<em>Variable</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VARIABLE_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.QuantifiedConditionImpl <em>Quantified Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.QuantifiedConditionImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getQuantifiedCondition()
+ * @generated
+ */
+ int QUANTIFIED_CONDITION = 3;
+
+ /**
+ * The feature id for the '<em><b>Variables</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION__VARIABLES = NESTED_CONDITION__VARIABLES;
+
+ /**
+ * The feature id for the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION__DOMAIN = NESTED_CONDITION__DOMAIN;
+
+ /**
+ * The feature id for the '<em><b>Quantifier</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION__QUANTIFIER = NESTED_CONDITION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION__CONDITION = NESTED_CONDITION_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Morphism</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION__MORPHISM = NESTED_CONDITION_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Codomain</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION__CODOMAIN = NESTED_CONDITION_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Quantified Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION_FEATURE_COUNT = NESTED_CONDITION_FEATURE_COUNT + 4;
+
+ /**
+ * The number of operations of the '<em>Quantified Condition</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUANTIFIED_CONDITION_OPERATION_COUNT = NESTED_CONDITION_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.TrueImpl <em>True</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.TrueImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getTrue()
+ * @generated
+ */
+ int TRUE = 4;
+
+ /**
+ * The feature id for the '<em><b>Variables</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE__VARIABLES = NESTED_CONDITION__VARIABLES;
+
+ /**
+ * The feature id for the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE__DOMAIN = NESTED_CONDITION__DOMAIN;
+
+ /**
+ * The number of structural features of the '<em>True</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE_FEATURE_COUNT = NESTED_CONDITION_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>True</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TRUE_OPERATION_COUNT = NESTED_CONDITION_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.FormulaImpl <em>Formula</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.FormulaImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getFormula()
+ * @generated
+ */
+ int FORMULA = 5;
+
+ /**
+ * The feature id for the '<em><b>Variables</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__VARIABLES = NESTED_CONDITION__VARIABLES;
+
+ /**
+ * The feature id for the '<em><b>Domain</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__DOMAIN = NESTED_CONDITION__DOMAIN;
+
+ /**
+ * The feature id for the '<em><b>Operator</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__OPERATOR = NESTED_CONDITION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Arguments</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA__ARGUMENTS = NESTED_CONDITION_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Formula</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA_FEATURE_COUNT = NESTED_CONDITION_FEATURE_COUNT + 2;
+
+ /**
+ * The number of operations of the '<em>Formula</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FORMULA_OPERATION_COUNT = NESTED_CONDITION_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.MorphismImpl <em>Morphism</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.MorphismImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getMorphism()
+ * @generated
+ */
+ int MORPHISM = 6;
+
+ /**
+ * The feature id for the '<em><b>Node Mappings</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__NODE_MAPPINGS = 0;
+
+ /**
+ * The feature id for the '<em><b>From</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__FROM = 1;
+
+ /**
+ * The feature id for the '<em><b>To</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__TO = 2;
+
+ /**
+ * The feature id for the '<em><b>Edge Mappings</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM__EDGE_MAPPINGS = 3;
+
+ /**
+ * The number of structural features of the '<em>Morphism</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM_FEATURE_COUNT = 4;
+
+ /**
+ * The number of operations of the '<em>Morphism</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MORPHISM_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.NodeMappingImpl <em>Node Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.NodeMappingImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getNodeMapping()
+ * @generated
+ */
+ int NODE_MAPPING = 7;
+
+ /**
+ * The feature id for the '<em><b>Origin</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_MAPPING__ORIGIN = 0;
+
+ /**
+ * The feature id for the '<em><b>Image</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_MAPPING__IMAGE = 1;
+
+ /**
+ * The number of structural features of the '<em>Node Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_MAPPING_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Node Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_MAPPING_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link nestedcondition.impl.EdgeMappingImpl <em>Edge Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.EdgeMappingImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getEdgeMapping()
+ * @generated
+ */
+ int EDGE_MAPPING = 8;
+
+ /**
+ * The feature id for the '<em><b>Origin</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE_MAPPING__ORIGIN = 0;
+
+ /**
+ * The feature id for the '<em><b>Image</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE_MAPPING__IMAGE = 1;
+
+ /**
+ * The number of structural features of the '<em>Edge Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE_MAPPING_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Edge Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDGE_MAPPING_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.NestedConstraint <em>Nested Constraint</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Nested Constraint</em>'.
+ * @see nestedcondition.NestedConstraint
+ * @generated
+ */
+ EClass getNestedConstraint();
+
+ /**
+ * Returns the meta object for the attribute '{@link nestedcondition.NestedConstraint#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see nestedcondition.NestedConstraint#getName()
+ * @see #getNestedConstraint()
+ * @generated
+ */
+ EAttribute getNestedConstraint_Name();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.NestedConstraint#getTypeGraph <em>Type Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Type Graph</em>'.
+ * @see nestedcondition.NestedConstraint#getTypeGraph()
+ * @see #getNestedConstraint()
+ * @generated
+ */
+ EReference getNestedConstraint_TypeGraph();
+
+ /**
+ * Returns the meta object for the containment reference '{@link nestedcondition.NestedConstraint#getCondition <em>Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Condition</em>'.
+ * @see nestedcondition.NestedConstraint#getCondition()
+ * @see #getNestedConstraint()
+ * @generated
+ */
+ EReference getNestedConstraint_Condition();
+
+ /**
+ * Returns the meta object for the containment reference '{@link nestedcondition.NestedConstraint#getDomain <em>Domain</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Domain</em>'.
+ * @see nestedcondition.NestedConstraint#getDomain()
+ * @see #getNestedConstraint()
+ * @generated
+ */
+ EReference getNestedConstraint_Domain();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.NestedCondition <em>Nested Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Nested Condition</em>'.
+ * @see nestedcondition.NestedCondition
+ * @generated
+ */
+ EClass getNestedCondition();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link nestedcondition.NestedCondition#getVariables <em>Variables</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Variables</em>'.
+ * @see nestedcondition.NestedCondition#getVariables()
+ * @see #getNestedCondition()
+ * @generated
+ */
+ EReference getNestedCondition_Variables();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.NestedCondition#getDomain <em>Domain</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Domain</em>'.
+ * @see nestedcondition.NestedCondition#getDomain()
+ * @see #getNestedCondition()
+ * @generated
+ */
+ EReference getNestedCondition_Domain();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.Variable <em>Variable</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Variable</em>'.
+ * @see nestedcondition.Variable
+ * @generated
+ */
+ EClass getVariable();
+
+ /**
+ * Returns the meta object for the attribute '{@link nestedcondition.Variable#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see nestedcondition.Variable#getName()
+ * @see #getVariable()
+ * @generated
+ */
+ EAttribute getVariable_Name();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.QuantifiedCondition <em>Quantified Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Quantified Condition</em>'.
+ * @see nestedcondition.QuantifiedCondition
+ * @generated
+ */
+ EClass getQuantifiedCondition();
+
+ /**
+ * Returns the meta object for the attribute '{@link nestedcondition.QuantifiedCondition#getQuantifier <em>Quantifier</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Quantifier</em>'.
+ * @see nestedcondition.QuantifiedCondition#getQuantifier()
+ * @see #getQuantifiedCondition()
+ * @generated
+ */
+ EAttribute getQuantifiedCondition_Quantifier();
+
+ /**
+ * Returns the meta object for the containment reference '{@link nestedcondition.QuantifiedCondition#getCondition <em>Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Condition</em>'.
+ * @see nestedcondition.QuantifiedCondition#getCondition()
+ * @see #getQuantifiedCondition()
+ * @generated
+ */
+ EReference getQuantifiedCondition_Condition();
+
+ /**
+ * Returns the meta object for the containment reference '{@link nestedcondition.QuantifiedCondition#getMorphism <em>Morphism</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Morphism</em>'.
+ * @see nestedcondition.QuantifiedCondition#getMorphism()
+ * @see #getQuantifiedCondition()
+ * @generated
+ */
+ EReference getQuantifiedCondition_Morphism();
+
+ /**
+ * Returns the meta object for the containment reference '{@link nestedcondition.QuantifiedCondition#getCodomain <em>Codomain</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Codomain</em>'.
+ * @see nestedcondition.QuantifiedCondition#getCodomain()
+ * @see #getQuantifiedCondition()
+ * @generated
+ */
+ EReference getQuantifiedCondition_Codomain();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.True <em>True</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>True</em>'.
+ * @see nestedcondition.True
+ * @generated
+ */
+ EClass getTrue();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.Formula <em>Formula</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Formula</em>'.
+ * @see nestedcondition.Formula
+ * @generated
+ */
+ EClass getFormula();
+
+ /**
+ * Returns the meta object for the attribute '{@link nestedcondition.Formula#getOperator <em>Operator</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Operator</em>'.
+ * @see nestedcondition.Formula#getOperator()
+ * @see #getFormula()
+ * @generated
+ */
+ EAttribute getFormula_Operator();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link nestedcondition.Formula#getArguments <em>Arguments</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Arguments</em>'.
+ * @see nestedcondition.Formula#getArguments()
+ * @see #getFormula()
+ * @generated
+ */
+ EReference getFormula_Arguments();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.Morphism <em>Morphism</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Morphism</em>'.
+ * @see nestedcondition.Morphism
+ * @generated
+ */
+ EClass getMorphism();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link nestedcondition.Morphism#getNodeMappings <em>Node Mappings</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Node Mappings</em>'.
+ * @see nestedcondition.Morphism#getNodeMappings()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_NodeMappings();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.Morphism#getFrom <em>From</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>From</em>'.
+ * @see nestedcondition.Morphism#getFrom()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_From();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.Morphism#getTo <em>To</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>To</em>'.
+ * @see nestedcondition.Morphism#getTo()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_To();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link nestedcondition.Morphism#getEdgeMappings <em>Edge Mappings</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Edge Mappings</em>'.
+ * @see nestedcondition.Morphism#getEdgeMappings()
+ * @see #getMorphism()
+ * @generated
+ */
+ EReference getMorphism_EdgeMappings();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.NodeMapping <em>Node Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Node Mapping</em>'.
+ * @see nestedcondition.NodeMapping
+ * @generated
+ */
+ EClass getNodeMapping();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.NodeMapping#getOrigin <em>Origin</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Origin</em>'.
+ * @see nestedcondition.NodeMapping#getOrigin()
+ * @see #getNodeMapping()
+ * @generated
+ */
+ EReference getNodeMapping_Origin();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.NodeMapping#getImage <em>Image</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Image</em>'.
+ * @see nestedcondition.NodeMapping#getImage()
+ * @see #getNodeMapping()
+ * @generated
+ */
+ EReference getNodeMapping_Image();
+
+ /**
+ * Returns the meta object for class '{@link nestedcondition.EdgeMapping <em>Edge Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Edge Mapping</em>'.
+ * @see nestedcondition.EdgeMapping
+ * @generated
+ */
+ EClass getEdgeMapping();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.EdgeMapping#getOrigin <em>Origin</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Origin</em>'.
+ * @see nestedcondition.EdgeMapping#getOrigin()
+ * @see #getEdgeMapping()
+ * @generated
+ */
+ EReference getEdgeMapping_Origin();
+
+ /**
+ * Returns the meta object for the reference '{@link nestedcondition.EdgeMapping#getImage <em>Image</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Image</em>'.
+ * @see nestedcondition.EdgeMapping#getImage()
+ * @see #getEdgeMapping()
+ * @generated
+ */
+ EReference getEdgeMapping_Image();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ NestedconditionFactory getNestedconditionFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.NestedConstraintImpl <em>Nested Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.NestedConstraintImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getNestedConstraint()
+ * @generated
+ */
+ EClass NESTED_CONSTRAINT = eINSTANCE.getNestedConstraint();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NESTED_CONSTRAINT__NAME = eINSTANCE.getNestedConstraint_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Type Graph</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NESTED_CONSTRAINT__TYPE_GRAPH = eINSTANCE.getNestedConstraint_TypeGraph();
+
+ /**
+ * The meta object literal for the '<em><b>Condition</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NESTED_CONSTRAINT__CONDITION = eINSTANCE.getNestedConstraint_Condition();
+
+ /**
+ * The meta object literal for the '<em><b>Domain</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NESTED_CONSTRAINT__DOMAIN = eINSTANCE.getNestedConstraint_Domain();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.NestedConditionImpl <em>Nested Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.NestedConditionImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getNestedCondition()
+ * @generated
+ */
+ EClass NESTED_CONDITION = eINSTANCE.getNestedCondition();
+
+ /**
+ * The meta object literal for the '<em><b>Variables</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NESTED_CONDITION__VARIABLES = eINSTANCE.getNestedCondition_Variables();
+
+ /**
+ * The meta object literal for the '<em><b>Domain</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NESTED_CONDITION__DOMAIN = eINSTANCE.getNestedCondition_Domain();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.VariableImpl <em>Variable</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.VariableImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getVariable()
+ * @generated
+ */
+ EClass VARIABLE = eINSTANCE.getVariable();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute VARIABLE__NAME = eINSTANCE.getVariable_Name();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.QuantifiedConditionImpl <em>Quantified Condition</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.QuantifiedConditionImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getQuantifiedCondition()
+ * @generated
+ */
+ EClass QUANTIFIED_CONDITION = eINSTANCE.getQuantifiedCondition();
+
+ /**
+ * The meta object literal for the '<em><b>Quantifier</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute QUANTIFIED_CONDITION__QUANTIFIER = eINSTANCE.getQuantifiedCondition_Quantifier();
+
+ /**
+ * The meta object literal for the '<em><b>Condition</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUANTIFIED_CONDITION__CONDITION = eINSTANCE.getQuantifiedCondition_Condition();
+
+ /**
+ * The meta object literal for the '<em><b>Morphism</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUANTIFIED_CONDITION__MORPHISM = eINSTANCE.getQuantifiedCondition_Morphism();
+
+ /**
+ * The meta object literal for the '<em><b>Codomain</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUANTIFIED_CONDITION__CODOMAIN = eINSTANCE.getQuantifiedCondition_Codomain();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.TrueImpl <em>True</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.TrueImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getTrue()
+ * @generated
+ */
+ EClass TRUE = eINSTANCE.getTrue();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.FormulaImpl <em>Formula</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.FormulaImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getFormula()
+ * @generated
+ */
+ EClass FORMULA = eINSTANCE.getFormula();
+
+ /**
+ * The meta object literal for the '<em><b>Operator</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FORMULA__OPERATOR = eINSTANCE.getFormula_Operator();
+
+ /**
+ * The meta object literal for the '<em><b>Arguments</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference FORMULA__ARGUMENTS = eINSTANCE.getFormula_Arguments();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.MorphismImpl <em>Morphism</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.MorphismImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getMorphism()
+ * @generated
+ */
+ EClass MORPHISM = eINSTANCE.getMorphism();
+
+ /**
+ * The meta object literal for the '<em><b>Node Mappings</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__NODE_MAPPINGS = eINSTANCE.getMorphism_NodeMappings();
+
+ /**
+ * The meta object literal for the '<em><b>From</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__FROM = eINSTANCE.getMorphism_From();
+
+ /**
+ * The meta object literal for the '<em><b>To</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__TO = eINSTANCE.getMorphism_To();
+
+ /**
+ * The meta object literal for the '<em><b>Edge Mappings</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MORPHISM__EDGE_MAPPINGS = eINSTANCE.getMorphism_EdgeMappings();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.NodeMappingImpl <em>Node Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.NodeMappingImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getNodeMapping()
+ * @generated
+ */
+ EClass NODE_MAPPING = eINSTANCE.getNodeMapping();
+
+ /**
+ * The meta object literal for the '<em><b>Origin</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE_MAPPING__ORIGIN = eINSTANCE.getNodeMapping_Origin();
+
+ /**
+ * The meta object literal for the '<em><b>Image</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE_MAPPING__IMAGE = eINSTANCE.getNodeMapping_Image();
+
+ /**
+ * The meta object literal for the '{@link nestedcondition.impl.EdgeMappingImpl <em>Edge Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedcondition.impl.EdgeMappingImpl
+ * @see nestedcondition.impl.NestedconditionPackageImpl#getEdgeMapping()
+ * @generated
+ */
+ EClass EDGE_MAPPING = eINSTANCE.getEdgeMapping();
+
+ /**
+ * The meta object literal for the '<em><b>Origin</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EDGE_MAPPING__ORIGIN = eINSTANCE.getEdgeMapping_Origin();
+
+ /**
+ * The meta object literal for the '<em><b>Image</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EDGE_MAPPING__IMAGE = eINSTANCE.getEdgeMapping_Image();
+
+ }
+
+} //NestedconditionPackage
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NodeMapping.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NodeMapping.java
new file mode 100644
index 0000000..8b97ff0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/NodeMapping.java
@@ -0,0 +1,79 @@
+/**
+ */
+package nestedcondition;
+
+import graph.Node;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Node Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.NodeMapping#getOrigin <em>Origin</em>}</li>
+ * <li>{@link nestedcondition.NodeMapping#getImage <em>Image</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getNodeMapping()
+ * @model
+ * @generated
+ */
+public interface NodeMapping extends EObject {
+ /**
+ * Returns the value of the '<em><b>Origin</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Origin</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Origin</em>' reference.
+ * @see #setOrigin(Node)
+ * @see nestedcondition.NestedconditionPackage#getNodeMapping_Origin()
+ * @model required="true"
+ * @generated
+ */
+ Node getOrigin();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NodeMapping#getOrigin <em>Origin</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Origin</em>' reference.
+ * @see #getOrigin()
+ * @generated
+ */
+ void setOrigin(Node value);
+
+ /**
+ * Returns the value of the '<em><b>Image</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Image</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Image</em>' reference.
+ * @see #setImage(Node)
+ * @see nestedcondition.NestedconditionPackage#getNodeMapping_Image()
+ * @model required="true"
+ * @generated
+ */
+ Node getImage();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.NodeMapping#getImage <em>Image</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Image</em>' reference.
+ * @see #getImage()
+ * @generated
+ */
+ void setImage(Node value);
+
+} // NodeMapping
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/QuantifiedCondition.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/QuantifiedCondition.java
new file mode 100644
index 0000000..e0c5752
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/QuantifiedCondition.java
@@ -0,0 +1,137 @@
+/**
+ */
+package nestedcondition;
+
+import graph.Graph;
+
+import laxcondition.Quantifier;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quantified Condition</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.QuantifiedCondition#getQuantifier <em>Quantifier</em>}</li>
+ * <li>{@link nestedcondition.QuantifiedCondition#getCondition <em>Condition</em>}</li>
+ * <li>{@link nestedcondition.QuantifiedCondition#getMorphism <em>Morphism</em>}</li>
+ * <li>{@link nestedcondition.QuantifiedCondition#getCodomain <em>Codomain</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getQuantifiedCondition()
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NestedDomainIsCoDomain MorphismIsFromDomainToCoDomain'"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot NestedDomainIsCoDomain='self.condition.domain = self.codomain' MorphismIsFromDomainToCoDomain='self.morphism.from = self.domain and self.morphism.to = self.codomain'"
+ * @generated
+ */
+public interface QuantifiedCondition extends NestedCondition {
+ /**
+ * Returns the value of the '<em><b>Quantifier</b></em>' attribute.
+ * The literals are from the enumeration {@link laxcondition.Quantifier}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quantifier</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quantifier</em>' attribute.
+ * @see laxcondition.Quantifier
+ * @see #setQuantifier(Quantifier)
+ * @see nestedcondition.NestedconditionPackage#getQuantifiedCondition_Quantifier()
+ * @model
+ * @generated
+ */
+ Quantifier getQuantifier();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.QuantifiedCondition#getQuantifier <em>Quantifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Quantifier</em>' attribute.
+ * @see laxcondition.Quantifier
+ * @see #getQuantifier()
+ * @generated
+ */
+ void setQuantifier(Quantifier value);
+
+ /**
+ * Returns the value of the '<em><b>Condition</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Condition</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Condition</em>' containment reference.
+ * @see #setCondition(NestedCondition)
+ * @see nestedcondition.NestedconditionPackage#getQuantifiedCondition_Condition()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ NestedCondition getCondition();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.QuantifiedCondition#getCondition <em>Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Condition</em>' containment reference.
+ * @see #getCondition()
+ * @generated
+ */
+ void setCondition(NestedCondition value);
+
+ /**
+ * Returns the value of the '<em><b>Morphism</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Morphism</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Morphism</em>' containment reference.
+ * @see #setMorphism(Morphism)
+ * @see nestedcondition.NestedconditionPackage#getQuantifiedCondition_Morphism()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ Morphism getMorphism();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.QuantifiedCondition#getMorphism <em>Morphism</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Morphism</em>' containment reference.
+ * @see #getMorphism()
+ * @generated
+ */
+ void setMorphism(Morphism value);
+
+ /**
+ * Returns the value of the '<em><b>Codomain</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Codomain</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Codomain</em>' containment reference.
+ * @see #setCodomain(Graph)
+ * @see nestedcondition.NestedconditionPackage#getQuantifiedCondition_Codomain()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ Graph getCodomain();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.QuantifiedCondition#getCodomain <em>Codomain</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Codomain</em>' containment reference.
+ * @see #getCodomain()
+ * @generated
+ */
+ void setCodomain(Graph value);
+
+} // QuantifiedCondition
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/True.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/True.java
new file mode 100644
index 0000000..71b33df
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/True.java
@@ -0,0 +1,17 @@
+/**
+ */
+package nestedcondition;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>True</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see nestedcondition.NestedconditionPackage#getTrue()
+ * @model
+ * @generated
+ */
+public interface True extends NestedCondition {
+} // True
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Variable.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Variable.java
new file mode 100644
index 0000000..9ab05c2
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/Variable.java
@@ -0,0 +1,50 @@
+/**
+ */
+package nestedcondition;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Variable</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.Variable#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @see nestedcondition.NestedconditionPackage#getVariable()
+ * @model
+ * @generated
+ */
+public interface Variable extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see nestedcondition.NestedconditionPackage#getVariable_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link nestedcondition.Variable#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // Variable
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/EdgeMappingImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/EdgeMappingImpl.java
new file mode 100644
index 0000000..d65d5c0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/EdgeMappingImpl.java
@@ -0,0 +1,218 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.Edge;
+
+import nestedcondition.EdgeMapping;
+import nestedcondition.NestedconditionPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Edge Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.EdgeMappingImpl#getOrigin <em>Origin</em>}</li>
+ * <li>{@link nestedcondition.impl.EdgeMappingImpl#getImage <em>Image</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class EdgeMappingImpl extends MinimalEObjectImpl.Container implements EdgeMapping {
+ /**
+ * The cached value of the '{@link #getOrigin() <em>Origin</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOrigin()
+ * @generated
+ * @ordered
+ */
+ protected Edge origin;
+
+ /**
+ * The cached value of the '{@link #getImage() <em>Image</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImage()
+ * @generated
+ * @ordered
+ */
+ protected Edge image;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EdgeMappingImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.EDGE_MAPPING;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Edge getOrigin() {
+ if (origin != null && origin.eIsProxy()) {
+ InternalEObject oldOrigin = (InternalEObject)origin;
+ origin = (Edge)eResolveProxy(oldOrigin);
+ if (origin != oldOrigin) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.EDGE_MAPPING__ORIGIN, oldOrigin, origin));
+ }
+ }
+ return origin;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Edge basicGetOrigin() {
+ return origin;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOrigin(Edge newOrigin) {
+ Edge oldOrigin = origin;
+ origin = newOrigin;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.EDGE_MAPPING__ORIGIN, oldOrigin, origin));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Edge getImage() {
+ if (image != null && image.eIsProxy()) {
+ InternalEObject oldImage = (InternalEObject)image;
+ image = (Edge)eResolveProxy(oldImage);
+ if (image != oldImage) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.EDGE_MAPPING__IMAGE, oldImage, image));
+ }
+ }
+ return image;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Edge basicGetImage() {
+ return image;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setImage(Edge newImage) {
+ Edge oldImage = image;
+ image = newImage;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.EDGE_MAPPING__IMAGE, oldImage, image));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.EDGE_MAPPING__ORIGIN:
+ if (resolve) return getOrigin();
+ return basicGetOrigin();
+ case NestedconditionPackage.EDGE_MAPPING__IMAGE:
+ if (resolve) return getImage();
+ return basicGetImage();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.EDGE_MAPPING__ORIGIN:
+ setOrigin((Edge)newValue);
+ return;
+ case NestedconditionPackage.EDGE_MAPPING__IMAGE:
+ setImage((Edge)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.EDGE_MAPPING__ORIGIN:
+ setOrigin((Edge)null);
+ return;
+ case NestedconditionPackage.EDGE_MAPPING__IMAGE:
+ setImage((Edge)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.EDGE_MAPPING__ORIGIN:
+ return origin != null;
+ case NestedconditionPackage.EDGE_MAPPING__IMAGE:
+ return image != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //EdgeMappingImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/FormulaImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/FormulaImpl.java
new file mode 100644
index 0000000..eda808b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/FormulaImpl.java
@@ -0,0 +1,223 @@
+/**
+ */
+package nestedcondition.impl;
+
+import java.util.Collection;
+
+import laxcondition.Operator;
+
+import nestedcondition.Formula;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedconditionPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Formula</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.FormulaImpl#getOperator <em>Operator</em>}</li>
+ * <li>{@link nestedcondition.impl.FormulaImpl#getArguments <em>Arguments</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class FormulaImpl extends NestedConditionImpl implements Formula {
+ /**
+ * The default value of the '{@link #getOperator() <em>Operator</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOperator()
+ * @generated
+ * @ordered
+ */
+ protected static final Operator OPERATOR_EDEFAULT = Operator.NOT;
+
+ /**
+ * The cached value of the '{@link #getOperator() <em>Operator</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOperator()
+ * @generated
+ * @ordered
+ */
+ protected Operator operator = OPERATOR_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getArguments() <em>Arguments</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getArguments()
+ * @generated
+ * @ordered
+ */
+ protected EList<NestedCondition> arguments;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FormulaImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.FORMULA;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Operator getOperator() {
+ return operator;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOperator(Operator newOperator) {
+ Operator oldOperator = operator;
+ operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.FORMULA__OPERATOR, oldOperator, operator));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<NestedCondition> getArguments() {
+ if (arguments == null) {
+ arguments = new EObjectContainmentEList<NestedCondition>(NestedCondition.class, this, NestedconditionPackage.FORMULA__ARGUMENTS);
+ }
+ return arguments;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NestedconditionPackage.FORMULA__ARGUMENTS:
+ return ((InternalEList<?>)getArguments()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.FORMULA__OPERATOR:
+ return getOperator();
+ case NestedconditionPackage.FORMULA__ARGUMENTS:
+ return getArguments();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.FORMULA__OPERATOR:
+ setOperator((Operator)newValue);
+ return;
+ case NestedconditionPackage.FORMULA__ARGUMENTS:
+ getArguments().clear();
+ getArguments().addAll((Collection<? extends NestedCondition>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.FORMULA__OPERATOR:
+ setOperator(OPERATOR_EDEFAULT);
+ return;
+ case NestedconditionPackage.FORMULA__ARGUMENTS:
+ getArguments().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.FORMULA__OPERATOR:
+ return operator != OPERATOR_EDEFAULT;
+ case NestedconditionPackage.FORMULA__ARGUMENTS:
+ return arguments != null && !arguments.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (operator: ");
+ result.append(operator);
+ result.append(')');
+ return result.toString();
+ }
+
+} //FormulaImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/MorphismImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/MorphismImpl.java
new file mode 100644
index 0000000..bc4e02e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/MorphismImpl.java
@@ -0,0 +1,313 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.Graph;
+
+import java.util.Collection;
+
+import nestedcondition.EdgeMapping;
+import nestedcondition.Morphism;
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.NodeMapping;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Morphism</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.MorphismImpl#getNodeMappings <em>Node Mappings</em>}</li>
+ * <li>{@link nestedcondition.impl.MorphismImpl#getFrom <em>From</em>}</li>
+ * <li>{@link nestedcondition.impl.MorphismImpl#getTo <em>To</em>}</li>
+ * <li>{@link nestedcondition.impl.MorphismImpl#getEdgeMappings <em>Edge Mappings</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class MorphismImpl extends MinimalEObjectImpl.Container implements Morphism {
+ /**
+ * The cached value of the '{@link #getNodeMappings() <em>Node Mappings</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getNodeMappings()
+ * @generated
+ * @ordered
+ */
+ protected EList<NodeMapping> nodeMappings;
+
+ /**
+ * The cached value of the '{@link #getFrom() <em>From</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFrom()
+ * @generated
+ * @ordered
+ */
+ protected Graph from;
+
+ /**
+ * The cached value of the '{@link #getTo() <em>To</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTo()
+ * @generated
+ * @ordered
+ */
+ protected Graph to;
+
+ /**
+ * The cached value of the '{@link #getEdgeMappings() <em>Edge Mappings</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEdgeMappings()
+ * @generated
+ * @ordered
+ */
+ protected EList<EdgeMapping> edgeMappings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MorphismImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.MORPHISM;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<NodeMapping> getNodeMappings() {
+ if (nodeMappings == null) {
+ nodeMappings = new EObjectContainmentEList<NodeMapping>(NodeMapping.class, this, NestedconditionPackage.MORPHISM__NODE_MAPPINGS);
+ }
+ return nodeMappings;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getFrom() {
+ if (from != null && from.eIsProxy()) {
+ InternalEObject oldFrom = (InternalEObject)from;
+ from = (Graph)eResolveProxy(oldFrom);
+ if (from != oldFrom) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.MORPHISM__FROM, oldFrom, from));
+ }
+ }
+ return from;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph basicGetFrom() {
+ return from;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFrom(Graph newFrom) {
+ Graph oldFrom = from;
+ from = newFrom;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.MORPHISM__FROM, oldFrom, from));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getTo() {
+ if (to != null && to.eIsProxy()) {
+ InternalEObject oldTo = (InternalEObject)to;
+ to = (Graph)eResolveProxy(oldTo);
+ if (to != oldTo) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.MORPHISM__TO, oldTo, to));
+ }
+ }
+ return to;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph basicGetTo() {
+ return to;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTo(Graph newTo) {
+ Graph oldTo = to;
+ to = newTo;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.MORPHISM__TO, oldTo, to));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EdgeMapping> getEdgeMappings() {
+ if (edgeMappings == null) {
+ edgeMappings = new EObjectContainmentEList<EdgeMapping>(EdgeMapping.class, this, NestedconditionPackage.MORPHISM__EDGE_MAPPINGS);
+ }
+ return edgeMappings;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NestedconditionPackage.MORPHISM__NODE_MAPPINGS:
+ return ((InternalEList<?>)getNodeMappings()).basicRemove(otherEnd, msgs);
+ case NestedconditionPackage.MORPHISM__EDGE_MAPPINGS:
+ return ((InternalEList<?>)getEdgeMappings()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.MORPHISM__NODE_MAPPINGS:
+ return getNodeMappings();
+ case NestedconditionPackage.MORPHISM__FROM:
+ if (resolve) return getFrom();
+ return basicGetFrom();
+ case NestedconditionPackage.MORPHISM__TO:
+ if (resolve) return getTo();
+ return basicGetTo();
+ case NestedconditionPackage.MORPHISM__EDGE_MAPPINGS:
+ return getEdgeMappings();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.MORPHISM__NODE_MAPPINGS:
+ getNodeMappings().clear();
+ getNodeMappings().addAll((Collection<? extends NodeMapping>)newValue);
+ return;
+ case NestedconditionPackage.MORPHISM__FROM:
+ setFrom((Graph)newValue);
+ return;
+ case NestedconditionPackage.MORPHISM__TO:
+ setTo((Graph)newValue);
+ return;
+ case NestedconditionPackage.MORPHISM__EDGE_MAPPINGS:
+ getEdgeMappings().clear();
+ getEdgeMappings().addAll((Collection<? extends EdgeMapping>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.MORPHISM__NODE_MAPPINGS:
+ getNodeMappings().clear();
+ return;
+ case NestedconditionPackage.MORPHISM__FROM:
+ setFrom((Graph)null);
+ return;
+ case NestedconditionPackage.MORPHISM__TO:
+ setTo((Graph)null);
+ return;
+ case NestedconditionPackage.MORPHISM__EDGE_MAPPINGS:
+ getEdgeMappings().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.MORPHISM__NODE_MAPPINGS:
+ return nodeMappings != null && !nodeMappings.isEmpty();
+ case NestedconditionPackage.MORPHISM__FROM:
+ return from != null;
+ case NestedconditionPackage.MORPHISM__TO:
+ return to != null;
+ case NestedconditionPackage.MORPHISM__EDGE_MAPPINGS:
+ return edgeMappings != null && !edgeMappings.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //MorphismImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedConditionImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedConditionImpl.java
new file mode 100644
index 0000000..a32859c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedConditionImpl.java
@@ -0,0 +1,216 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.Graph;
+
+import java.util.Collection;
+
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.Variable;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Nested Condition</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.NestedConditionImpl#getVariables <em>Variables</em>}</li>
+ * <li>{@link nestedcondition.impl.NestedConditionImpl#getDomain <em>Domain</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public abstract class NestedConditionImpl extends MinimalEObjectImpl.Container implements NestedCondition {
+ /**
+ * The cached value of the '{@link #getVariables() <em>Variables</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVariables()
+ * @generated
+ * @ordered
+ */
+ protected EList<Variable> variables;
+
+ /**
+ * The cached value of the '{@link #getDomain() <em>Domain</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDomain()
+ * @generated
+ * @ordered
+ */
+ protected Graph domain;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedConditionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.NESTED_CONDITION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Variable> getVariables() {
+ if (variables == null) {
+ variables = new EObjectContainmentEList<Variable>(Variable.class, this, NestedconditionPackage.NESTED_CONDITION__VARIABLES);
+ }
+ return variables;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getDomain() {
+ if (domain != null && domain.eIsProxy()) {
+ InternalEObject oldDomain = (InternalEObject)domain;
+ domain = (Graph)eResolveProxy(oldDomain);
+ if (domain != oldDomain) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.NESTED_CONDITION__DOMAIN, oldDomain, domain));
+ }
+ }
+ return domain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph basicGetDomain() {
+ return domain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDomain(Graph newDomain) {
+ Graph oldDomain = domain;
+ domain = newDomain;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONDITION__DOMAIN, oldDomain, domain));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONDITION__VARIABLES:
+ return ((InternalEList<?>)getVariables()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONDITION__VARIABLES:
+ return getVariables();
+ case NestedconditionPackage.NESTED_CONDITION__DOMAIN:
+ if (resolve) return getDomain();
+ return basicGetDomain();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONDITION__VARIABLES:
+ getVariables().clear();
+ getVariables().addAll((Collection<? extends Variable>)newValue);
+ return;
+ case NestedconditionPackage.NESTED_CONDITION__DOMAIN:
+ setDomain((Graph)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONDITION__VARIABLES:
+ getVariables().clear();
+ return;
+ case NestedconditionPackage.NESTED_CONDITION__DOMAIN:
+ setDomain((Graph)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONDITION__VARIABLES:
+ return variables != null && !variables.isEmpty();
+ case NestedconditionPackage.NESTED_CONDITION__DOMAIN:
+ return domain != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //NestedConditionImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedConstraintImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedConstraintImpl.java
new file mode 100644
index 0000000..8a98e2b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedConstraintImpl.java
@@ -0,0 +1,373 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.Graph;
+
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Nested Constraint</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.NestedConstraintImpl#getName <em>Name</em>}</li>
+ * <li>{@link nestedcondition.impl.NestedConstraintImpl#getTypeGraph <em>Type Graph</em>}</li>
+ * <li>{@link nestedcondition.impl.NestedConstraintImpl#getCondition <em>Condition</em>}</li>
+ * <li>{@link nestedcondition.impl.NestedConstraintImpl#getDomain <em>Domain</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class NestedConstraintImpl extends MinimalEObjectImpl.Container implements NestedConstraint {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getTypeGraph() <em>Type Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeGraph()
+ * @generated
+ * @ordered
+ */
+ protected EPackage typeGraph;
+
+ /**
+ * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCondition()
+ * @generated
+ * @ordered
+ */
+ protected NestedCondition condition;
+
+ /**
+ * The cached value of the '{@link #getDomain() <em>Domain</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDomain()
+ * @generated
+ * @ordered
+ */
+ protected Graph domain;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedConstraintImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.NESTED_CONSTRAINT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONSTRAINT__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage getTypeGraph() {
+ if (typeGraph != null && typeGraph.eIsProxy()) {
+ InternalEObject oldTypeGraph = (InternalEObject)typeGraph;
+ typeGraph = (EPackage)eResolveProxy(oldTypeGraph);
+ if (typeGraph != oldTypeGraph) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.NESTED_CONSTRAINT__TYPE_GRAPH, oldTypeGraph, typeGraph));
+ }
+ }
+ return typeGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EPackage basicGetTypeGraph() {
+ return typeGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTypeGraph(EPackage newTypeGraph) {
+ EPackage oldTypeGraph = typeGraph;
+ typeGraph = newTypeGraph;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONSTRAINT__TYPE_GRAPH, oldTypeGraph, typeGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedCondition getCondition() {
+ return condition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetCondition(NestedCondition newCondition, NotificationChain msgs) {
+ NestedCondition oldCondition = condition;
+ condition = newCondition;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONSTRAINT__CONDITION, oldCondition, newCondition);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCondition(NestedCondition newCondition) {
+ if (newCondition != condition) {
+ NotificationChain msgs = null;
+ if (condition != null)
+ msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.NESTED_CONSTRAINT__CONDITION, null, msgs);
+ if (newCondition != null)
+ msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.NESTED_CONSTRAINT__CONDITION, null, msgs);
+ msgs = basicSetCondition(newCondition, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONSTRAINT__CONDITION, newCondition, newCondition));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getDomain() {
+ return domain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetDomain(Graph newDomain, NotificationChain msgs) {
+ Graph oldDomain = domain;
+ domain = newDomain;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN, oldDomain, newDomain);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDomain(Graph newDomain) {
+ if (newDomain != domain) {
+ NotificationChain msgs = null;
+ if (domain != null)
+ msgs = ((InternalEObject)domain).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN, null, msgs);
+ if (newDomain != null)
+ msgs = ((InternalEObject)newDomain).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN, null, msgs);
+ msgs = basicSetDomain(newDomain, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN, newDomain, newDomain));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT__CONDITION:
+ return basicSetCondition(null, msgs);
+ case NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN:
+ return basicSetDomain(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT__NAME:
+ return getName();
+ case NestedconditionPackage.NESTED_CONSTRAINT__TYPE_GRAPH:
+ if (resolve) return getTypeGraph();
+ return basicGetTypeGraph();
+ case NestedconditionPackage.NESTED_CONSTRAINT__CONDITION:
+ return getCondition();
+ case NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN:
+ return getDomain();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT__NAME:
+ setName((String)newValue);
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__TYPE_GRAPH:
+ setTypeGraph((EPackage)newValue);
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__CONDITION:
+ setCondition((NestedCondition)newValue);
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN:
+ setDomain((Graph)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__TYPE_GRAPH:
+ setTypeGraph((EPackage)null);
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__CONDITION:
+ setCondition((NestedCondition)null);
+ return;
+ case NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN:
+ setDomain((Graph)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case NestedconditionPackage.NESTED_CONSTRAINT__TYPE_GRAPH:
+ return typeGraph != null;
+ case NestedconditionPackage.NESTED_CONSTRAINT__CONDITION:
+ return condition != null;
+ case NestedconditionPackage.NESTED_CONSTRAINT__DOMAIN:
+ return domain != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //NestedConstraintImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedconditionFactoryImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedconditionFactoryImpl.java
new file mode 100644
index 0000000..40e90bf
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedconditionFactoryImpl.java
@@ -0,0 +1,172 @@
+/**
+ */
+package nestedcondition.impl;
+
+import nestedcondition.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconditionFactoryImpl extends EFactoryImpl implements NestedconditionFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static NestedconditionFactory init() {
+ try {
+ NestedconditionFactory theNestedconditionFactory = (NestedconditionFactory)EPackage.Registry.INSTANCE.getEFactory(NestedconditionPackage.eNS_URI);
+ if (theNestedconditionFactory != null) {
+ return theNestedconditionFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new NestedconditionFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case NestedconditionPackage.NESTED_CONSTRAINT: return createNestedConstraint();
+ case NestedconditionPackage.VARIABLE: return createVariable();
+ case NestedconditionPackage.QUANTIFIED_CONDITION: return createQuantifiedCondition();
+ case NestedconditionPackage.TRUE: return createTrue();
+ case NestedconditionPackage.FORMULA: return createFormula();
+ case NestedconditionPackage.MORPHISM: return createMorphism();
+ case NestedconditionPackage.NODE_MAPPING: return createNodeMapping();
+ case NestedconditionPackage.EDGE_MAPPING: return createEdgeMapping();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedConstraint createNestedConstraint() {
+ NestedConstraintImpl nestedConstraint = new NestedConstraintImpl();
+ return nestedConstraint;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Variable createVariable() {
+ VariableImpl variable = new VariableImpl();
+ return variable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuantifiedCondition createQuantifiedCondition() {
+ QuantifiedConditionImpl quantifiedCondition = new QuantifiedConditionImpl();
+ return quantifiedCondition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public True createTrue() {
+ TrueImpl true_ = new TrueImpl();
+ return true_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Formula createFormula() {
+ FormulaImpl formula = new FormulaImpl();
+ return formula;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Morphism createMorphism() {
+ MorphismImpl morphism = new MorphismImpl();
+ return morphism;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NodeMapping createNodeMapping() {
+ NodeMappingImpl nodeMapping = new NodeMappingImpl();
+ return nodeMapping;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EdgeMapping createEdgeMapping() {
+ EdgeMappingImpl edgeMapping = new EdgeMappingImpl();
+ return edgeMapping;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionPackage getNestedconditionPackage() {
+ return (NestedconditionPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static NestedconditionPackage getPackage() {
+ return NestedconditionPackage.eINSTANCE;
+ }
+
+} //NestedconditionFactoryImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedconditionPackageImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedconditionPackageImpl.java
new file mode 100644
index 0000000..8b3e4bc
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NestedconditionPackageImpl.java
@@ -0,0 +1,719 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.GraphPackage;
+
+import graph.impl.GraphPackageImpl;
+
+import laxcondition.LaxconditionPackage;
+
+import laxcondition.impl.LaxconditionPackageImpl;
+
+import nestedcondition.EdgeMapping;
+import nestedcondition.Formula;
+import nestedcondition.Morphism;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.NodeMapping;
+import nestedcondition.QuantifiedCondition;
+import nestedcondition.True;
+import nestedcondition.Variable;
+
+import nestedcondition.util.NestedconditionValidator;
+
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+import nestedconstraintmodel.impl.NestedconstraintmodelPackageImpl;
+
+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.EValidator;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconditionPackageImpl extends EPackageImpl implements NestedconditionPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nestedConstraintEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nestedConditionEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass variableEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass quantifiedConditionEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass trueEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass formulaEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass morphismEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nodeMappingEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass edgeMappingEClass = 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 nestedcondition.NestedconditionPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private NestedconditionPackageImpl() {
+ super(eNS_URI, NestedconditionFactory.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 NestedconditionPackage#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 NestedconditionPackage init() {
+ if (isInited) return (NestedconditionPackage)EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI);
+
+ // Obtain or create and register package
+ NestedconditionPackageImpl theNestedconditionPackage = (NestedconditionPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof NestedconditionPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new NestedconditionPackageImpl());
+
+ isInited = true;
+
+ // Obtain or create and register interdependencies
+ NestedconstraintmodelPackageImpl theNestedconstraintmodelPackage = (NestedconstraintmodelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI) instanceof NestedconstraintmodelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI) : NestedconstraintmodelPackage.eINSTANCE);
+ GraphPackageImpl theGraphPackage = (GraphPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI) instanceof GraphPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI) : GraphPackage.eINSTANCE);
+ LaxconditionPackageImpl theLaxconditionPackage = (LaxconditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI) instanceof LaxconditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI) : LaxconditionPackage.eINSTANCE);
+
+ // Create package meta-data objects
+ theNestedconditionPackage.createPackageContents();
+ theNestedconstraintmodelPackage.createPackageContents();
+ theGraphPackage.createPackageContents();
+ theLaxconditionPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theNestedconditionPackage.initializePackageContents();
+ theNestedconstraintmodelPackage.initializePackageContents();
+ theGraphPackage.initializePackageContents();
+ theLaxconditionPackage.initializePackageContents();
+
+ // Register package validator
+ EValidator.Registry.INSTANCE.put
+ (theNestedconditionPackage,
+ new EValidator.Descriptor() {
+ public EValidator getEValidator() {
+ return NestedconditionValidator.INSTANCE;
+ }
+ });
+
+ // Mark meta-data to indicate it can't be changed
+ theNestedconditionPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(NestedconditionPackage.eNS_URI, theNestedconditionPackage);
+ return theNestedconditionPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNestedConstraint() {
+ return nestedConstraintEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNestedConstraint_Name() {
+ return (EAttribute)nestedConstraintEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNestedConstraint_TypeGraph() {
+ return (EReference)nestedConstraintEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNestedConstraint_Condition() {
+ return (EReference)nestedConstraintEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNestedConstraint_Domain() {
+ return (EReference)nestedConstraintEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNestedCondition() {
+ return nestedConditionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNestedCondition_Variables() {
+ return (EReference)nestedConditionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNestedCondition_Domain() {
+ return (EReference)nestedConditionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getVariable() {
+ return variableEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getVariable_Name() {
+ return (EAttribute)variableEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getQuantifiedCondition() {
+ return quantifiedConditionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getQuantifiedCondition_Quantifier() {
+ return (EAttribute)quantifiedConditionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuantifiedCondition_Condition() {
+ return (EReference)quantifiedConditionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuantifiedCondition_Morphism() {
+ return (EReference)quantifiedConditionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuantifiedCondition_Codomain() {
+ return (EReference)quantifiedConditionEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getTrue() {
+ return trueEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getFormula() {
+ return formulaEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getFormula_Operator() {
+ return (EAttribute)formulaEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getFormula_Arguments() {
+ return (EReference)formulaEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getMorphism() {
+ return morphismEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_NodeMappings() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_From() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_To() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getMorphism_EdgeMappings() {
+ return (EReference)morphismEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNodeMapping() {
+ return nodeMappingEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNodeMapping_Origin() {
+ return (EReference)nodeMappingEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNodeMapping_Image() {
+ return (EReference)nodeMappingEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getEdgeMapping() {
+ return edgeMappingEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getEdgeMapping_Origin() {
+ return (EReference)edgeMappingEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getEdgeMapping_Image() {
+ return (EReference)edgeMappingEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionFactory getNestedconditionFactory() {
+ return (NestedconditionFactory)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
+ nestedConstraintEClass = createEClass(NESTED_CONSTRAINT);
+ createEAttribute(nestedConstraintEClass, NESTED_CONSTRAINT__NAME);
+ createEReference(nestedConstraintEClass, NESTED_CONSTRAINT__TYPE_GRAPH);
+ createEReference(nestedConstraintEClass, NESTED_CONSTRAINT__CONDITION);
+ createEReference(nestedConstraintEClass, NESTED_CONSTRAINT__DOMAIN);
+
+ nestedConditionEClass = createEClass(NESTED_CONDITION);
+ createEReference(nestedConditionEClass, NESTED_CONDITION__VARIABLES);
+ createEReference(nestedConditionEClass, NESTED_CONDITION__DOMAIN);
+
+ variableEClass = createEClass(VARIABLE);
+ createEAttribute(variableEClass, VARIABLE__NAME);
+
+ quantifiedConditionEClass = createEClass(QUANTIFIED_CONDITION);
+ createEAttribute(quantifiedConditionEClass, QUANTIFIED_CONDITION__QUANTIFIER);
+ createEReference(quantifiedConditionEClass, QUANTIFIED_CONDITION__CONDITION);
+ createEReference(quantifiedConditionEClass, QUANTIFIED_CONDITION__MORPHISM);
+ createEReference(quantifiedConditionEClass, QUANTIFIED_CONDITION__CODOMAIN);
+
+ trueEClass = createEClass(TRUE);
+
+ formulaEClass = createEClass(FORMULA);
+ createEAttribute(formulaEClass, FORMULA__OPERATOR);
+ createEReference(formulaEClass, FORMULA__ARGUMENTS);
+
+ morphismEClass = createEClass(MORPHISM);
+ createEReference(morphismEClass, MORPHISM__NODE_MAPPINGS);
+ createEReference(morphismEClass, MORPHISM__FROM);
+ createEReference(morphismEClass, MORPHISM__TO);
+ createEReference(morphismEClass, MORPHISM__EDGE_MAPPINGS);
+
+ nodeMappingEClass = createEClass(NODE_MAPPING);
+ createEReference(nodeMappingEClass, NODE_MAPPING__ORIGIN);
+ createEReference(nodeMappingEClass, NODE_MAPPING__IMAGE);
+
+ edgeMappingEClass = createEClass(EDGE_MAPPING);
+ createEReference(edgeMappingEClass, EDGE_MAPPING__ORIGIN);
+ createEReference(edgeMappingEClass, EDGE_MAPPING__IMAGE);
+ }
+
+ /**
+ * <!-- 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
+ GraphPackage theGraphPackage = (GraphPackage)EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI);
+ LaxconditionPackage theLaxconditionPackage = (LaxconditionPackage)EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ quantifiedConditionEClass.getESuperTypes().add(this.getNestedCondition());
+ trueEClass.getESuperTypes().add(this.getNestedCondition());
+ formulaEClass.getESuperTypes().add(this.getNestedCondition());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(nestedConstraintEClass, NestedConstraint.class, "NestedConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getNestedConstraint_Name(), ecorePackage.getEString(), "name", null, 0, 1, NestedConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNestedConstraint_TypeGraph(), ecorePackage.getEPackage(), null, "typeGraph", null, 1, 1, NestedConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNestedConstraint_Condition(), this.getNestedCondition(), null, "condition", null, 1, 1, NestedConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNestedConstraint_Domain(), theGraphPackage.getGraph(), null, "domain", null, 1, 1, NestedConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(nestedConditionEClass, NestedCondition.class, "NestedCondition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getNestedCondition_Variables(), this.getVariable(), null, "variables", null, 0, -1, NestedCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNestedCondition_Domain(), theGraphPackage.getGraph(), null, "domain", null, 1, 1, NestedCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(variableEClass, Variable.class, "Variable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getVariable_Name(), ecorePackage.getEString(), "name", null, 0, 1, Variable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(quantifiedConditionEClass, QuantifiedCondition.class, "QuantifiedCondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getQuantifiedCondition_Quantifier(), theLaxconditionPackage.getQuantifier(), "quantifier", null, 0, 1, QuantifiedCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getQuantifiedCondition_Condition(), this.getNestedCondition(), null, "condition", null, 1, 1, QuantifiedCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getQuantifiedCondition_Morphism(), this.getMorphism(), null, "morphism", null, 1, 1, QuantifiedCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getQuantifiedCondition_Codomain(), theGraphPackage.getGraph(), null, "codomain", null, 1, 1, QuantifiedCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(trueEClass, True.class, "True", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(formulaEClass, Formula.class, "Formula", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getFormula_Operator(), theLaxconditionPackage.getOperator(), "operator", null, 0, 1, Formula.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getFormula_Arguments(), this.getNestedCondition(), null, "arguments", null, 1, -1, Formula.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(morphismEClass, Morphism.class, "Morphism", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getMorphism_NodeMappings(), this.getNodeMapping(), null, "nodeMappings", null, 0, -1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMorphism_From(), theGraphPackage.getGraph(), null, "from", null, 1, 1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMorphism_To(), theGraphPackage.getGraph(), null, "to", null, 1, 1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMorphism_EdgeMappings(), this.getEdgeMapping(), null, "edgeMappings", null, 0, -1, Morphism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(nodeMappingEClass, NodeMapping.class, "NodeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getNodeMapping_Origin(), theGraphPackage.getNode(), null, "origin", null, 1, 1, NodeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNodeMapping_Image(), theGraphPackage.getNode(), null, "image", null, 1, 1, NodeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(edgeMappingEClass, EdgeMapping.class, "EdgeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getEdgeMapping_Origin(), theGraphPackage.getEdge(), null, "origin", null, 1, 1, EdgeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getEdgeMapping_Image(), theGraphPackage.getEdge(), null, "image", null, 1, 1, EdgeMapping.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
+ // http://www.eclipse.org/OCL/Import
+ createImportAnnotations();
+ // http://www.eclipse.org/emf/2002/Ecore
+ createEcoreAnnotations();
+ // http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
+ createPivotAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createImportAnnotations() {
+ String source = "http://www.eclipse.org/OCL/Import";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "ecore", "http://www.eclipse.org/emf/2002/Ecore#/",
+ "graph", "graph.ecore#/",
+ "laxcondition", "laxcondition.ecore#/"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createEcoreAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"
+ });
+ addAnnotation
+ (nestedConstraintEClass,
+ source,
+ new String[] {
+ "constraints", "ConstraintDomainIsEmpty RootConditionDomainIsConatraintDomain TypeGraphConsistency HostGraphConsistency"
+ });
+ addAnnotation
+ (quantifiedConditionEClass,
+ source,
+ new String[] {
+ "constraints", "NestedDomainIsCoDomain MorphismIsFromDomainToCoDomain"
+ });
+ addAnnotation
+ (formulaEClass,
+ source,
+ new String[] {
+ "constraints", "ArgumentsDomainConsistency OneArgumentForNOT AtLeastTwoArgumentForANDOR TwoArgumentForIMPLEQUALXOR"
+ });
+ addAnnotation
+ (morphismEClass,
+ source,
+ new String[] {
+ "constraints", "NodeMappingIsFromDomainToCoDomain EdgeMappingIsFromDomainToCoDomain EdgeMappingConsistency"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createPivotAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
+ addAnnotation
+ (nestedConstraintEClass,
+ source,
+ new String[] {
+ "ConstraintDomainIsEmpty", "self.domain.nodes -> isEmpty() and self.domain.edges -> isEmpty()",
+ "RootConditionDomainIsConatraintDomain", "self.condition.domain = self.domain",
+ "TypeGraphConsistency", "graph::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)",
+ "HostGraphConsistency", "graph::Graph.allInstances() -> forAll(g|g.edges -> forAll(e|g.nodes -> includes(e.source) and g.nodes -> includes(e.target)))"
+ });
+ addAnnotation
+ (quantifiedConditionEClass,
+ source,
+ new String[] {
+ "NestedDomainIsCoDomain", "self.condition.domain = self.codomain",
+ "MorphismIsFromDomainToCoDomain", "self.morphism.from = self.domain and self.morphism.to = self.codomain"
+ });
+ addAnnotation
+ (formulaEClass,
+ source,
+ new String[] {
+ "ArgumentsDomainConsistency", "self.arguments -> forAll(cond|cond.domain = self.domain)",
+ "OneArgumentForNOT", "(self.operator = laxcondition::Operator::NOT) implies (self.arguments -> size() = 1)",
+ "AtLeastTwoArgumentForANDOR", "((self.operator = laxcondition::Operator::AND) or (self.operator = laxcondition::Operator::OR)) implies (self.arguments -> size() > 1)",
+ "TwoArgumentForIMPLEQUALXOR", "((self.operator = laxcondition::Operator::IMPLIES) or (self.operator = laxcondition::Operator::EQUIVALENT) or (self.operator = laxcondition::Operator::XOR)) implies (self.arguments -> size() = 2)"
+ });
+ addAnnotation
+ (morphismEClass,
+ source,
+ new String[] {
+ "NodeMappingIsFromDomainToCoDomain", "self.nodeMappings -> forAll(m|self.from.nodes -> includes(m.origin) and self.to.nodes -> includes(m.image))",
+ "EdgeMappingIsFromDomainToCoDomain", "self.edgeMappings -> forAll(m|self.from.edges -> includes(m.origin) and self.to.edges -> includes(m.image))",
+ "EdgeMappingConsistency", "self.edgeMappings -> forAll(em|self.nodeMappings -> exists(nm|nm.origin = em.origin.source and nm.image = em.image.source) and self.nodeMappings -> exists(nm|nm.origin = em.origin.target and nm.image = em.image.target))"
+ });
+ }
+
+} //NestedconditionPackageImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NodeMappingImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NodeMappingImpl.java
new file mode 100644
index 0000000..3905741
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/NodeMappingImpl.java
@@ -0,0 +1,218 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.Node;
+
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.NodeMapping;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Node Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.NodeMappingImpl#getOrigin <em>Origin</em>}</li>
+ * <li>{@link nestedcondition.impl.NodeMappingImpl#getImage <em>Image</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class NodeMappingImpl extends MinimalEObjectImpl.Container implements NodeMapping {
+ /**
+ * The cached value of the '{@link #getOrigin() <em>Origin</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOrigin()
+ * @generated
+ * @ordered
+ */
+ protected Node origin;
+
+ /**
+ * The cached value of the '{@link #getImage() <em>Image</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImage()
+ * @generated
+ * @ordered
+ */
+ protected Node image;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NodeMappingImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.NODE_MAPPING;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getOrigin() {
+ if (origin != null && origin.eIsProxy()) {
+ InternalEObject oldOrigin = (InternalEObject)origin;
+ origin = (Node)eResolveProxy(oldOrigin);
+ if (origin != oldOrigin) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.NODE_MAPPING__ORIGIN, oldOrigin, origin));
+ }
+ }
+ return origin;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetOrigin() {
+ return origin;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOrigin(Node newOrigin) {
+ Node oldOrigin = origin;
+ origin = newOrigin;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NODE_MAPPING__ORIGIN, oldOrigin, origin));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getImage() {
+ if (image != null && image.eIsProxy()) {
+ InternalEObject oldImage = (InternalEObject)image;
+ image = (Node)eResolveProxy(oldImage);
+ if (image != oldImage) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.NODE_MAPPING__IMAGE, oldImage, image));
+ }
+ }
+ return image;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetImage() {
+ return image;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setImage(Node newImage) {
+ Node oldImage = image;
+ image = newImage;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NODE_MAPPING__IMAGE, oldImage, image));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.NODE_MAPPING__ORIGIN:
+ if (resolve) return getOrigin();
+ return basicGetOrigin();
+ case NestedconditionPackage.NODE_MAPPING__IMAGE:
+ if (resolve) return getImage();
+ return basicGetImage();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.NODE_MAPPING__ORIGIN:
+ setOrigin((Node)newValue);
+ return;
+ case NestedconditionPackage.NODE_MAPPING__IMAGE:
+ setImage((Node)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.NODE_MAPPING__ORIGIN:
+ setOrigin((Node)null);
+ return;
+ case NestedconditionPackage.NODE_MAPPING__IMAGE:
+ setImage((Node)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.NODE_MAPPING__ORIGIN:
+ return origin != null;
+ case NestedconditionPackage.NODE_MAPPING__IMAGE:
+ return image != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //NodeMappingImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/QuantifiedConditionImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/QuantifiedConditionImpl.java
new file mode 100644
index 0000000..7741dce
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/QuantifiedConditionImpl.java
@@ -0,0 +1,380 @@
+/**
+ */
+package nestedcondition.impl;
+
+import graph.Graph;
+
+import laxcondition.Quantifier;
+
+import nestedcondition.Morphism;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.QuantifiedCondition;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quantified Condition</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getQuantifier <em>Quantifier</em>}</li>
+ * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getCondition <em>Condition</em>}</li>
+ * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getMorphism <em>Morphism</em>}</li>
+ * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getCodomain <em>Codomain</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class QuantifiedConditionImpl extends NestedConditionImpl implements QuantifiedCondition {
+ /**
+ * The default value of the '{@link #getQuantifier() <em>Quantifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuantifier()
+ * @generated
+ * @ordered
+ */
+ protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS;
+
+ /**
+ * The cached value of the '{@link #getQuantifier() <em>Quantifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuantifier()
+ * @generated
+ * @ordered
+ */
+ protected Quantifier quantifier = QUANTIFIER_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCondition()
+ * @generated
+ * @ordered
+ */
+ protected NestedCondition condition;
+
+ /**
+ * The cached value of the '{@link #getMorphism() <em>Morphism</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMorphism()
+ * @generated
+ * @ordered
+ */
+ protected Morphism morphism;
+
+ /**
+ * The cached value of the '{@link #getCodomain() <em>Codomain</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCodomain()
+ * @generated
+ * @ordered
+ */
+ protected Graph codomain;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected QuantifiedConditionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.QUANTIFIED_CONDITION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quantifier getQuantifier() {
+ return quantifier;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setQuantifier(Quantifier newQuantifier) {
+ Quantifier oldQuantifier = quantifier;
+ quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER, oldQuantifier, quantifier));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedCondition getCondition() {
+ return condition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetCondition(NestedCondition newCondition, NotificationChain msgs) {
+ NestedCondition oldCondition = condition;
+ condition = newCondition;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, oldCondition, newCondition);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCondition(NestedCondition newCondition) {
+ if (newCondition != condition) {
+ NotificationChain msgs = null;
+ if (condition != null)
+ msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, null, msgs);
+ if (newCondition != null)
+ msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, null, msgs);
+ msgs = basicSetCondition(newCondition, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, newCondition, newCondition));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Morphism getMorphism() {
+ return morphism;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetMorphism(Morphism newMorphism, NotificationChain msgs) {
+ Morphism oldMorphism = morphism;
+ morphism = newMorphism;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, oldMorphism, newMorphism);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMorphism(Morphism newMorphism) {
+ if (newMorphism != morphism) {
+ NotificationChain msgs = null;
+ if (morphism != null)
+ msgs = ((InternalEObject)morphism).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, null, msgs);
+ if (newMorphism != null)
+ msgs = ((InternalEObject)newMorphism).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, null, msgs);
+ msgs = basicSetMorphism(newMorphism, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, newMorphism, newMorphism));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getCodomain() {
+ return codomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetCodomain(Graph newCodomain, NotificationChain msgs) {
+ Graph oldCodomain = codomain;
+ codomain = newCodomain;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, oldCodomain, newCodomain);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCodomain(Graph newCodomain) {
+ if (newCodomain != codomain) {
+ NotificationChain msgs = null;
+ if (codomain != null)
+ msgs = ((InternalEObject)codomain).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, null, msgs);
+ if (newCodomain != null)
+ msgs = ((InternalEObject)newCodomain).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, null, msgs);
+ msgs = basicSetCodomain(newCodomain, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, newCodomain, newCodomain));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION:
+ return basicSetCondition(null, msgs);
+ case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM:
+ return basicSetMorphism(null, msgs);
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN:
+ return basicSetCodomain(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER:
+ return getQuantifier();
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION:
+ return getCondition();
+ case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM:
+ return getMorphism();
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN:
+ return getCodomain();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER:
+ setQuantifier((Quantifier)newValue);
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION:
+ setCondition((NestedCondition)newValue);
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM:
+ setMorphism((Morphism)newValue);
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN:
+ setCodomain((Graph)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER:
+ setQuantifier(QUANTIFIER_EDEFAULT);
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION:
+ setCondition((NestedCondition)null);
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM:
+ setMorphism((Morphism)null);
+ return;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN:
+ setCodomain((Graph)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER:
+ return quantifier != QUANTIFIER_EDEFAULT;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION:
+ return condition != null;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM:
+ return morphism != null;
+ case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN:
+ return codomain != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (quantifier: ");
+ result.append(quantifier);
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuantifiedConditionImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/TrueImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/TrueImpl.java
new file mode 100644
index 0000000..608464f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/TrueImpl.java
@@ -0,0 +1,37 @@
+/**
+ */
+package nestedcondition.impl;
+
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.True;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>True</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class TrueImpl extends NestedConditionImpl implements True {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TrueImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.TRUE;
+ }
+
+} //TrueImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/VariableImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/VariableImpl.java
new file mode 100644
index 0000000..b675b99
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/impl/VariableImpl.java
@@ -0,0 +1,163 @@
+/**
+ */
+package nestedcondition.impl;
+
+import nestedcondition.NestedconditionPackage;
+import nestedcondition.Variable;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Variable</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedcondition.impl.VariableImpl#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class VariableImpl extends MinimalEObjectImpl.Container implements Variable {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected VariableImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconditionPackage.Literals.VARIABLE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.VARIABLE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconditionPackage.VARIABLE__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconditionPackage.VARIABLE__NAME:
+ setName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.VARIABLE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconditionPackage.VARIABLE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //VariableImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionAdapterFactory.java
new file mode 100644
index 0000000..1e934ff
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionAdapterFactory.java
@@ -0,0 +1,264 @@
+/**
+ */
+package nestedcondition.util;
+
+import nestedcondition.*;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see nestedcondition.NestedconditionPackage
+ * @generated
+ */
+public class NestedconditionAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static NestedconditionPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = NestedconditionPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconditionSwitch<Adapter> modelSwitch =
+ new NestedconditionSwitch<Adapter>() {
+ @Override
+ public Adapter caseNestedConstraint(NestedConstraint object) {
+ return createNestedConstraintAdapter();
+ }
+ @Override
+ public Adapter caseNestedCondition(NestedCondition object) {
+ return createNestedConditionAdapter();
+ }
+ @Override
+ public Adapter caseVariable(Variable object) {
+ return createVariableAdapter();
+ }
+ @Override
+ public Adapter caseQuantifiedCondition(QuantifiedCondition object) {
+ return createQuantifiedConditionAdapter();
+ }
+ @Override
+ public Adapter caseTrue(True object) {
+ return createTrueAdapter();
+ }
+ @Override
+ public Adapter caseFormula(Formula object) {
+ return createFormulaAdapter();
+ }
+ @Override
+ public Adapter caseMorphism(Morphism object) {
+ return createMorphismAdapter();
+ }
+ @Override
+ public Adapter caseNodeMapping(NodeMapping object) {
+ return createNodeMappingAdapter();
+ }
+ @Override
+ public Adapter caseEdgeMapping(EdgeMapping object) {
+ return createEdgeMappingAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.NestedConstraint <em>Nested Constraint</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.NestedConstraint
+ * @generated
+ */
+ public Adapter createNestedConstraintAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.NestedCondition <em>Nested Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.NestedCondition
+ * @generated
+ */
+ public Adapter createNestedConditionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.Variable <em>Variable</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.Variable
+ * @generated
+ */
+ public Adapter createVariableAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.QuantifiedCondition <em>Quantified Condition</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.QuantifiedCondition
+ * @generated
+ */
+ public Adapter createQuantifiedConditionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.True <em>True</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.True
+ * @generated
+ */
+ public Adapter createTrueAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.Formula <em>Formula</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.Formula
+ * @generated
+ */
+ public Adapter createFormulaAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.Morphism <em>Morphism</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.Morphism
+ * @generated
+ */
+ public Adapter createMorphismAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.NodeMapping <em>Node Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.NodeMapping
+ * @generated
+ */
+ public Adapter createNodeMappingAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedcondition.EdgeMapping <em>Edge Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedcondition.EdgeMapping
+ * @generated
+ */
+ public Adapter createEdgeMappingAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //NestedconditionAdapterFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionSwitch.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionSwitch.java
new file mode 100644
index 0000000..1d593c3
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionSwitch.java
@@ -0,0 +1,281 @@
+/**
+ */
+package nestedcondition.util;
+
+import nestedcondition.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see nestedcondition.NestedconditionPackage
+ * @generated
+ */
+public class NestedconditionSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static NestedconditionPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionSwitch() {
+ if (modelPackage == null) {
+ modelPackage = NestedconditionPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT: {
+ NestedConstraint nestedConstraint = (NestedConstraint)theEObject;
+ T result = caseNestedConstraint(nestedConstraint);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.NESTED_CONDITION: {
+ NestedCondition nestedCondition = (NestedCondition)theEObject;
+ T result = caseNestedCondition(nestedCondition);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.VARIABLE: {
+ Variable variable = (Variable)theEObject;
+ T result = caseVariable(variable);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.QUANTIFIED_CONDITION: {
+ QuantifiedCondition quantifiedCondition = (QuantifiedCondition)theEObject;
+ T result = caseQuantifiedCondition(quantifiedCondition);
+ if (result == null) result = caseNestedCondition(quantifiedCondition);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.TRUE: {
+ True true_ = (True)theEObject;
+ T result = caseTrue(true_);
+ if (result == null) result = caseNestedCondition(true_);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.FORMULA: {
+ Formula formula = (Formula)theEObject;
+ T result = caseFormula(formula);
+ if (result == null) result = caseNestedCondition(formula);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.MORPHISM: {
+ Morphism morphism = (Morphism)theEObject;
+ T result = caseMorphism(morphism);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.NODE_MAPPING: {
+ NodeMapping nodeMapping = (NodeMapping)theEObject;
+ T result = caseNodeMapping(nodeMapping);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case NestedconditionPackage.EDGE_MAPPING: {
+ EdgeMapping edgeMapping = (EdgeMapping)theEObject;
+ T result = caseEdgeMapping(edgeMapping);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Nested Constraint</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNestedConstraint(NestedConstraint object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Nested Condition</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Nested Condition</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNestedCondition(NestedCondition object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Variable</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Variable</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseVariable(Variable object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Quantified Condition</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Quantified Condition</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseQuantifiedCondition(QuantifiedCondition object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>True</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>True</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTrue(True object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Formula</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseFormula(Formula object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Morphism</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMorphism(Morphism object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Node Mapping</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Node Mapping</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNodeMapping(NodeMapping object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Edge Mapping</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Edge Mapping</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEdgeMapping(EdgeMapping object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //NestedconditionSwitch
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionValidator.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionValidator.java
new file mode 100644
index 0000000..da448f9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/NestedconditionValidator.java
@@ -0,0 +1,633 @@
+/**
+ */
+package nestedcondition.util;
+
+import java.util.Map;
+
+import nestedcondition.*;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.EObjectValidator;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Validator</b> for the model.
+ * <!-- end-user-doc -->
+ * @see nestedcondition.NestedconditionPackage
+ * @generated
+ */
+public class NestedconditionValidator extends EObjectValidator {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final NestedconditionValidator INSTANCE = new NestedconditionValidator();
+
+ /**
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.common.util.Diagnostic#getSource()
+ * @see org.eclipse.emf.common.util.Diagnostic#getCode()
+ * @generated
+ */
+ public static final String DIAGNOSTIC_SOURCE = "nestedcondition";
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconditionValidator() {
+ super();
+ }
+
+ /**
+ * Returns the package of this validator switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EPackage getEPackage() {
+ return NestedconditionPackage.eINSTANCE;
+ }
+
+ /**
+ * Calls <code>validateXXX</code> for the corresponding classifier of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ switch (classifierID) {
+ case NestedconditionPackage.NESTED_CONSTRAINT:
+ return validateNestedConstraint((NestedConstraint)value, diagnostics, context);
+ case NestedconditionPackage.NESTED_CONDITION:
+ return validateNestedCondition((NestedCondition)value, diagnostics, context);
+ case NestedconditionPackage.VARIABLE:
+ return validateVariable((Variable)value, diagnostics, context);
+ case NestedconditionPackage.QUANTIFIED_CONDITION:
+ return validateQuantifiedCondition((QuantifiedCondition)value, diagnostics, context);
+ case NestedconditionPackage.TRUE:
+ return validateTrue((True)value, diagnostics, context);
+ case NestedconditionPackage.FORMULA:
+ return validateFormula((Formula)value, diagnostics, context);
+ case NestedconditionPackage.MORPHISM:
+ return validateMorphism((Morphism)value, diagnostics, context);
+ case NestedconditionPackage.NODE_MAPPING:
+ return validateNodeMapping((NodeMapping)value, diagnostics, context);
+ case NestedconditionPackage.EDGE_MAPPING:
+ return validateEdgeMapping((EdgeMapping)value, diagnostics, context);
+ default:
+ return true;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNestedConstraint(NestedConstraint nestedConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(nestedConstraint, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validateNestedConstraint_ConstraintDomainIsEmpty(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validateNestedConstraint_RootConditionDomainIsConatraintDomain(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validateNestedConstraint_TypeGraphConsistency(nestedConstraint, diagnostics, context);
+ if (result || diagnostics != null) result &= validateNestedConstraint_HostGraphConsistency(nestedConstraint, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the ConstraintDomainIsEmpty constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String NESTED_CONSTRAINT__CONSTRAINT_DOMAIN_IS_EMPTY__EEXPRESSION = "self.domain.nodes -> isEmpty() and self.domain.edges -> isEmpty()";
+
+ /**
+ * Validates the ConstraintDomainIsEmpty constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNestedConstraint_ConstraintDomainIsEmpty(NestedConstraint nestedConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT,
+ nestedConstraint,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "ConstraintDomainIsEmpty",
+ NESTED_CONSTRAINT__CONSTRAINT_DOMAIN_IS_EMPTY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the RootConditionDomainIsConatraintDomain constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String NESTED_CONSTRAINT__ROOT_CONDITION_DOMAIN_IS_CONATRAINT_DOMAIN__EEXPRESSION = "self.condition.domain = self.domain";
+
+ /**
+ * Validates the RootConditionDomainIsConatraintDomain constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNestedConstraint_RootConditionDomainIsConatraintDomain(NestedConstraint nestedConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT,
+ nestedConstraint,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "RootConditionDomainIsConatraintDomain",
+ NESTED_CONSTRAINT__ROOT_CONDITION_DOMAIN_IS_CONATRAINT_DOMAIN__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the TypeGraphConsistency constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String NESTED_CONSTRAINT__TYPE_GRAPH_CONSISTENCY__EEXPRESSION = "graph::Graph.allInstances() -> forAll(g|g.typegraph = self.typeGraph)";
+
+ /**
+ * Validates the TypeGraphConsistency constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNestedConstraint_TypeGraphConsistency(NestedConstraint nestedConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT,
+ nestedConstraint,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "TypeGraphConsistency",
+ NESTED_CONSTRAINT__TYPE_GRAPH_CONSISTENCY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the HostGraphConsistency constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String NESTED_CONSTRAINT__HOST_GRAPH_CONSISTENCY__EEXPRESSION = "graph::Graph.allInstances() -> forAll(g|g.edges -> forAll(e|g.nodes -> includes(e.source) and g.nodes -> includes(e.target)))";
+
+ /**
+ * Validates the HostGraphConsistency constraint of '<em>Nested Constraint</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNestedConstraint_HostGraphConsistency(NestedConstraint nestedConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.NESTED_CONSTRAINT,
+ nestedConstraint,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "HostGraphConsistency",
+ NESTED_CONSTRAINT__HOST_GRAPH_CONSISTENCY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNestedCondition(NestedCondition nestedCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(nestedCondition, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateVariable(Variable variable, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(variable, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateQuantifiedCondition(QuantifiedCondition quantifiedCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(quantifiedCondition, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validateQuantifiedCondition_NestedDomainIsCoDomain(quantifiedCondition, diagnostics, context);
+ if (result || diagnostics != null) result &= validateQuantifiedCondition_MorphismIsFromDomainToCoDomain(quantifiedCondition, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the NestedDomainIsCoDomain constraint of '<em>Quantified Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String QUANTIFIED_CONDITION__NESTED_DOMAIN_IS_CO_DOMAIN__EEXPRESSION = "self.condition.domain = self.codomain";
+
+ /**
+ * Validates the NestedDomainIsCoDomain constraint of '<em>Quantified Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateQuantifiedCondition_NestedDomainIsCoDomain(QuantifiedCondition quantifiedCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION,
+ quantifiedCondition,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "NestedDomainIsCoDomain",
+ QUANTIFIED_CONDITION__NESTED_DOMAIN_IS_CO_DOMAIN__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the MorphismIsFromDomainToCoDomain constraint of '<em>Quantified Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String QUANTIFIED_CONDITION__MORPHISM_IS_FROM_DOMAIN_TO_CO_DOMAIN__EEXPRESSION = "self.morphism.from = self.domain and self.morphism.to = self.codomain";
+
+ /**
+ * Validates the MorphismIsFromDomainToCoDomain constraint of '<em>Quantified Condition</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateQuantifiedCondition_MorphismIsFromDomainToCoDomain(QuantifiedCondition quantifiedCondition, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.QUANTIFIED_CONDITION,
+ quantifiedCondition,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "MorphismIsFromDomainToCoDomain",
+ QUANTIFIED_CONDITION__MORPHISM_IS_FROM_DOMAIN_TO_CO_DOMAIN__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateTrue(True true_, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(true_, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(formula, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_ArgumentsDomainConsistency(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_OneArgumentForNOT(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_AtLeastTwoArgumentForANDOR(formula, diagnostics, context);
+ if (result || diagnostics != null) result &= validateFormula_TwoArgumentForIMPLEQUALXOR(formula, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the ArgumentsDomainConsistency constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__ARGUMENTS_DOMAIN_CONSISTENCY__EEXPRESSION = "self.arguments -> forAll(cond|cond.domain = self.domain)";
+
+ /**
+ * Validates the ArgumentsDomainConsistency constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_ArgumentsDomainConsistency(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "ArgumentsDomainConsistency",
+ FORMULA__ARGUMENTS_DOMAIN_CONSISTENCY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the OneArgumentForNOT constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__ONE_ARGUMENT_FOR_NOT__EEXPRESSION = "(self.operator = laxcondition::Operator::NOT) implies (self.arguments -> size() = 1)";
+
+ /**
+ * Validates the OneArgumentForNOT constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_OneArgumentForNOT(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "OneArgumentForNOT",
+ FORMULA__ONE_ARGUMENT_FOR_NOT__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the AtLeastTwoArgumentForANDOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__AT_LEAST_TWO_ARGUMENT_FOR_ANDOR__EEXPRESSION = "((self.operator = laxcondition::Operator::AND) or (self.operator = laxcondition::Operator::OR)) implies (self.arguments -> size() > 1)";
+
+ /**
+ * Validates the AtLeastTwoArgumentForANDOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_AtLeastTwoArgumentForANDOR(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "AtLeastTwoArgumentForANDOR",
+ FORMULA__AT_LEAST_TWO_ARGUMENT_FOR_ANDOR__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the TwoArgumentForIMPLEQUALXOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String FORMULA__TWO_ARGUMENT_FOR_IMPLEQUALXOR__EEXPRESSION = "((self.operator = laxcondition::Operator::IMPLIES) or (self.operator = laxcondition::Operator::EQUIVALENT) or (self.operator = laxcondition::Operator::XOR)) implies (self.arguments -> size() = 2)";
+
+ /**
+ * Validates the TwoArgumentForIMPLEQUALXOR constraint of '<em>Formula</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateFormula_TwoArgumentForIMPLEQUALXOR(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.FORMULA,
+ formula,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "TwoArgumentForIMPLEQUALXOR",
+ FORMULA__TWO_ARGUMENT_FOR_IMPLEQUALXOR__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateMorphism(Morphism morphism, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ if (!validate_NoCircularContainment(morphism, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validateMorphism_NodeMappingIsFromDomainToCoDomain(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validateMorphism_EdgeMappingIsFromDomainToCoDomain(morphism, diagnostics, context);
+ if (result || diagnostics != null) result &= validateMorphism_EdgeMappingConsistency(morphism, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * The cached validation expression for the NodeMappingIsFromDomainToCoDomain constraint of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String MORPHISM__NODE_MAPPING_IS_FROM_DOMAIN_TO_CO_DOMAIN__EEXPRESSION = "self.nodeMappings -> forAll(m|self.from.nodes -> includes(m.origin) and self.to.nodes -> includes(m.image))";
+
+ /**
+ * Validates the NodeMappingIsFromDomainToCoDomain constraint of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateMorphism_NodeMappingIsFromDomainToCoDomain(Morphism morphism, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.MORPHISM,
+ morphism,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "NodeMappingIsFromDomainToCoDomain",
+ MORPHISM__NODE_MAPPING_IS_FROM_DOMAIN_TO_CO_DOMAIN__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the EdgeMappingIsFromDomainToCoDomain constraint of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String MORPHISM__EDGE_MAPPING_IS_FROM_DOMAIN_TO_CO_DOMAIN__EEXPRESSION = "self.edgeMappings -> forAll(m|self.from.edges -> includes(m.origin) and self.to.edges -> includes(m.image))";
+
+ /**
+ * Validates the EdgeMappingIsFromDomainToCoDomain constraint of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateMorphism_EdgeMappingIsFromDomainToCoDomain(Morphism morphism, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.MORPHISM,
+ morphism,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "EdgeMappingIsFromDomainToCoDomain",
+ MORPHISM__EDGE_MAPPING_IS_FROM_DOMAIN_TO_CO_DOMAIN__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * The cached validation expression for the EdgeMappingConsistency constraint of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final String MORPHISM__EDGE_MAPPING_CONSISTENCY__EEXPRESSION = "self.edgeMappings -> forAll(em|self.nodeMappings -> exists(nm|nm.origin = em.origin.source and nm.image = em.image.source) and self.nodeMappings -> exists(nm|nm.origin = em.origin.target and nm.image = em.image.target))";
+
+ /**
+ * Validates the EdgeMappingConsistency constraint of '<em>Morphism</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateMorphism_EdgeMappingConsistency(Morphism morphism, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return
+ validate
+ (NestedconditionPackage.Literals.MORPHISM,
+ morphism,
+ diagnostics,
+ context,
+ "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
+ "EdgeMappingConsistency",
+ MORPHISM__EDGE_MAPPING_CONSISTENCY__EEXPRESSION,
+ Diagnostic.ERROR,
+ DIAGNOSTIC_SOURCE,
+ 0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateNodeMapping(NodeMapping nodeMapping, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(nodeMapping, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateEdgeMapping(EdgeMapping edgeMapping, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(edgeMapping, diagnostics, context);
+ }
+
+ /**
+ * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ // TODO
+ // Specialize this to return a resource locator for messages specific to this validator.
+ // Ensure that you remove @generated or mark it @generated NOT
+ return super.getResourceLocator();
+ }
+
+} //NestedconditionValidator
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/extensions/NestedConditionSimplifier.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/extensions/NestedConditionSimplifier.java
new file mode 100644
index 0000000..b7f9693
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedcondition/util/extensions/NestedConditionSimplifier.java
@@ -0,0 +1,424 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package nestedcondition.util.extensions;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
+
+import graph.Edge;
+import graph.Graph;
+import graph.Node;
+import laxcondition.Operator;
+import laxcondition.Quantifier;
+import nestedcondition.EdgeMapping;
+import nestedcondition.Formula;
+import nestedcondition.Morphism;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.NodeMapping;
+import nestedcondition.QuantifiedCondition;
+import nestedcondition.True;
+
+public class NestedConditionSimplifier {
+
+ private NestedConstraint constraint;
+ private NestedconditionFactory factory;
+
+ public NestedConditionSimplifier(NestedConstraint constraint) {
+ this.constraint = constraint;
+ this.factory = NestedconditionFactory.eINSTANCE;
+ }
+
+ public boolean simplify() {
+ if (simplifyTrueOrFalseInFormula()) {
+ return simplify();
+ }
+ if (simplifyNotNot()) {
+ return simplify();
+ }
+ if (simplifyImplies()) {
+ return simplify();
+ }
+ if (simplifyEquivalent()) {
+ return simplify();
+ }
+ if (simplifyXor()) {
+ return simplify();
+ }
+ if (simplifyExists()) {
+ return simplify();
+ }
+ if (simplifyForAll()) {
+ return simplify();
+ }
+ return true;
+ }
+
+ private boolean simplifyExists() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isExistsCondition(eObject)) {
+ QuantifiedCondition outerCondition = (QuantifiedCondition) eObject;
+ NestedCondition cond = outerCondition.getCondition();
+ if (isExistsCondition(cond)) {
+ QuantifiedCondition innerCondition = (QuantifiedCondition) cond;
+ Morphism outerMorphism = outerCondition.getMorphism();
+ Morphism innerMorphism = innerCondition.getMorphism();
+ for (EdgeMapping outerEM : outerMorphism.getEdgeMappings()) {
+ Edge gluingEdge = outerEM.getImage();
+ for (EdgeMapping innerEM : innerMorphism.getEdgeMappings()) {
+ if (innerEM.getOrigin() == gluingEdge) {
+ outerEM.setImage(innerEM.getImage());
+ break;
+ }
+ }
+ }
+ for (NodeMapping outerNM : outerMorphism.getNodeMappings()) {
+ Node gluingNode = outerNM.getImage();
+ for (NodeMapping innerNM : innerMorphism.getNodeMappings()) {
+ if (innerNM.getOrigin() == gluingNode) {
+ outerNM.setImage(innerNM.getImage());
+ break;
+ }
+ }
+ }
+ outerMorphism.setTo(innerMorphism.getTo());
+ Graph innerDomain = innerCondition.getCodomain();
+ innerCondition.setCodomain(null);
+ outerCondition.setCodomain(innerDomain);
+ NestedCondition innerInnerCondition = innerCondition.getCondition();
+ innerCondition.setCondition(null);
+ outerCondition.setCondition(innerInnerCondition);
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean simplifyForAll() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isForAllCondition(eObject)) {
+ QuantifiedCondition outerCondition = (QuantifiedCondition) eObject;
+ NestedCondition cond = outerCondition.getCondition();
+ if (isForAllCondition(cond)) {
+ QuantifiedCondition innerCondition = (QuantifiedCondition) cond;
+ Morphism outerMorphism = outerCondition.getMorphism();
+ Morphism innerMorphism = innerCondition.getMorphism();
+ for (EdgeMapping outerEM : outerMorphism.getEdgeMappings()) {
+ Edge gluingEdge = outerEM.getImage();
+ for (EdgeMapping innerEM : innerMorphism.getEdgeMappings()) {
+ if (innerEM.getOrigin() == gluingEdge) {
+ outerEM.setImage(innerEM.getImage());
+ break;
+ }
+ }
+ }
+ for (NodeMapping outerNM : outerMorphism.getNodeMappings()) {
+ Node gluingNode = outerNM.getImage();
+ for (NodeMapping innerNM : innerMorphism.getNodeMappings()) {
+ if (innerNM.getOrigin() == gluingNode) {
+ outerNM.setImage(innerNM.getImage());
+ break;
+ }
+ }
+ }
+ outerMorphism.setTo(innerMorphism.getTo());
+ Graph innerDomain = innerCondition.getCodomain();
+ innerCondition.setCodomain(null);
+ outerCondition.setCodomain(innerDomain);
+ NestedCondition innerInnerCondition = innerCondition.getCondition();
+ innerCondition.setCondition(null);
+ outerCondition.setCondition(innerInnerCondition);
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean simplifyXor() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isXorFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ Formula firstArg = (Formula) getCopy(formula);
+ Formula secondArg = (Formula) getCopy(formula);
+ swapArguments(secondArg);
+ negateFirstArgument(firstArg);
+ negateFirstArgument(secondArg);
+ firstArg.setOperator(Operator.AND);
+ secondArg.setOperator(Operator.AND);
+ formula.setOperator(Operator.OR);
+ formula.getArguments().set(0, firstArg);
+ formula.getArguments().set(1, secondArg);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void negateFirstArgument(Formula formula) {
+ NestedCondition firstArgument = formula.getArguments().get(0);
+ Formula notFormula = factory.createFormula();
+ notFormula.setOperator(Operator.NOT);
+ formula.getArguments().set(0, notFormula);
+ notFormula.getArguments().add(firstArgument);
+ }
+
+ private boolean simplifyEquivalent() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isEquivalentFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ Formula firstArg = (Formula) getCopy(formula);
+ Formula secondArg = (Formula) getCopy(formula);
+ swapArguments(secondArg);
+ firstArg.setOperator(Operator.IMPLIES);
+ secondArg.setOperator(Operator.IMPLIES);
+ formula.setOperator(Operator.AND);
+ formula.getArguments().set(0, firstArg);
+ formula.getArguments().set(1, secondArg);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void swapArguments(Formula formula) {
+ NestedCondition arg1 = formula.getArguments().get(0);
+ NestedCondition arg2 = formula.getArguments().get(1);
+ formula.getArguments().set(0, arg2);
+ formula.getArguments().set(1, arg1);
+ }
+
+ private EObject getCopy(EObject original) {
+ Copier copier = new Copier();
+ EObject copy = copier.copy(original);
+ copier.copyReferences();
+ return copy;
+ }
+
+ private boolean simplifyImplies() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isImpliesFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ NestedCondition arg1 = formula.getArguments().get(0);
+ Formula notFormula = factory.createFormula();
+ notFormula.setDomain(formula.getDomain());
+ notFormula.setOperator(Operator.NOT);
+ formula.setOperator(Operator.OR);
+ formula.getArguments().set(0, notFormula);
+ notFormula.getArguments().add(arg1);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean simplifyTrueOrFalseInFormula() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isAndFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ EObject container = formula.eContainer();
+ NestedCondition arg1 = formula.getArguments().get(0);
+ NestedCondition arg2 = formula.getArguments().get(1);
+ if (isTrue(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ if (isTrue(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ if (isFalse(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ if (isFalse(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ }
+ if (isOrFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ EObject container = formula.eContainer();
+ NestedCondition arg1 = formula.getArguments().get(0);
+ NestedCondition arg2 = formula.getArguments().get(1);
+ if (isTrue(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ if (isTrue(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ if (isFalse(arg1)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg2);
+ } else {
+ return removeArgument(formula, arg1);
+ }
+ }
+ if (isFalse(arg2)) {
+ if (twoArguments(formula)) {
+ return insert(container, formula, arg1);
+ } else {
+ return removeArgument(formula, arg2);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean removeArgument(Formula formula, NestedCondition cond) {
+ return formula.getArguments().remove(cond);
+ }
+
+ private boolean twoArguments(Formula formula) {
+ return (formula.getArguments().size() == 2);
+ }
+
+ private boolean isFalse(NestedCondition cond) {
+ if (isNotFormula(cond)) {
+ Formula formula = (Formula) cond;
+ return isTrue(formula.getArguments().get(0));
+ }
+ return false;
+ }
+
+ private boolean isTrue(NestedCondition cond) {
+ return (cond instanceof True);
+ }
+
+ private boolean simplifyNotNot() {
+ TreeIterator<EObject> iter = constraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (isNotFormula(eObject)) {
+ Formula formula = (Formula) eObject;
+ if (isNotFormula(formula.getArguments().get(0))) {
+ Formula innerFormula = (Formula) formula.getArguments().get(0);
+ NestedCondition innerCondition = innerFormula.getArguments().get(0);
+ EObject container = formula.eContainer();
+ return insert(container, formula, innerCondition);
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean insert(EObject container, NestedCondition oldContent, NestedCondition newContent) {
+ if (container == constraint) {
+ constraint.setCondition(newContent);
+ return true;
+ }
+ if (container instanceof QuantifiedCondition) {
+ QuantifiedCondition qlc = (QuantifiedCondition) container;
+ qlc.setCondition(newContent);
+ return true;
+ }
+ if (container instanceof Formula) {
+ Formula f = (Formula) container;
+ int index = f.getArguments().indexOf(oldContent);
+ f.getArguments().set(index, newContent);
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isNotFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOperator().equals(Operator.NOT));
+ }
+ return false;
+ }
+
+ private boolean isAndFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOperator().equals(Operator.AND));
+ }
+ return false;
+ }
+
+ private boolean isOrFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOperator().equals(Operator.OR));
+ }
+ return false;
+ }
+
+ private boolean isImpliesFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOperator().equals(Operator.IMPLIES));
+ }
+ return false;
+ }
+
+ private boolean isEquivalentFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOperator().equals(Operator.EQUIVALENT));
+ }
+ return false;
+ }
+
+ private boolean isXorFormula(EObject eObject) {
+ if (eObject instanceof Formula) {
+ Formula formula = (Formula) eObject;
+ return (formula.getOperator().equals(Operator.XOR));
+ }
+ return false;
+ }
+
+ private boolean isExistsCondition(EObject eObject) {
+ if (eObject instanceof QuantifiedCondition) {
+ QuantifiedCondition cond = (QuantifiedCondition) eObject;
+ return (cond.getQuantifier().equals(Quantifier.EXISTS));
+ }
+ return false;
+ }
+
+ private boolean isForAllCondition(EObject eObject) {
+ if (eObject instanceof QuantifiedCondition) {
+ QuantifiedCondition cond = (QuantifiedCondition) eObject;
+ return (cond.getQuantifier().equals(Quantifier.FORALL));
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedConstraintModel.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedConstraintModel.java
new file mode 100644
index 0000000..d73dc64
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedConstraintModel.java
@@ -0,0 +1,71 @@
+/**
+ */
+package nestedconstraintmodel;
+
+import nestedcondition.NestedConstraint;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Nested Constraint Model</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link nestedconstraintmodel.NestedConstraintModel#getName <em>Name</em>}</li>
+ * <li>{@link nestedconstraintmodel.NestedConstraintModel#getNestedconstrainmodels <em>Nestedconstrainmodels</em>}</li>
+ * </ul>
+ *
+ * @see nestedconstraintmodel.NestedconstraintmodelPackage#getNestedConstraintModel()
+ * @model
+ * @generated
+ */
+public interface NestedConstraintModel extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see nestedconstraintmodel.NestedconstraintmodelPackage#getNestedConstraintModel_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link nestedconstraintmodel.NestedConstraintModel#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Nestedconstrainmodels</b></em>' containment reference list.
+ * The list contents are of type {@link nestedcondition.NestedConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Nestedconstrainmodels</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Nestedconstrainmodels</em>' containment reference list.
+ * @see nestedconstraintmodel.NestedconstraintmodelPackage#getNestedConstraintModel_Nestedconstrainmodels()
+ * @model containment="true"
+ * @generated
+ */
+ EList<NestedConstraint> getNestedconstrainmodels();
+
+} // NestedConstraintModel
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedconstraintmodelFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedconstraintmodelFactory.java
new file mode 100644
index 0000000..10b8579
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedconstraintmodelFactory.java
@@ -0,0 +1,42 @@
+/**
+ */
+package nestedconstraintmodel;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see nestedconstraintmodel.NestedconstraintmodelPackage
+ * @generated
+ */
+public interface NestedconstraintmodelFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ NestedconstraintmodelFactory eINSTANCE = nestedconstraintmodel.impl.NestedconstraintmodelFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Nested Constraint Model</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Nested Constraint Model</em>'.
+ * @generated
+ */
+ NestedConstraintModel createNestedConstraintModel();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ NestedconstraintmodelPackage getNestedconstraintmodelPackage();
+
+} //NestedconstraintmodelFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedconstraintmodelPackage.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedconstraintmodelPackage.java
new file mode 100644
index 0000000..327a01f
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/NestedconstraintmodelPackage.java
@@ -0,0 +1,189 @@
+/**
+ */
+package nestedconstraintmodel;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see nestedconstraintmodel.NestedconstraintmodelFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface NestedconstraintmodelPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "nestedconstraintmodel";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.example.org/nestedconstraintmodel";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "nestedconstraintmodel";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ NestedconstraintmodelPackage eINSTANCE = nestedconstraintmodel.impl.NestedconstraintmodelPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link nestedconstraintmodel.impl.NestedConstraintModelImpl <em>Nested Constraint Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedconstraintmodel.impl.NestedConstraintModelImpl
+ * @see nestedconstraintmodel.impl.NestedconstraintmodelPackageImpl#getNestedConstraintModel()
+ * @generated
+ */
+ int NESTED_CONSTRAINT_MODEL = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT_MODEL__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Nestedconstrainmodels</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS = 1;
+
+ /**
+ * The number of structural features of the '<em>Nested Constraint Model</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT_MODEL_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Nested Constraint Model</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NESTED_CONSTRAINT_MODEL_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link nestedconstraintmodel.NestedConstraintModel <em>Nested Constraint Model</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Nested Constraint Model</em>'.
+ * @see nestedconstraintmodel.NestedConstraintModel
+ * @generated
+ */
+ EClass getNestedConstraintModel();
+
+ /**
+ * Returns the meta object for the attribute '{@link nestedconstraintmodel.NestedConstraintModel#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see nestedconstraintmodel.NestedConstraintModel#getName()
+ * @see #getNestedConstraintModel()
+ * @generated
+ */
+ EAttribute getNestedConstraintModel_Name();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link nestedconstraintmodel.NestedConstraintModel#getNestedconstrainmodels <em>Nestedconstrainmodels</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Nestedconstrainmodels</em>'.
+ * @see nestedconstraintmodel.NestedConstraintModel#getNestedconstrainmodels()
+ * @see #getNestedConstraintModel()
+ * @generated
+ */
+ EReference getNestedConstraintModel_Nestedconstrainmodels();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ NestedconstraintmodelFactory getNestedconstraintmodelFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link nestedconstraintmodel.impl.NestedConstraintModelImpl <em>Nested Constraint Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see nestedconstraintmodel.impl.NestedConstraintModelImpl
+ * @see nestedconstraintmodel.impl.NestedconstraintmodelPackageImpl#getNestedConstraintModel()
+ * @generated
+ */
+ EClass NESTED_CONSTRAINT_MODEL = eINSTANCE.getNestedConstraintModel();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NESTED_CONSTRAINT_MODEL__NAME = eINSTANCE.getNestedConstraintModel_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Nestedconstrainmodels</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS = eINSTANCE.getNestedConstraintModel_Nestedconstrainmodels();
+
+ }
+
+} //NestedconstraintmodelPackage
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedConstraintModelImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedConstraintModelImpl.java
new file mode 100644
index 0000000..bf22e06
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedConstraintModelImpl.java
@@ -0,0 +1,223 @@
+/**
+ */
+package nestedconstraintmodel.impl;
+
+import java.util.Collection;
+
+import nestedcondition.NestedConstraint;
+
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Nested Constraint Model</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link nestedconstraintmodel.impl.NestedConstraintModelImpl#getName <em>Name</em>}</li>
+ * <li>{@link nestedconstraintmodel.impl.NestedConstraintModelImpl#getNestedconstrainmodels <em>Nestedconstrainmodels</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class NestedConstraintModelImpl extends MinimalEObjectImpl.Container implements NestedConstraintModel {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getNestedconstrainmodels() <em>Nestedconstrainmodels</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getNestedconstrainmodels()
+ * @generated
+ * @ordered
+ */
+ protected EList<NestedConstraint> nestedconstrainmodels;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedConstraintModelImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NestedconstraintmodelPackage.Literals.NESTED_CONSTRAINT_MODEL;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<NestedConstraint> getNestedconstrainmodels() {
+ if (nestedconstrainmodels == null) {
+ nestedconstrainmodels = new EObjectContainmentEList<NestedConstraint>(NestedConstraint.class, this, NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS);
+ }
+ return nestedconstrainmodels;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS:
+ return ((InternalEList<?>)getNestedconstrainmodels()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NAME:
+ return getName();
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS:
+ return getNestedconstrainmodels();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NAME:
+ setName((String)newValue);
+ return;
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS:
+ getNestedconstrainmodels().clear();
+ getNestedconstrainmodels().addAll((Collection<? extends NestedConstraint>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS:
+ getNestedconstrainmodels().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS:
+ return nestedconstrainmodels != null && !nestedconstrainmodels.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //NestedConstraintModelImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedconstraintmodelFactoryImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedconstraintmodelFactoryImpl.java
new file mode 100644
index 0000000..4fce3b0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedconstraintmodelFactoryImpl.java
@@ -0,0 +1,95 @@
+/**
+ */
+package nestedconstraintmodel.impl;
+
+import nestedconstraintmodel.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NestedconstraintmodelFactoryImpl extends EFactoryImpl implements NestedconstraintmodelFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static NestedconstraintmodelFactory init() {
+ try {
+ NestedconstraintmodelFactory theNestedconstraintmodelFactory = (NestedconstraintmodelFactory)EPackage.Registry.INSTANCE.getEFactory(NestedconstraintmodelPackage.eNS_URI);
+ if (theNestedconstraintmodelFactory != null) {
+ return theNestedconstraintmodelFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new NestedconstraintmodelFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL: return createNestedConstraintModel();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedConstraintModel createNestedConstraintModel() {
+ NestedConstraintModelImpl nestedConstraintModel = new NestedConstraintModelImpl();
+ return nestedConstraintModel;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelPackage getNestedconstraintmodelPackage() {
+ return (NestedconstraintmodelPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static NestedconstraintmodelPackage getPackage() {
+ return NestedconstraintmodelPackage.eINSTANCE;
+ }
+
+} //NestedconstraintmodelFactoryImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedconstraintmodelPackageImpl.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedconstraintmodelPackageImpl.java
new file mode 100644
index 0000000..05c5d09
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/impl/NestedconstraintmodelPackageImpl.java
@@ -0,0 +1,215 @@
+/**
+ */
+package nestedconstraintmodel.impl;
+
+import graph.GraphPackage;
+
+import graph.impl.GraphPackageImpl;
+
+import laxcondition.LaxconditionPackage;
+
+import laxcondition.impl.LaxconditionPackageImpl;
+
+import nestedcondition.NestedconditionPackage;
+
+import nestedcondition.impl.NestedconditionPackageImpl;
+
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelFactory;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+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 NestedconstraintmodelPackageImpl extends EPackageImpl implements NestedconstraintmodelPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nestedConstraintModelEClass = 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 nestedconstraintmodel.NestedconstraintmodelPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private NestedconstraintmodelPackageImpl() {
+ super(eNS_URI, NestedconstraintmodelFactory.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 NestedconstraintmodelPackage#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 NestedconstraintmodelPackage init() {
+ if (isInited) return (NestedconstraintmodelPackage)EPackage.Registry.INSTANCE.getEPackage(NestedconstraintmodelPackage.eNS_URI);
+
+ // Obtain or create and register package
+ NestedconstraintmodelPackageImpl theNestedconstraintmodelPackage = (NestedconstraintmodelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof NestedconstraintmodelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new NestedconstraintmodelPackageImpl());
+
+ isInited = true;
+
+ // Obtain or create and register interdependencies
+ NestedconditionPackageImpl theNestedconditionPackage = (NestedconditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI) instanceof NestedconditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI) : NestedconditionPackage.eINSTANCE);
+ GraphPackageImpl theGraphPackage = (GraphPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI) instanceof GraphPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI) : GraphPackage.eINSTANCE);
+ LaxconditionPackageImpl theLaxconditionPackage = (LaxconditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI) instanceof LaxconditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(LaxconditionPackage.eNS_URI) : LaxconditionPackage.eINSTANCE);
+
+ // Create package meta-data objects
+ theNestedconstraintmodelPackage.createPackageContents();
+ theNestedconditionPackage.createPackageContents();
+ theGraphPackage.createPackageContents();
+ theLaxconditionPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theNestedconstraintmodelPackage.initializePackageContents();
+ theNestedconditionPackage.initializePackageContents();
+ theGraphPackage.initializePackageContents();
+ theLaxconditionPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theNestedconstraintmodelPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(NestedconstraintmodelPackage.eNS_URI, theNestedconstraintmodelPackage);
+ return theNestedconstraintmodelPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNestedConstraintModel() {
+ return nestedConstraintModelEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNestedConstraintModel_Name() {
+ return (EAttribute)nestedConstraintModelEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNestedConstraintModel_Nestedconstrainmodels() {
+ return (EReference)nestedConstraintModelEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelFactory getNestedconstraintmodelFactory() {
+ return (NestedconstraintmodelFactory)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
+ nestedConstraintModelEClass = createEClass(NESTED_CONSTRAINT_MODEL);
+ createEAttribute(nestedConstraintModelEClass, NESTED_CONSTRAINT_MODEL__NAME);
+ createEReference(nestedConstraintModelEClass, NESTED_CONSTRAINT_MODEL__NESTEDCONSTRAINMODELS);
+ }
+
+ /**
+ * <!-- 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
+ NestedconditionPackage theNestedconditionPackage = (NestedconditionPackage)EPackage.Registry.INSTANCE.getEPackage(NestedconditionPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(nestedConstraintModelEClass, NestedConstraintModel.class, "NestedConstraintModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getNestedConstraintModel_Name(), ecorePackage.getEString(), "name", null, 0, 1, NestedConstraintModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNestedConstraintModel_Nestedconstrainmodels(), theNestedconditionPackage.getNestedConstraint(), null, "nestedconstrainmodels", null, 0, -1, NestedConstraintModel.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);
+ }
+
+} //NestedconstraintmodelPackageImpl
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/util/NestedconstraintmodelAdapterFactory.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/util/NestedconstraintmodelAdapterFactory.java
new file mode 100644
index 0000000..8e47599
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/util/NestedconstraintmodelAdapterFactory.java
@@ -0,0 +1,120 @@
+/**
+ */
+package nestedconstraintmodel.util;
+
+import nestedconstraintmodel.*;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see nestedconstraintmodel.NestedconstraintmodelPackage
+ * @generated
+ */
+public class NestedconstraintmodelAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static NestedconstraintmodelPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = NestedconstraintmodelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NestedconstraintmodelSwitch<Adapter> modelSwitch =
+ new NestedconstraintmodelSwitch<Adapter>() {
+ @Override
+ public Adapter caseNestedConstraintModel(NestedConstraintModel object) {
+ return createNestedConstraintModelAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link nestedconstraintmodel.NestedConstraintModel <em>Nested Constraint Model</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see nestedconstraintmodel.NestedConstraintModel
+ * @generated
+ */
+ public Adapter createNestedConstraintModelAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //NestedconstraintmodelAdapterFactory
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/util/NestedconstraintmodelSwitch.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/util/NestedconstraintmodelSwitch.java
new file mode 100644
index 0000000..1480f15
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.model/src/nestedconstraintmodel/util/NestedconstraintmodelSwitch.java
@@ -0,0 +1,110 @@
+/**
+ */
+package nestedconstraintmodel.util;
+
+import nestedconstraintmodel.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see nestedconstraintmodel.NestedconstraintmodelPackage
+ * @generated
+ */
+public class NestedconstraintmodelSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static NestedconstraintmodelPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NestedconstraintmodelSwitch() {
+ if (modelPackage == null) {
+ modelPackage = NestedconstraintmodelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case NestedconstraintmodelPackage.NESTED_CONSTRAINT_MODEL: {
+ NestedConstraintModel nestedConstraintModel = (NestedConstraintModel)theEObject;
+ T result = caseNestedConstraintModel(nestedConstraintModel);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Nested Constraint Model</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Nested Constraint Model</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNestedConstraintModel(NestedConstraintModel object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //NestedconstraintmodelSwitch
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/.classpath b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/.classpath
new file mode 100644
index 0000000..eca7bdb
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/.project b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/.project
new file mode 100644
index 0000000..767c356
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.unimarburg.swt.ocl2ac.tool</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/META-INF/MANIFEST.MF b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d935881
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Automate
+Bundle-SymbolicName: de.unimarburg.swt.ocl2ac.tool;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: de.unimarburg.swt.ocl2ac.tool.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.common;bundle-version="2.11.1",
+ org.eclipse.core.resources;bundle-version="3.10.1",
+ de.unimarburg.swt.ocl2ac.ocl2gc,
+ org.eclipse.ocl.pivot,
+ org.eclipse.emf.henshin.model;bundle-version="1.4.0",
+ org.eclipse.emf.henshin.editor;bundle-version="1.4.0",
+ org.eclipse.core.filesystem;bundle-version="1.5.0",
+ org.eclipse.emf.henshin.interpreter,
+ de.unimarburg.swt.ocl2ac.gc2ac;bundle-version="1.0.0",
+ de.unimarburg.swt.ocl2ac.model;bundle-version="1.0.0",
+ org.eclipse.emf.common.ui;bundle-version="2.11.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Export-Package: de.unimarburg.swt.ocl2ac.tool,
+ de.unimarburg.swt.ocl2ac.tool.commands,
+ de.unimarburg.swt.ocl2ac.tool.optimizer
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/build.properties b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/build.properties
new file mode 100644
index 0000000..c085f6a
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/build.properties
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ icons/,\
+ plugin.xml,\
+ bin/,\
+ .settings/,\
+ .classpath,\
+ .project,\
+ build.properties
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/import.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/import.png
new file mode 100644
index 0000000..710385b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/import.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/integrator-16.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/integrator-16.png
new file mode 100644
index 0000000..b8c2196
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/integrator-16.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/integrator-32.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/integrator-32.png
new file mode 100644
index 0000000..8e2a107
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/integrator-32.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac-16.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac-16.png
new file mode 100644
index 0000000..1e3c65b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac-16.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac-32.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac-32.png
new file mode 100644
index 0000000..9af1da2
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac-32.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac16.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac16.png
new file mode 100644
index 0000000..895beb1
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/ocl2ac16.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/printButton.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/printButton.png
new file mode 100644
index 0000000..5a22b3b
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/printButton.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/translator.png b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/translator.png
new file mode 100644
index 0000000..16aa40d
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/icons/translator.png
Binary files differ
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/plugin.xml b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/plugin.xml
new file mode 100644
index 0000000..d10cd1c
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/plugin.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="de.unimarburg.swt.ocl2ac.automate.objectContribution2"
+ objectClass="org.eclipse.core.resources.IFile">
+ <menu
+ icon="icons/ocl2ac16.png"
+ id="ocl2ac.automate.menu"
+ label="OCL2AC"
+ path="addition">
+ <separator
+ name="group">
+ </separator>
+ </menu>
+ <action
+ class="de.unimarburg.swt.ocl2ac.tool.action.GC2AppCondAction"
+ enablesFor="2"
+ id="ocl2ac.automate.NGCtoACAction"
+ label="Integrate Nested Graph Constraints as Application Conditions for Rules"
+ menubarPath="ocl2ac.automate.menu/group">
+ </action>
+ <action
+ class="de.unimarburg.swt.ocl2ac.tool.action.OCL2GCAction"
+ enablesFor="2"
+ id="ocl2ac.automate.OCLtoNGCAction"
+ label="Translate OCL Constraints to Nested Graph Constraints"
+ menubarPath="ocl2ac.automate.menu/group">
+ </action>
+ <action
+ class="de.unimarburg.swt.ocl2ac.tool.action.LaxCond2GCAction"
+ enablesFor="1"
+ id="ocl2ac.automate.CCtoNGCAction"
+ label="Compact Condition to Nested Condition"
+ menubarPath="ocl2ac.automate.menu/group">
+ </action>
+ </objectContribution>
+ </extension>
+
+</plugin>
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/Activator.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/Activator.java
new file mode 100644
index 0000000..d22cdb0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/Activator.java
@@ -0,0 +1,55 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "de.unimarburg.swt.ocl2ac.tool"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/CompCond2AppCondAction.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/CompCond2AppCondAction.java
new file mode 100644
index 0000000..433838d
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/CompCond2AppCondAction.java
@@ -0,0 +1,179 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.action;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.henshin.model.HenshinPackage;
+import org.eclipse.emf.henshin.model.Module;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.emf.henshin.model.Unit;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import compactconditionmodel.CompactConditionModel;
+import compactconditionmodel.CompactconditionmodelPackage;
+import de.unimarburg.swt.ocl2ac.tool.ui.WizardLaxCond2AppCond;
+import laxcondition.Condition;
+
+public class CompCond2AppCondAction implements IObjectActionDelegate {
+
+ private static final String Compact_CONDITION_MODEL = ".compactconditionmodel";
+ private static final String HENSHIN = ".henshin";
+ private List<IFile> files = null;
+ private IFile compactConditionModelFile = null;
+ private IFile henshinFile = null;
+ private Module module = null;
+ private CompactConditionModel compactConditionModel = null;
+ private Shell shell;
+
+ /**
+ * Constructor for TransformAction.
+ */
+ public CompCond2AppCondAction() {
+ super();
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+
+ if (checkFiles()) {
+ initModels();
+
+ HashMap<Integer, Condition> hashmapAllCompactConditions = fillHashMap_LaxConds();
+ HashMap<Integer, Rule> hashmapAllRules = fillHashMap_Rule();
+
+ if (hashmapAllCompactConditions.size() > 0 && hashmapAllRules.size() > 0) {
+ Display display = Display.getDefault();
+ WizardLaxCond2AppCond uiAssistent = new WizardLaxCond2AppCond(display, henshinFile,
+ hashmapAllCompactConditions, hashmapAllRules, compactConditionModelFile);
+
+ Monitor primary = display.getPrimaryMonitor();
+ Rectangle bounds = primary.getBounds();
+ Rectangle rect = uiAssistent.getBounds();
+ int x = bounds.x + (bounds.width - rect.width) / 2;
+ int y = bounds.y + (bounds.height - rect.height) / 2;
+ uiAssistent.setLocation(x, y);
+ uiAssistent.open();
+ uiAssistent.layout();
+ while (!uiAssistent.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
+ } else {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Integration", "Integration can not be executed on the input.");
+ }
+
+ }
+
+ private void initModels() {
+ URI uriHenshin = URI.createPlatformResourceURI(this.henshinFile.getFullPath().toString(), true);
+ URI uriNestedConstraintModel = URI
+ .createPlatformResourceURI(this.compactConditionModelFile.getFullPath().toString(), true);
+ if (uriHenshin != null && uriNestedConstraintModel != null) {
+ // Load the henshin module and the henshin rule
+ HenshinPackage.eINSTANCE.eClass();
+ Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
+ Map<String, Object> m = reg.getExtensionToFactoryMap();
+ m.put("*.henshin", new XMIResourceFactoryImpl());
+ ResourceSet resSet = new ResourceSetImpl();
+ Resource resourceHenshin = resSet.getResource(uriHenshin, true);
+ this.module = (Module) resourceHenshin.getContents().get(0);
+
+ // Load the nested condition
+ CompactconditionmodelPackage.eINSTANCE.eClass();
+ m.put("*.compactconditionmodel", new XMIResourceFactoryImpl());
+ Resource resourceNestedcondition = resSet.getResource(uriNestedConstraintModel, true);
+ this.compactConditionModel = (CompactConditionModel) resourceNestedcondition.getContents().get(0);
+ }
+ }
+
+ private boolean checkFiles() {
+ IFile file1 = files.get(0);
+ IFile file2 = files.get(1);
+ if (!(file1.getName().endsWith(HENSHIN) || file2.getName().endsWith(HENSHIN)))
+ return false;
+ if (!(file1.getName().endsWith(Compact_CONDITION_MODEL) || file2.getName().endsWith(Compact_CONDITION_MODEL)))
+ return false;
+ if (file1.getName().endsWith(Compact_CONDITION_MODEL)) {
+ compactConditionModelFile = file1;
+ henshinFile = file2;
+ } else {
+ compactConditionModelFile = file2;
+ henshinFile = file1;
+ }
+ return true;
+ }
+
+ private HashMap<Integer, Rule> fillHashMap_Rule() {
+ HashMap<Integer, Rule> hashmapAllRules = new HashMap<Integer, Rule>();
+ int j = 0;
+ for (Unit unit : module.getUnits()) {
+ if (unit instanceof Rule) {
+ hashmapAllRules.put(j, (Rule) unit);
+ j++;
+ }
+ }
+ return hashmapAllRules;
+ }
+
+ private HashMap<Integer, Condition> fillHashMap_LaxConds() {
+ HashMap<Integer, Condition> hashmapAllLaxConditions = new HashMap<Integer, Condition>();
+ int i = 0;
+ for (Condition nc : compactConditionModel.getCompactconditions()) {
+ hashmapAllLaxConditions.put(i, nc);
+ i++;
+ }
+ return hashmapAllLaxConditions;
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(IAction action, ISelection selection) {
+ files = new ArrayList<IFile>();
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ List<Object> objects = ss.toList();
+ for (Object o : objects) {
+ files.add((IFile) o);
+ }
+ }
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ shell = targetPart.getSite().getShell();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/GC2AppCondAction.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/GC2AppCondAction.java
new file mode 100644
index 0000000..60b17e9
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/GC2AppCondAction.java
@@ -0,0 +1,176 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.action;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.henshin.model.HenshinPackage;
+import org.eclipse.emf.henshin.model.Module;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.emf.henshin.model.Unit;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import de.unimarburg.swt.ocl2ac.tool.ui.WizardGC2AppCond;
+import nestedcondition.NestedConstraint;
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+public class GC2AppCondAction implements IObjectActionDelegate {
+
+ private static final String NESTED_CONSTRAINT_MODEL = ".nestedconstraintmodel";
+ private static final String HENSHIN = ".henshin";
+ private Shell shell;
+ private List<IFile> files = null;
+ private IFile nestedConstraintModelFile = null;
+ private IFile henshinFile = null;
+ private Module module = null;
+ private NestedConstraintModel nestedconstraintmodel = null;
+
+ /**
+ * Constructor for TransformAction.
+ */
+ public GC2AppCondAction() {
+ super();
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ if (checkFiles()) {
+ initModels();
+ HashMap<Integer, NestedConstraint> hashmapAllNestedconstraints = fillHashMap_NC();
+ HashMap<Integer, Rule> hashmapAllRules = fillHashMap_Rule();
+
+ if (hashmapAllNestedconstraints.size() > 0 && hashmapAllRules.size() > 0) {
+ Display display = Display.getDefault();
+ WizardGC2AppCond uiAssistent = new WizardGC2AppCond(display, henshinFile, hashmapAllNestedconstraints,
+ hashmapAllRules, nestedConstraintModelFile);
+
+ Monitor primary = display.getPrimaryMonitor();
+ Rectangle bounds = primary.getBounds();
+ Rectangle rect = uiAssistent.getBounds();
+ int x = bounds.x + (bounds.width - rect.width) / 2;
+ int y = bounds.y + (bounds.height - rect.height) / 2;
+ uiAssistent.setLocation(x, y);
+ uiAssistent.open();
+ uiAssistent.layout();
+ while (!uiAssistent.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
+ } else {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Integration", "Integration can not be executed on the input.");
+ }
+
+ }
+
+ private void initModels() {
+ URI uriHenshin = URI.createPlatformResourceURI(this.henshinFile.getFullPath().toString(), true);
+ URI uriNestedConstraintModel = URI
+ .createPlatformResourceURI(this.nestedConstraintModelFile.getFullPath().toString(), true);
+ if (uriHenshin != null && uriNestedConstraintModel != null) {
+ // Load the henshin module and the henshin rule
+ HenshinPackage.eINSTANCE.eClass();
+ Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
+ Map<String, Object> m = reg.getExtensionToFactoryMap();
+ m.put("*.henshin", new XMIResourceFactoryImpl());
+ ResourceSet resSet = new ResourceSetImpl();
+ Resource resourceHenshin = resSet.getResource(uriHenshin, true);
+ this.module = (Module) resourceHenshin.getContents().get(0);
+ // Load the nested condition
+ NestedconstraintmodelPackage.eINSTANCE.eClass();
+ m.put("*.nestedconstraintmodel", new XMIResourceFactoryImpl());
+ Resource resourceNestedcondition = resSet.getResource(uriNestedConstraintModel, true);
+ this.nestedconstraintmodel = (NestedConstraintModel) resourceNestedcondition.getContents().get(0);
+ }
+ }
+
+ private boolean checkFiles() {
+ IFile file1 = files.get(0);
+ IFile file2 = files.get(1);
+ if (!(file1.getName().endsWith(HENSHIN) || file2.getName().endsWith(HENSHIN)))
+ return false;
+ if (!(file1.getName().endsWith(NESTED_CONSTRAINT_MODEL) || file2.getName().endsWith(NESTED_CONSTRAINT_MODEL)))
+ return false;
+ if (file1.getName().endsWith(NESTED_CONSTRAINT_MODEL)) {
+ nestedConstraintModelFile = file1;
+ henshinFile = file2;
+ } else {
+ nestedConstraintModelFile = file2;
+ henshinFile = file1;
+ }
+ return true;
+ }
+
+ private HashMap<Integer, Rule> fillHashMap_Rule() {
+ HashMap<Integer, Rule> hashmapAllRules = new HashMap<Integer, Rule>();
+ int j = 0;
+ for (Unit unit : module.getUnits()) {
+ if (unit instanceof Rule) {
+ hashmapAllRules.put(j, (Rule) unit);
+ j++;
+ }
+ }
+ return hashmapAllRules;
+ }
+
+ private HashMap<Integer, NestedConstraint> fillHashMap_NC() {
+ HashMap<Integer, NestedConstraint> hashmapAllNestedconstraints = new HashMap<Integer, NestedConstraint>();
+ int i = 0;
+ for (NestedConstraint nc : nestedconstraintmodel.getNestedconstrainmodels()) {
+ hashmapAllNestedconstraints.put(i, nc);
+ i++;
+ }
+ return hashmapAllNestedconstraints;
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(IAction action, ISelection selection) {
+ files = new ArrayList<IFile>();
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ List<Object> objects = ss.toList();
+ for (Object o : objects) {
+ files.add((IFile) o);
+ }
+ }
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ shell = targetPart.getSite().getShell();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/LaxCond2AppCondAction.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/LaxCond2AppCondAction.java
new file mode 100644
index 0000000..46ad15e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/LaxCond2AppCondAction.java
@@ -0,0 +1,305 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.henshin.interpreter.EGraph;
+import org.eclipse.emf.henshin.interpreter.Engine;
+import org.eclipse.emf.henshin.interpreter.Match;
+import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl;
+import org.eclipse.emf.henshin.interpreter.impl.EngineImpl;
+import org.eclipse.emf.henshin.interpreter.util.InterpreterUtil;
+import org.eclipse.emf.henshin.model.HenshinFactory;
+import org.eclipse.emf.henshin.model.HenshinPackage;
+import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.Node;
+import org.eclipse.emf.henshin.model.Parameter;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import compactconditionmodel.CompactConditionModel;
+import de.unimarburg.swt.ocl2ac.ocl2gc.core.Completer;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.Constants;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.TranslatorResourceSet;
+import laxcondition.Condition;
+import laxcondition.LaxconditionPackage;
+import laxcondition.util.extensions.LaxConditionSimplifier;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.Variable;
+import nestedcondition.util.extensions.NestedConditionSimplifier;
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelFactory;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+public class LaxCond2AppCondAction implements IObjectActionDelegate {
+
+ private static final String COMPACTCONDITION = ".compactconditionmodel";
+ private Shell shell;
+ private IFile selectedFile = null;
+ HashMap<Condition, List<String>> mapCon2Var = null;
+
+ /**
+ * Constructor for TransformAction.
+ */
+ public LaxCond2AppCondAction() {
+ super();
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ mapCon2Var = new HashMap<Condition, List<String>>();
+ if (checkFile()) {
+ Cursor oldCursor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getCursor();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
+ .setCursor(new Cursor(null, SWT.CURSOR_WAIT));
+
+ URI uri = URI.createPlatformResourceURI(this.selectedFile.getFullPath().toString(), true);
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
+ .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+ Resource resource = resourceSet.getResource(uri, true);
+ EObject root = resource.getContents().get(0);
+
+ long start = System.currentTimeMillis();
+
+ // 1. Get List of lax Conditions
+ List<Condition> arrayListLaxConditions = new ArrayList<Condition>();
+ if (root instanceof CompactConditionModel) {
+ arrayListLaxConditions.addAll(((CompactConditionModel) root).getCompactconditions());
+ }
+
+ System.out.println("arrayListLaxConditions size is: " + arrayListLaxConditions.size());
+
+ // Construct mapCon2Var
+ for (Condition cond : arrayListLaxConditions) {
+ mapCon2Var.put(cond, getDistinctVariableNames(cond));
+ }
+
+ // 2. Simplify each lax condition
+ simplifyLaxConditions(arrayListLaxConditions);
+
+ // 3. Complete each lax condition to NestedConstraints
+ List<NestedConstraint> arrayListNestedConstraints = completeLaxConditions(mapCon2Var,
+ arrayListLaxConditions);
+
+ // 4. Simplify each NestedConstraint
+ simplifyNestedConstraints(arrayListNestedConstraints);
+ long stop = System.currentTimeMillis();
+ long translationTime = stop - start;
+ System.out.println("[#" + translationTime + ")]");
+
+ // 5. Persist the simplified nested constraints
+ NestedconstraintmodelPackage.eINSTANCE.eClass();
+ NestedConstraintModel constraintmodel = NestedconstraintmodelFactory.eINSTANCE
+ .createNestedConstraintModel();
+ constraintmodel.setName(arrayListNestedConstraints.get(0).getTypeGraph().getName() + "Constraints");
+
+ constraintmodel.getNestedconstrainmodels().addAll(arrayListNestedConstraints);
+
+ System.out.println("[# Resulted NGC is:(" + arrayListNestedConstraints.size() + ")]");
+ Date date = new GregorianCalendar().getTime();
+ persistNestedConstraintsModel(date, constraintmodel);
+ shell.setCursor(oldCursor);
+
+ MessageDialog.openInformation(shell, "OCL2AC",
+ "The translation time is: (" + (translationTime / (double) 1000) + ") second(s).");
+ }
+
+ }
+
+ /**
+ *
+ * @param cond
+ * of LaxconditionPackage
+ * @return
+ */
+ private List<String> getDistinctVariableNames(Condition cond) {
+ List<String> varNames = new ArrayList<String>();
+ HenshinFactory factory = HenshinFactory.eINSTANCE;
+ Rule rule = factory.createRule();
+ Parameter param = factory.createParameter("p");
+ rule.getParameters().add(param);
+ Node sourceLHS = factory.createNode(rule.getLhs(), LaxconditionPackage.Literals.VARIABLE, "");
+ sourceLHS.setName(param.getName());
+ Node sourceRHS = factory.createNode(rule.getRhs(), LaxconditionPackage.Literals.VARIABLE, "");
+ sourceRHS.setName(param.getName());
+ Mapping sourceMapping = factory.createMapping(sourceLHS, sourceRHS);
+ rule.getMappings().add(sourceMapping);
+
+ HenshinPackage.eINSTANCE.eClass();
+ EGraph graph = new EGraphImpl(cond);
+ Engine engine = new EngineImpl();
+ List<Match> allMatches = InterpreterUtil.findAllMatches(engine, rule, graph, null);
+ for (Match m : allMatches) {
+ Object parameterValue = m.getParameterValue(param);
+ if (parameterValue instanceof laxcondition.Variable) {
+ laxcondition.Variable v = (laxcondition.Variable) parameterValue;
+ if (v.getName() != null) {
+ if (!varNames.contains(v.getName())) {
+ varNames.add(v.getName());
+ }
+ }
+ }
+ }
+
+ return varNames;
+ }
+
+ /**
+ *
+ * @param arrayListNestedConstraints
+ */
+ private void simplifyNestedConstraints(List<NestedConstraint> arrayListNestedConstraints) {
+ for (NestedConstraint nestedconstrain : arrayListNestedConstraints) {
+ try {
+ NestedConditionSimplifier simplifierNGC = new NestedConditionSimplifier(nestedconstrain);
+ boolean bc = simplifierNGC.simplify();
+ } catch (Exception e) {
+ System.err.println("The nestedconstrain " + nestedconstrain.getName() + " is not simplified well");
+ }
+ }
+ }
+
+ /**
+ *
+ * @param translator
+ * @param arrayListLaxConditions
+ * @return
+ */
+ private List<NestedConstraint> completeLaxConditions(HashMap<Condition, List<String>> mapCon2Var,
+ List<Condition> arrayListLaxConditions) {
+ List<NestedConstraint> arrayListNestedConstraints = new ArrayList<NestedConstraint>();
+ List<String> conditionVarNames = null;
+ for (Condition condition : arrayListLaxConditions) {
+ try {
+ conditionVarNames = mapCon2Var.get(condition);
+ Completer completer = new Completer(condition);
+ long timeNeeded = completer.complete();
+ NestedConstraint nestedConstraint = completer.getConstraint();
+ NestedCondition nestedCondition = nestedConstraint.getCondition();
+
+ if (conditionVarNames != null)
+ addVariables2Condition(nestedCondition, conditionVarNames);
+
+ arrayListNestedConstraints.add(nestedConstraint);
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not completed well");
+ }
+ }
+ return arrayListNestedConstraints;
+ }
+
+ /**
+ *
+ * @param arrayListLaxConditions
+ */
+ private void simplifyLaxConditions(List<Condition> arrayListLaxConditions) {
+ for (Condition condition : arrayListLaxConditions) {
+ try {
+ LaxConditionSimplifier simplifier = new LaxConditionSimplifier(condition);
+ simplifier.simplify();
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not simplified well");
+ }
+ }
+ }
+
+ // TODO add variables to LaxCondition. I added. To be tested
+ /**
+ * Add variables to the completed nested condition
+ *
+ * @param nestedCondition
+ * @param conditionVarNames
+ */
+ private void addVariables2Condition(NestedCondition nestedCondition, List<String> conditionVarNames) {
+ for (String v : conditionVarNames) {
+ Variable conVar = NestedconditionFactory.eINSTANCE.createVariable();
+ conVar.setName(v);
+ if (!nestedCondition.getVariables().contains(conVar))
+ nestedCondition.getVariables().add(conVar);
+ }
+ }
+
+ /**
+ *
+ * @param date
+ * @param nestedConstraintModel
+ */
+ private void persistNestedConstraintsModel(Date date, NestedConstraintModel nestedConstraintModel) {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+ String path = selectedFile.getParent().getLocation().toOSString();// append(Constants.NESTED_CONSTRAINTS
+ // +
+ // sdf.format(date)).toOSString();
+ TranslatorResourceSet resourceSet = new TranslatorResourceSet(path);
+ resourceSet.saveEObject(nestedConstraintModel,
+ nestedConstraintModel.getName().concat("_" + sdf.format(date) + Constants.NESTED_CONSTRAINTS_MODEL));
+ try {
+ selectedFile.getParent().refreshLocal(IResource.DEPTH_ONE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ private boolean checkFile() {
+ if (!(selectedFile.getName().endsWith(COMPACTCONDITION)))
+ return false;
+ return true;
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ Object object = ss.getFirstElement();
+ if (object instanceof IFile)
+ selectedFile = (IFile) object;
+ }
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ shell = targetPart.getSite().getShell();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/LaxCond2GCAction.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/LaxCond2GCAction.java
new file mode 100644
index 0000000..2ffa843
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/LaxCond2GCAction.java
@@ -0,0 +1,305 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.henshin.interpreter.EGraph;
+import org.eclipse.emf.henshin.interpreter.Engine;
+import org.eclipse.emf.henshin.interpreter.Match;
+import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl;
+import org.eclipse.emf.henshin.interpreter.impl.EngineImpl;
+import org.eclipse.emf.henshin.interpreter.util.InterpreterUtil;
+import org.eclipse.emf.henshin.model.HenshinFactory;
+import org.eclipse.emf.henshin.model.HenshinPackage;
+import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.Node;
+import org.eclipse.emf.henshin.model.Parameter;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import compactconditionmodel.CompactConditionModel;
+import de.unimarburg.swt.ocl2ac.ocl2gc.core.Completer;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.Constants;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.TranslatorResourceSet;
+import laxcondition.Condition;
+import laxcondition.LaxconditionPackage;
+import laxcondition.util.extensions.LaxConditionSimplifier;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.Variable;
+import nestedcondition.util.extensions.NestedConditionSimplifier;
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelFactory;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+public class LaxCond2GCAction implements IObjectActionDelegate {
+
+ private static final String COMPACTCONDITION = ".compactconditionmodel";
+ private Shell shell;
+ private IFile selectedFile = null;
+ HashMap<Condition, List<String>> mapCon2Var = null;
+
+ /**
+ * Constructor for TransformAction.
+ */
+ public LaxCond2GCAction() {
+ super();
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ mapCon2Var = new HashMap<Condition, List<String>>();
+ if (checkFile()) {
+ Cursor oldCursor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getCursor();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
+ .setCursor(new Cursor(null, SWT.CURSOR_WAIT));
+
+ URI uri = URI.createPlatformResourceURI(this.selectedFile.getFullPath().toString(), true);
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
+ .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+ Resource resource = resourceSet.getResource(uri, true);
+ EObject root = resource.getContents().get(0);
+
+ long start = System.currentTimeMillis();
+
+ // 1. Get List of lax Conditions
+ List<Condition> arrayListLaxConditions = new ArrayList<Condition>();
+ if (root instanceof CompactConditionModel) {
+ arrayListLaxConditions.addAll(((CompactConditionModel) root).getCompactconditions());
+ }
+
+ System.out.println("arrayListLaxConditions size is: " + arrayListLaxConditions.size());
+
+ // Construct mapCon2Var
+ for (Condition cond : arrayListLaxConditions) {
+ mapCon2Var.put(cond, getDistinctVariableNames(cond));
+ }
+
+ // 2. Simplify each lax condition
+ simplifyLaxConditions(arrayListLaxConditions);
+
+ // 3. Complete each lax condition to NestedConstraints
+ List<NestedConstraint> arrayListNestedConstraints = completeLaxConditions(mapCon2Var,
+ arrayListLaxConditions);
+
+ // 4. Simplify each NestedConstraint
+ simplifyNestedConstraints(arrayListNestedConstraints);
+ long stop = System.currentTimeMillis();
+ long translationTime = stop - start;
+ System.out.println("[#" + translationTime + ")]");
+
+ // 5. Persist the simplified nested constraints
+ NestedconstraintmodelPackage.eINSTANCE.eClass();
+ NestedConstraintModel constraintmodel = NestedconstraintmodelFactory.eINSTANCE
+ .createNestedConstraintModel();
+ constraintmodel.setName(arrayListNestedConstraints.get(0).getTypeGraph().getName() + "Constraints");
+
+ constraintmodel.getNestedconstrainmodels().addAll(arrayListNestedConstraints);
+ System.out.println("[# Resulted NGC is:(" + arrayListNestedConstraints.size() + ")]");
+ Date date = new GregorianCalendar().getTime();
+ persistNestedConstraintsModel(date, constraintmodel);
+ shell.setCursor(oldCursor);
+
+ MessageDialog.openInformation(shell, "OCL2AC",
+ "The translation time is: (" + (translationTime / (double) 1000) + ") second(s).");
+ }
+
+ }
+
+ /**
+ *
+ * @param cond
+ * of LaxconditionPackage
+ * @return
+ */
+ private List<String> getDistinctVariableNames(Condition cond) {
+ List<String> varNames = new ArrayList<String>();
+ HenshinFactory factory = HenshinFactory.eINSTANCE;
+ Rule rule = factory.createRule();
+ Parameter param = factory.createParameter("p");
+ rule.getParameters().add(param);
+ Node sourceLHS = factory.createNode(rule.getLhs(), LaxconditionPackage.Literals.VARIABLE, "");
+ sourceLHS.setName(param.getName());
+ Node sourceRHS = factory.createNode(rule.getRhs(), LaxconditionPackage.Literals.VARIABLE, "");
+ sourceRHS.setName(param.getName());
+ Mapping sourceMapping = factory.createMapping(sourceLHS, sourceRHS);
+ rule.getMappings().add(sourceMapping);
+
+ HenshinPackage.eINSTANCE.eClass();
+ EGraph graph = new EGraphImpl(cond);
+ Engine engine = new EngineImpl();
+ List<Match> allMatches = InterpreterUtil.findAllMatches(engine, rule, graph, null);
+ for (Match m : allMatches) {
+ Object parameterValue = m.getParameterValue(param);
+ if (parameterValue instanceof laxcondition.Variable) {
+ laxcondition.Variable v = (laxcondition.Variable) parameterValue;
+ if (v.getName() != null) {
+ if (!varNames.contains(v.getName())) {
+ varNames.add(v.getName());
+ }
+ }
+ }
+ }
+
+ return varNames;
+ }
+
+ /**
+ *
+ * @param arrayListNestedConstraints
+ */
+ private void simplifyNestedConstraints(List<NestedConstraint> arrayListNestedConstraints) {
+ for (NestedConstraint nestedconstrain : arrayListNestedConstraints) {
+ try {
+ NestedConditionSimplifier simplifierNGC = new NestedConditionSimplifier(nestedconstrain);
+ boolean bc = simplifierNGC.simplify();
+ } catch (Exception e) {
+ System.err.println("The nestedconstrain " + nestedconstrain.getName() + " is not simplified well");
+ }
+ }
+ }
+
+ /**
+ *
+ * @param translator
+ * @param arrayListLaxConditions
+ * @return
+ */
+ private List<NestedConstraint> completeLaxConditions(HashMap<Condition, List<String>> mapCon2Var,
+ List<Condition> arrayListLaxConditions) {
+ List<NestedConstraint> arrayListNestedConstraints = new ArrayList<NestedConstraint>();
+ List<String> conditionVarNames = null;
+ for (Condition condition : arrayListLaxConditions) {
+ try {
+ conditionVarNames = mapCon2Var.get(condition);
+ Completer completer = new Completer(condition);
+ long timeNeeded = completer.complete();
+ NestedConstraint nestedConstraint = completer.getConstraint();
+ NestedCondition nestedCondition = nestedConstraint.getCondition();
+
+ if (conditionVarNames != null)
+ addVariables2Condition(nestedCondition, conditionVarNames);
+
+ arrayListNestedConstraints.add(nestedConstraint);
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not completed well");
+ }
+ }
+ return arrayListNestedConstraints;
+ }
+
+ /**
+ *
+ * @param arrayListLaxConditions
+ */
+ private void simplifyLaxConditions(List<Condition> arrayListLaxConditions) {
+ for (Condition condition : arrayListLaxConditions) {
+ try {
+ LaxConditionSimplifier simplifier = new LaxConditionSimplifier(condition);
+ simplifier.simplify();
+
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not simplified well");
+ }
+ }
+ }
+
+ // TODO add variables to LaxCondition. I added. To be tested
+ /**
+ * Add variables to the completed nested condition
+ *
+ * @param nestedCondition
+ * @param conditionVarNames
+ */
+ private void addVariables2Condition(NestedCondition nestedCondition, List<String> conditionVarNames) {
+ for (String v : conditionVarNames) {
+ Variable conVar = NestedconditionFactory.eINSTANCE.createVariable();
+ conVar.setName(v);
+ if (!nestedCondition.getVariables().contains(conVar))
+ nestedCondition.getVariables().add(conVar);
+ }
+ }
+
+ /**
+ *
+ * @param date
+ * @param nestedConstraintModel
+ */
+ private void persistNestedConstraintsModel(Date date, NestedConstraintModel nestedConstraintModel) {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+ String path = selectedFile.getParent().getLocation().toOSString();// append(Constants.NESTED_CONSTRAINTS
+ // +
+ // sdf.format(date)).toOSString();
+ TranslatorResourceSet resourceSet = new TranslatorResourceSet(path);
+ resourceSet.saveEObject(nestedConstraintModel,
+ nestedConstraintModel.getName().concat("_" + sdf.format(date) + Constants.NESTED_CONSTRAINTS_MODEL));
+ try {
+ selectedFile.getParent().refreshLocal(IResource.DEPTH_ONE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ private boolean checkFile() {
+ if (!(selectedFile.getName().endsWith(COMPACTCONDITION)))
+ return false;
+ return true;
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ Object object = ss.getFirstElement();
+ if (object instanceof IFile)
+ selectedFile = (IFile) object;
+ }
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ shell = targetPart.getSite().getShell();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/OCL2GCAction.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/OCL2GCAction.java
new file mode 100644
index 0000000..504a6dd
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/action/OCL2GCAction.java
@@ -0,0 +1,253 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import de.unimarburg.swt.ocl2ac.ocl2gc.core.Completer;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.Constants;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.TranslatorResourceSet;
+import de.unimarburg.swt.ocl2ac.tool.commands.OCL2LaxCondCommand;
+import laxcondition.Condition;
+import laxcondition.util.extensions.LaxConditionSimplifier;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.Variable;
+import nestedcondition.util.extensions.NestedConditionSimplifier;
+import nestedconstraintmodel.NestedConstraintModel;
+import nestedconstraintmodel.NestedconstraintmodelFactory;
+import nestedconstraintmodel.NestedconstraintmodelPackage;
+
+public class OCL2GCAction implements IObjectActionDelegate {
+
+ private static final String OCLAS = ".oclas";
+ private static final String ECORE = ".ecore";
+ private Shell shell;
+ private List<IFile> files = null;
+ private IFile ecoreFile = null;
+ private IFile oclasFile = null;
+
+ /**
+ * Constructor for TransformAction.
+ */
+ public OCL2GCAction() {
+ super();
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ if (checkFiles()) {
+ Cursor oldCursor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getCursor();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
+ .setCursor(new Cursor(null, SWT.CURSOR_WAIT));
+
+ long start = System.currentTimeMillis();
+ // 1. Get List of lax Conditions
+ OCL2LaxCondCommand translator = new OCL2LaxCondCommand(oclasFile, ecoreFile);
+ List<Condition> arrayListLaxConditions = translator.getSetofLaxConditions();
+ System.out.println("NN: arrayListLaxConditions size is: " + arrayListLaxConditions.size());
+ EPackage typeModel = translator.getTypeModel();
+
+ // 2. Simplify each lax condition
+ simplifyLaxConditions(arrayListLaxConditions);
+
+ // 3. Complete each lax condition to NestedConstraints
+ List<NestedConstraint> arrayListNestedConstraints = completeLaxConditions(translator,
+ arrayListLaxConditions);
+
+ // 4. Simplify each NestedConstraint
+ simplifyNextedConstraints(arrayListNestedConstraints);
+
+ long stop = System.currentTimeMillis();
+
+ long translationTime = stop - start;
+ System.out.println("[#" + translationTime + ")]");
+
+ // 5. Persist the simplified nested constraints
+ NestedconstraintmodelPackage.eINSTANCE.eClass();
+ NestedConstraintModel constraintmodel = NestedconstraintmodelFactory.eINSTANCE
+ .createNestedConstraintModel();
+ constraintmodel.setName(typeModel.getName() + "Constraints");
+
+ constraintmodel.getNestedconstrainmodels().addAll(arrayListNestedConstraints);
+
+ System.out.println("[# OCL Invariants is:(" + translator.invariants.size() + ")]");
+ System.out.println("[# Resulted NGC is:(" + arrayListNestedConstraints.size() + ")]");
+ Date date = new GregorianCalendar().getTime();
+ persistNestedConstraintsModel(date, constraintmodel);
+ shell.setCursor(oldCursor);
+
+ MessageDialog.openInformation(shell, "OCL2AC",
+ "The translation time is: (" + (translationTime / (double) 1000) + ") second(s).");
+
+ } else {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Translation", "Translation can not be executed on the input.");
+ }
+
+ }
+
+ /**
+ *
+ * @param arrayListNestedConstraints
+ */
+ private void simplifyNextedConstraints(List<NestedConstraint> arrayListNestedConstraints) {
+ for (NestedConstraint nestedconstrain : arrayListNestedConstraints) {
+ try {
+ NestedConditionSimplifier simplifierNGC = new NestedConditionSimplifier(nestedconstrain);
+ boolean bc = simplifierNGC.simplify();
+ } catch (Exception e) {
+ System.err.println("The nestedconstrain " + nestedconstrain.getName() + " is not simplified well");
+ }
+ }
+ }
+
+ /**
+ *
+ * @param translator
+ * @param arrayListLaxConditions
+ * @return
+ */
+ private List<NestedConstraint> completeLaxConditions(OCL2LaxCondCommand translator,
+ List<Condition> arrayListLaxConditions) {
+ List<NestedConstraint> arrayListNestedConstraints = new ArrayList<NestedConstraint>();
+ List<String> conditionVarNames = null;
+ for (Condition condition : arrayListLaxConditions) {
+ try {
+ conditionVarNames = translator.mapCon2Var.get(condition);
+ Completer completer = new Completer(condition);
+ long timeNeeded = completer.complete();
+ NestedConstraint nestedConstraint = completer.getConstraint();
+ NestedCondition nestedCondition = nestedConstraint.getCondition();
+
+ if (conditionVarNames != null)
+ addVariables2Condition(nestedCondition, conditionVarNames);
+
+ arrayListNestedConstraints.add(nestedConstraint);
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not completed well");
+ }
+ }
+ return arrayListNestedConstraints;
+ }
+
+ /**
+ *
+ * @param arrayListLaxConditions
+ */
+ private void simplifyLaxConditions(List<Condition> arrayListLaxConditions) {
+ for (Condition condition : arrayListLaxConditions) {
+ try {
+ LaxConditionSimplifier simplifier = new LaxConditionSimplifier(condition);
+ simplifier.simplify();
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not simplified well");
+ }
+ }
+ }
+
+ /**
+ * Add variables to the completed nested condition
+ *
+ * @param nestedCondition
+ * @param conditionVarNames
+ */
+ private void addVariables2Condition(NestedCondition nestedCondition, List<String> conditionVarNames) {
+ for (String v : conditionVarNames) {
+ Variable conVar = NestedconditionFactory.eINSTANCE.createVariable();
+ conVar.setName(v);
+ if (!nestedCondition.getVariables().contains(conVar))
+ nestedCondition.getVariables().add(conVar);
+ }
+ }
+
+ /**
+ *
+ * @param date
+ * @param nestedConstraintModel
+ */
+ private void persistNestedConstraintsModel(Date date, NestedConstraintModel nestedConstraintModel) {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+ String path = oclasFile.getParent().getLocation().toOSString();// append(Constants.NESTED_CONSTRAINTS
+ // +
+ // sdf.format(date)).toOSString();
+ TranslatorResourceSet resourceSet = new TranslatorResourceSet(path);
+ resourceSet.saveEObject(nestedConstraintModel,
+ nestedConstraintModel.getName().concat("_" + sdf.format(date) + Constants.NESTED_CONSTRAINTS_MODEL));
+ try {
+ oclasFile.getParent().refreshLocal(IResource.DEPTH_ONE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ private boolean checkFiles() {
+ IFile file1 = files.get(0);
+ IFile file2 = files.get(1);
+ if (!(file1.getName().endsWith(ECORE) || file2.getName().endsWith(ECORE)))
+ return false;
+ if (!(file1.getName().endsWith(OCLAS) || file2.getName().endsWith(OCLAS)))
+ return false;
+ if (file1.getName().endsWith(ECORE)) {
+ ecoreFile = file1;
+ oclasFile = file2;
+ } else {
+ ecoreFile = file2;
+ oclasFile = file1;
+ }
+ return true;
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(IAction action, ISelection selection) {
+ files = new ArrayList<IFile>();
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ List<Object> objects = ss.toList();
+ for (Object o : objects) {
+ files.add((IFile) o);
+ }
+ }
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ shell = targetPart.getSite().getShell();
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/GC2AppCondCommand.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/GC2AppCondCommand.java
new file mode 100644
index 0000000..bc9af32
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/GC2AppCondCommand.java
@@ -0,0 +1,185 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.commands;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
+import org.eclipse.emf.henshin.model.And;
+import org.eclipse.emf.henshin.model.HenshinFactory;
+import org.eclipse.emf.henshin.model.Module;
+import org.eclipse.emf.henshin.model.Rule;
+
+import de.unimarburg.swt.ocl2ac.gc2ac.core.Integrator;
+import de.unimarburg.swt.ocl2ac.gc2ac.core.Lefter;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.TranslatorResourceSet;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+
+public class GC2AppCondCommand {
+
+ private static final String HENSHIN = ".henshin";
+ private IFile henshinFile = null;
+ private Rule rule = null;
+ private NestedConstraint constraint;
+ public long translationTime = 0;
+
+ public GC2AppCondCommand() {
+ }
+
+ public GC2AppCondCommand(IFile henshinFile) {
+ this.henshinFile = henshinFile;
+ }
+
+ public boolean enableOptimizer = false;
+
+ /*
+ * Start the integration
+ */
+ public void integrateAndleft(NestedConstraint constraint, Rule rule) {
+ if (rule != null) {
+ this.rule = rule;
+ this.constraint = constraint;
+
+ Module module = rule.getModule();
+ Copier copy = new Copier();
+
+ Rule ruleCopyOriginal = (Rule) copy.copy(rule);
+ copy.copyReferences();
+
+ String UpdatedRuleName = rule.getName() + "_updated_" + constraint.getName();
+ if (module.getUnit(UpdatedRuleName) != null) {
+ Date date = new GregorianCalendar().getTime();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+ UpdatedRuleName += sdf.format(date);
+ }
+
+ rule.setName(UpdatedRuleName);
+
+ long start = System.currentTimeMillis();
+
+ // Integrate, i.e., shifting->prepare->translate2formula
+ Integrator integrator = new Integrator(constraint, rule);
+ System.out.println(this.getClass().getName() + ":" + enableOptimizer);
+ integrator.setEnableOptimizer(enableOptimizer);
+ integrator.integrate();
+
+ NestedCondition condition = integrator.getShiftedCondition();
+ // manage the result of empty overlap pairs
+ if (condition == null) {
+ System.out.println("Return in The class name: " + this.getClass().getSimpleName() + "<-");
+ return;
+ }
+ System.out.println(condition);
+ System.out.println(condition.getDomain());
+
+ constraint.setDomain(condition.getDomain());
+ constraint.setCondition(condition);
+
+ org.eclipse.emf.henshin.model.Formula existingFormula = rule.getLhs().getFormula();
+ // left the RAC to LAC
+ Lefter lefter = new Lefter(rule);
+ lefter.enableOptimizer = enableOptimizer;
+ lefter.left();
+ enableOptimizer = false;
+ // add the original nac of the rule to the result
+ if (existingFormula != null) {
+ And henshinAnd = HenshinFactory.eINSTANCE.createAnd();
+ henshinAnd.setLeft(existingFormula);
+ henshinAnd.setRight(rule.getLhs().getFormula());
+ rule.getLhs().setFormula(henshinAnd);
+ }
+
+ long stop = System.currentTimeMillis();
+ translationTime = stop - start;
+ // Persist in Place
+ module.getUnits().add(ruleCopyOriginal);
+ persistTheUpdatedRuleInPlace(module);
+ }
+ }
+
+ /**
+ *
+ * @param graph
+ * @return
+ */
+ private EList<org.eclipse.emf.henshin.model.Edge> getEdgesTypedContainment(
+ org.eclipse.emf.henshin.model.Graph graph) {
+ EList<org.eclipse.emf.henshin.model.Edge> containmentEdges = new BasicEList<org.eclipse.emf.henshin.model.Edge>();
+
+ for (org.eclipse.emf.henshin.model.Edge edge : graph.getEdges()) {
+ if (edge.getType().isContainment())
+ containmentEdges.add(edge);
+ }
+ return containmentEdges;
+ }
+
+ /*
+ * Start the integration
+ */
+ public void integrateAndleftInPlace(NestedConstraint constraint, Rule rule) {
+ if (rule != null) {
+ this.rule = rule;
+ this.constraint = constraint;
+ long start = System.currentTimeMillis();
+
+ // Integrate, i.e., shifting->prepare->translate2formula
+ Integrator integrator = new Integrator(constraint, rule);
+ System.out.println(this.getClass().getName() + ":" + enableOptimizer);
+ integrator.setEnableOptimizer(enableOptimizer);
+ integrator.integrate();
+
+ NestedCondition condition = integrator.getShiftedCondition();
+ // manage the result of empty overlap pairs
+ if (condition == null) {
+ System.out.println("Return in The class name: " + this.getClass().getSimpleName() + "<-");
+ return;
+ }
+ System.out.println(condition);
+ System.out.println(condition.getDomain());
+
+ constraint.setDomain(condition.getDomain());
+ constraint.setCondition(condition);
+
+ org.eclipse.emf.henshin.model.Formula existingFormula = rule.getLhs().getFormula();
+
+ // left the RAC to LAC
+ Lefter lefter = new Lefter(rule);
+ lefter.enableOptimizer = enableOptimizer;
+ lefter.left();
+
+ // add the original nac of the rule to the result
+ if (existingFormula != null) {
+ And henshinAnd = HenshinFactory.eINSTANCE.createAnd();
+ henshinAnd.setLeft(existingFormula);
+ henshinAnd.setRight(rule.getLhs().getFormula());
+ rule.getLhs().setFormula(henshinAnd);
+ }
+
+ long stop = System.currentTimeMillis();
+ translationTime = stop - start;
+ }
+ }
+
+ private void persistTheUpdatedRuleInPlace(Module module) {
+ String path = henshinFile.getLocation().toOSString();
+ TranslatorResourceSet resourceSet = new TranslatorResourceSet(path);
+ resourceSet.saveEObject(module, path);
+ try {
+ henshinFile.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/LaxCond2AppCondCommand.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/LaxCond2AppCondCommand.java
new file mode 100644
index 0000000..21513c2
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/LaxCond2AppCondCommand.java
@@ -0,0 +1,114 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.commands;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
+import org.eclipse.emf.henshin.model.And;
+import org.eclipse.emf.henshin.model.HenshinFactory;
+import org.eclipse.emf.henshin.model.Module;
+import org.eclipse.emf.henshin.model.Rule;
+
+import de.unimarburg.swt.ocl2ac.gc2ac.core.Integrator;
+import de.unimarburg.swt.ocl2ac.gc2ac.core.Lefter;
+import de.unimarburg.swt.ocl2ac.ocl2gc.util.TranslatorResourceSet;
+import laxcondition.Condition;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+
+public class LaxCond2AppCondCommand {
+
+ private static final String HENSHIN = ".henshin";
+ private IFile henshinFile = null;
+ private Rule rule = null;
+ private Condition compactCondition;
+ public long translationTime = 0;
+
+ public LaxCond2AppCondCommand() {
+ }
+
+ public LaxCond2AppCondCommand(IFile henshinFile) {
+ this.henshinFile = henshinFile;
+ }
+
+ /*
+ * Start the integration
+ */
+ public void integrateAndleft(Condition compactCondition, Rule rule) {
+ if (rule != null) {
+ this.rule = rule;
+ this.compactCondition = compactCondition;
+
+ Module module = rule.getModule();
+ Copier copy = new Copier();
+
+ Rule ruleCopyOriginal = (Rule) copy.copy(rule);
+ copy.copyReferences();
+
+ String UpdatedRuleName = rule.getName() + "_updated_" + compactCondition.getName();
+ if (module.getUnit(UpdatedRuleName) != null) {
+ Date date = new GregorianCalendar().getTime();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+ UpdatedRuleName += sdf.format(date);
+ }
+
+ rule.setName(UpdatedRuleName);
+
+ long start = System.currentTimeMillis();
+
+ // Phase I: Compact condition to ngc
+ LaxCond2GCCommand compactCondition2NGC = new LaxCond2GCCommand();
+ NestedConstraint nestedConstraint = compactCondition2NGC.translate(compactCondition);
+
+ // Phase II: Integrate, i.e., shifting->prepare->translate2formula
+ Integrator integrator = new Integrator(nestedConstraint, rule);
+ integrator.integrate();
+
+ NestedCondition condition = integrator.getShiftedCondition();
+ nestedConstraint.setDomain(condition.getDomain());
+ nestedConstraint.setCondition(condition);
+
+ org.eclipse.emf.henshin.model.Formula existingFormula = rule.getLhs().getFormula();
+
+ // left the RAC to LAC
+ Lefter lefter = new Lefter(rule);
+ lefter.left();
+
+ // add the original nac of the rule to the result
+ if (existingFormula != null) {
+ And henshinAnd = HenshinFactory.eINSTANCE.createAnd();
+ henshinAnd.setLeft(existingFormula);
+ henshinAnd.setRight(rule.getLhs().getFormula());
+ rule.getLhs().setFormula(henshinAnd);
+ }
+
+ long stop = System.currentTimeMillis();
+ translationTime = stop - start;
+
+ // Persist in Place
+ module.getUnits().add(ruleCopyOriginal);
+ persistTheUpdatedRuleInPlace(module);
+ }
+ }
+
+ private void persistTheUpdatedRuleInPlace(Module module) {
+ String path = henshinFile.getLocation().toOSString();
+ TranslatorResourceSet resourceSet = new TranslatorResourceSet(path);
+ resourceSet.saveEObject(module, path);
+ try {
+ henshinFile.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/LaxCond2GCCommand.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/LaxCond2GCCommand.java
new file mode 100644
index 0000000..9c763b0
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/LaxCond2GCCommand.java
@@ -0,0 +1,175 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.commands;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.emf.henshin.interpreter.EGraph;
+import org.eclipse.emf.henshin.interpreter.Engine;
+import org.eclipse.emf.henshin.interpreter.Match;
+import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl;
+import org.eclipse.emf.henshin.interpreter.impl.EngineImpl;
+import org.eclipse.emf.henshin.interpreter.util.InterpreterUtil;
+import org.eclipse.emf.henshin.model.HenshinFactory;
+import org.eclipse.emf.henshin.model.HenshinPackage;
+import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.Node;
+import org.eclipse.emf.henshin.model.Parameter;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+
+import de.unimarburg.swt.ocl2ac.ocl2gc.core.Completer;
+import laxcondition.Condition;
+import laxcondition.LaxconditionPackage;
+import laxcondition.util.extensions.LaxConditionSimplifier;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+import nestedcondition.NestedconditionFactory;
+import nestedcondition.Variable;
+import nestedcondition.util.extensions.NestedConditionSimplifier;
+
+public class LaxCond2GCCommand {
+
+ private Shell shell;
+ HashMap<Condition, List<String>> mapCon2Var = null;
+
+ /**
+ * Constructor for TransformAction.
+ */
+ public LaxCond2GCCommand() {
+ super();
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public NestedConstraint translate(Condition compactCondition) {
+ mapCon2Var = new HashMap<Condition, List<String>>();
+ long start = System.currentTimeMillis();
+ // 0. Construct mapCon2Var
+ mapCon2Var.put(compactCondition, getDistinctVariableNames(compactCondition));
+ // 1. Simplify each lax condition
+ simplifyLaxCondition(compactCondition);
+ // 2. Complete each lax condition to NestedConstraints
+ NestedConstraint nestedGraphConstraint = completeLaxConditions(mapCon2Var, compactCondition);
+ // 3. Simplify each NestedConstraint
+ simplifyNestedConstraints(nestedGraphConstraint);
+ long stop = System.currentTimeMillis();
+ long translationTime = stop - start;
+ // System.out.println("[#" + translationTime + ")]");
+ return nestedGraphConstraint;
+ }
+
+ /**
+ *
+ * @param cond
+ * of LaxconditionPackage
+ * @return
+ */
+ private List<String> getDistinctVariableNames(Condition cond) {
+ List<String> varNames = new ArrayList<String>();
+ HenshinFactory factory = HenshinFactory.eINSTANCE;
+ Rule rule = factory.createRule();
+ Parameter param = factory.createParameter("p");
+ rule.getParameters().add(param);
+ Node sourceLHS = factory.createNode(rule.getLhs(), LaxconditionPackage.Literals.VARIABLE, "");
+ sourceLHS.setName(param.getName());
+ Node sourceRHS = factory.createNode(rule.getRhs(), LaxconditionPackage.Literals.VARIABLE, "");
+ sourceRHS.setName(param.getName());
+ Mapping sourceMapping = factory.createMapping(sourceLHS, sourceRHS);
+ rule.getMappings().add(sourceMapping);
+
+ HenshinPackage.eINSTANCE.eClass();
+ EGraph graph = new EGraphImpl(cond);
+ Engine engine = new EngineImpl();
+ List<Match> allMatches = InterpreterUtil.findAllMatches(engine, rule, graph, null);
+ for (Match m : allMatches) {
+ Object parameterValue = m.getParameterValue(param);
+ if (parameterValue instanceof laxcondition.Variable) {
+ laxcondition.Variable v = (laxcondition.Variable) parameterValue;
+ if (v.getName() != null) {
+ if (!varNames.contains(v.getName())) {
+ varNames.add(v.getName());
+ }
+ }
+ }
+ }
+
+ return varNames;
+ }
+
+ /**
+ *
+ * @param arrayListNestedConstraints
+ */
+ private void simplifyNestedConstraints(NestedConstraint nestedconstrain) {
+ try {
+ NestedConditionSimplifier simplifierNGC = new NestedConditionSimplifier(nestedconstrain);
+ boolean bc = simplifierNGC.simplify();
+ } catch (Exception e) {
+ System.err.println("The nestedconstrain " + nestedconstrain.getName() + " is not simplified well");
+ }
+ }
+
+ /**
+ *
+ * @param translator
+ * @param arrayListLaxConditions
+ * @return
+ */
+ private NestedConstraint completeLaxConditions(HashMap<Condition, List<String>> mapCon2Var, Condition condition) {
+ List<String> conditionVarNames = null;
+ NestedConstraint nestedConstraint = null;
+ try {
+ conditionVarNames = mapCon2Var.get(condition);
+ Completer completer = new Completer(condition);
+ long timeNeeded = completer.complete();
+ nestedConstraint = completer.getConstraint();
+ NestedCondition nestedCondition = nestedConstraint.getCondition();
+
+ if (conditionVarNames != null)
+ addVariables2Condition(nestedCondition, conditionVarNames);
+
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not completed well");
+ }
+
+ return nestedConstraint;
+ }
+
+ /**
+ *
+ * @param arrayListLaxConditions
+ */
+ private void simplifyLaxCondition(Condition condition) {
+ try {
+ LaxConditionSimplifier simplifier = new LaxConditionSimplifier(condition);
+ simplifier.simplify();
+ } catch (Exception e) {
+ System.err.println("The condition " + condition.getName() + " is not simplified well");
+ }
+ }
+
+ /**
+ * Add variables to the completed nested condition
+ *
+ * @param nestedCondition
+ * @param conditionVarNames
+ */
+ private void addVariables2Condition(NestedCondition nestedCondition, List<String> conditionVarNames) {
+ for (String v : conditionVarNames) {
+ Variable conVar = NestedconditionFactory.eINSTANCE.createVariable();
+ conVar.setName(v);
+ if (!nestedCondition.getVariables().contains(conVar))
+ nestedCondition.getVariables().add(conVar);
+ }
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/OCL2LaxCondCommand.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/OCL2LaxCondCommand.java
new file mode 100644
index 0000000..a5f76a1
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/commands/OCL2LaxCondCommand.java
@@ -0,0 +1,124 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.commands;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.ocl.pivot.Constraint;
+import org.eclipse.ocl.pivot.ExpressionInOCL;
+import org.eclipse.ocl.pivot.Model;
+import org.eclipse.ocl.pivot.PivotFactory;
+import org.eclipse.ocl.pivot.PivotPackage;
+
+import de.unimarburg.swt.ocl2ac.ocl2gc.core.Translator;
+import graph.GraphFactory;
+import laxcondition.Condition;
+import laxcondition.LaxCondition;
+import laxcondition.LaxconditionFactory;
+
+public class OCL2LaxCondCommand extends Translator {
+
+ public HashMap<Condition, List<String>> mapCon2Var;
+
+ public OCL2LaxCondCommand(IFile oclasFile, IFile ecoreFile) {
+ this.oclasFile = oclasFile;
+ this.ecoreFile = ecoreFile;
+ this.invariants = new BasicEList<Constraint>();
+ this.laxconditionFactory = LaxconditionFactory.eINSTANCE;
+ this.mapCon2Var = new HashMap<Condition, List<String>>();
+ this.graphFactory = GraphFactory.eINSTANCE;
+ this.oclFactory = PivotFactory.eINSTANCE;
+ this.varIndex = 1;
+ initModels();
+ prepareOCLModel();
+ refactorOCLModel();
+
+ }
+
+ /**
+ * supporting static ePackage for a given meta-model
+ */
+ protected void initModels() {
+ URI uriOclAS = URI.createPlatformResourceURI(this.oclasFile.getFullPath().toString(), true);
+ URI uriEcore = URI.createPlatformResourceURI(this.ecoreFile.getFullPath().toString(), true);
+ if (uriOclAS != null && uriEcore != null) {
+ // Load the input models and the corresponding invariants
+ PivotPackage.eINSTANCE.eClass();
+ Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
+ Map<String, Object> m = reg.getExtensionToFactoryMap();
+ m.put("*.oclas", new XMIResourceFactoryImpl());
+ ResourceSet resSet = new ResourceSetImpl();
+ Resource resourceOclAS = resSet.getResource(uriOclAS, true);
+ this.oclModel = (Model) resourceOclAS.getContents().get(0);
+ // Load Ecore for meta/type model references
+ Resource resourceEcore = resSet.getResource(uriEcore, true);
+ EPackage dynamicEPackage = (EPackage) resourceEcore.getContents().get(0);
+ this.setTypeModel(EPackage.Registry.INSTANCE.getEPackage(dynamicEPackage.getNsURI()));
+ if (this.getTypeModel() == null)
+ this.setTypeModel(dynamicEPackage);
+ System.out.println(getTypeModel());
+ }
+ }
+
+ /**
+ * The entry point
+ *
+ * @return
+ */
+ public List<Condition> getSetofLaxConditions() {
+ long start = System.currentTimeMillis();
+ Date date = new GregorianCalendar().getTime();
+ List<Condition> arrayList = new ArrayList<Condition>();
+ System.out.println("### The number of OCL Invariants is: " + invariants.size() + " ####");
+ for (Constraint inv : invariants) {
+ System.out.println("=====[ Invariant Name: " + inv.getName() + " ]=====");
+ if (inv.getOwnedSpecification() != null) {
+ ExpressionInOCL exprInOcl = null;
+ exprInOcl = (ExpressionInOCL) inv.getOwnedSpecification();
+ System.out.println("---[ Invariant Body: " + exprInOcl.getOwnedBody() + " ]---");
+
+ if (exprInOcl.getOwnedBody() != null) {
+ try {
+ Condition condition = laxconditionFactory.createCondition();
+ condition.setName(inv.getName());
+ condition.setTypeGraph(this.getTypeModel());
+ // The entry point
+ LaxCondition laxCondition = translate_I(inv);
+ if (laxCondition == null)
+ continue;
+ condition.setLaxCondition(laxCondition);
+ // get variables
+ this.mapCon2Var.put(condition, varNames);
+ varNames = new ArrayList<String>();
+ arrayList.add(condition);
+ } catch (Exception e) {
+ System.err.println("The OCL constraint " + inv.getName() + " is not well translated");
+
+ System.out.println(e.getMessage());
+ }
+ }
+ }
+ }
+
+ long stop = System.currentTimeMillis();
+ System.out.println((stop - start));
+ return arrayList;
+ }
+
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/optimizer/IntegrationChecker.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/optimizer/IntegrationChecker.java
new file mode 100644
index 0000000..edfbbdf
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/optimizer/IntegrationChecker.java
@@ -0,0 +1,349 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.optimizer;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.henshin.model.Action;
+import org.eclipse.emf.henshin.model.Attribute;
+import org.eclipse.emf.henshin.model.Edge;
+import org.eclipse.emf.henshin.model.Node;
+import org.eclipse.emf.henshin.model.Rule;
+
+import de.unimarburg.swt.ocl2ac.gc2ac.core.NestedConditionPreparer;
+import de.unimarburg.swt.ocl2ac.gc2ac.util.RuleClassifier;
+import laxcondition.Condition;
+import nestedcondition.NestedCondition;
+import nestedcondition.NestedConstraint;
+
+public class IntegrationChecker {
+
+ EList<EClass> graphsNodesTypes = new BasicEList<EClass>();
+ EList<EReference> graphsEdgesTypes = new BasicEList<EReference>();
+ EList<EAttribute> graphsAttributesTypes = new BasicEList<EAttribute>();
+
+ /**
+ * The official ones
+ *
+ * @param rule
+ * @param nestedConstraint
+ * @return
+ */
+ public boolean mustIntegrate(Rule rule, NestedConstraint nestedConstraint) {
+
+ if (isThereOverlap(rule, nestedConstraint)) {
+ System.out.println("There is an overlap.");
+ NestedConditionPreparer preparer = new NestedConditionPreparer(nestedConstraint);
+ preparer.eliminateForAllANotExistsC();
+ NestedCondition condition = preparer.getCondition();
+
+ RuleClassifier rc = new RuleClassifier(rule);
+
+ if (preparer.isOfFormExistsC(condition)) {
+ System.out.println("The constraint is of form Exists C.");
+ if (rc.doesRuleCreateOnly()) {
+ System.out.println("The rule creates only.");
+ System.out.println("There is an overlap but no need for the integration.");
+ return false;
+ }
+ }
+
+ if (preparer.isOfFormNotExistsC(condition)) {
+ System.out.println("The constraint is of form Not Exists C.");
+ if (rc.doesRuleDeleteOnly()) {
+ System.out.println("The rule deletes only.");
+ System.out.println("There is an overlap but no need for the integration.");
+ return false;
+ }
+ }
+
+ System.out.println("Go to the integration");
+ return true;
+ } else {
+ System.out.println("No overlap at all");
+ return false;
+ }
+ }
+
+ /**
+ *
+ * @param rule
+ * @param nestedConstraint
+ * @return
+ */
+ private boolean isThereOverlap(Rule rule, NestedConstraint nestedConstraint) {
+ EList<Node> createActionNodes = rule.getActionNodes(new Action(Action.Type.CREATE));
+ EList<Node> deleteActionNodes = rule.getActionNodes(new Action(Action.Type.DELETE));
+ EList<Node> ruleNodes = new BasicEList<Node>();
+ ruleNodes.addAll(createActionNodes);
+ ruleNodes.addAll(deleteActionNodes);
+ EList<EClass> ruleNodesTypes = new BasicEList<EClass>();
+ for (Node node : ruleNodes) {
+ if (!ruleNodesTypes.contains(node.getType()))
+ ruleNodesTypes.add(node.getType());
+ }
+
+ EList<Edge> createActionEdges = rule.getActionEdges(new Action(Action.Type.CREATE));
+ EList<Edge> deleteActionEdges = rule.getActionEdges(new Action(Action.Type.DELETE));
+ EList<Edge> ruleEdges = new BasicEList<Edge>();
+ ruleEdges.addAll(createActionEdges);
+ ruleEdges.addAll(deleteActionEdges);
+ EList<EReference> ruleEdgesTypes = new BasicEList<EReference>();
+ for (Edge edge : ruleEdges) {
+ if (!ruleEdgesTypes.contains(edge.getType()))
+ ruleEdgesTypes.add(edge.getType());
+ }
+
+ EList<Attribute> createActionAttribute = new BasicEList<Attribute>();
+ for (Node node : rule.getRhs().getNodes()) {
+ for (Attribute attr : node.getAttributes()) {
+ if (attr.getAction() != null) {
+ if (attr.getAction().getType() == Action.Type.CREATE)
+ createActionAttribute.add(attr);
+ }
+ }
+ }
+
+ EList<Attribute> deleteActionAttribute = new BasicEList<Attribute>();
+ for (Node node : rule.getLhs().getNodes()) {
+ for (Attribute attr : node.getAttributes()) {
+ if (attr.getAction().getType() == Action.Type.DELETE)
+ deleteActionAttribute.add(attr);
+ }
+ }
+
+ EList<Attribute> ruleAttributes = new BasicEList<Attribute>();
+ ruleAttributes.addAll(createActionAttribute);
+ ruleAttributes.addAll(deleteActionAttribute);
+
+ EList<EAttribute> ruleAttributeTypes = new BasicEList<EAttribute>();
+ for (Attribute attr : ruleAttributes) {
+ if (!ruleAttributeTypes.contains(attr.getType()))
+ ruleAttributeTypes.add(attr.getType());
+ }
+
+ fillNodesTypesAndEdgesTypes(nestedConstraint);
+
+ if (areClanDisjoint(ruleNodesTypes, graphsNodesTypes) && areEdgeDisjoint(ruleEdgesTypes, graphsEdgesTypes)
+ && areAttibuteDisjoint(ruleAttributeTypes, graphsAttributesTypes))
+ return false;
+ else
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param rule
+ * @param condition
+ * @return
+ */
+ public boolean mustIntegrateWithoutAttribute(Rule rule, Condition condition) {
+
+ EList<Node> createActionNodes = rule.getActionNodes(new Action(Action.Type.CREATE));
+ EList<Node> deleteActionNodes = rule.getActionNodes(new Action(Action.Type.DELETE));
+ EList<Node> ruleNodes = new BasicEList<Node>();
+ ruleNodes.addAll(createActionNodes);
+ ruleNodes.addAll(deleteActionNodes);
+ EList<EClass> ruleNodesTypes = new BasicEList<EClass>();
+ for (Node node : ruleNodes) {
+ if (!ruleNodesTypes.contains(node.getType()))
+ ruleNodesTypes.add(node.getType());
+ }
+
+ EList<Edge> createActionEdges = rule.getActionEdges(new Action(Action.Type.CREATE));
+ EList<Edge> deleteActionEdges = rule.getActionEdges(new Action(Action.Type.DELETE));
+ EList<Edge> ruleEdges = new BasicEList<Edge>();
+ ruleEdges.addAll(createActionEdges);
+ ruleEdges.addAll(deleteActionEdges);
+ EList<EReference> ruleEdgesTypes = new BasicEList<EReference>();
+ for (Edge edge : ruleEdges) {
+ if (!ruleEdgesTypes.contains(edge.getType()))
+ ruleEdgesTypes.add(edge.getType());
+ }
+
+ fillNodesTypesAndEdgesTypes(condition);
+
+ if (areClanDisjoint(ruleNodesTypes, graphsNodesTypes) && areEdgeDisjoint(ruleEdgesTypes, graphsEdgesTypes))
+ return false;
+ else
+ return true;
+ }
+
+ /**
+ *
+ * @param nestedConstraint
+ */
+ private void fillNodesTypesAndEdgesTypes(NestedConstraint nestedConstraint) {
+ graphsNodesTypes.clear();
+ graphsEdgesTypes.clear();
+ TreeIterator<EObject> iter = nestedConstraint.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (eObject instanceof graph.Node) {
+ graph.Node node = (graph.Node) eObject;
+ if (!graphsNodesTypes.contains(node.getType()))
+ graphsNodesTypes.add(node.getType());
+ }
+
+ if (eObject instanceof graph.Edge) {
+ graph.Edge edge = (graph.Edge) eObject;
+ if (!graphsEdgesTypes.contains(edge.getType()))
+ graphsEdgesTypes.add(edge.getType());
+ }
+
+ if (eObject instanceof graph.Attribute) {
+ graph.Attribute attribute = (graph.Attribute) eObject;
+ if (!graphsAttributesTypes.contains(attribute.getType()))
+ graphsAttributesTypes.add(attribute.getType());
+
+ }
+ }
+
+ }
+
+ /**
+ *
+ * @param condition
+ */
+ private void fillNodesTypesAndEdgesTypes(Condition condition) {
+ graphsNodesTypes.clear();
+ graphsEdgesTypes.clear();
+ TreeIterator<EObject> iter = condition.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (eObject instanceof graph.Node) {
+ graph.Node node = (graph.Node) eObject;
+ if (!graphsNodesTypes.contains(node.getType()))
+ graphsNodesTypes.add(node.getType());
+ }
+
+ if (eObject instanceof graph.Edge) {
+ graph.Edge edge = (graph.Edge) eObject;
+ if (!graphsEdgesTypes.contains(edge.getType()))
+ graphsEdgesTypes.add(edge.getType());
+ }
+
+ if (eObject instanceof graph.Attribute) {
+ graph.Attribute attribute = (graph.Attribute) eObject;
+ if (!graphsAttributesTypes.contains(attribute.getType()))
+ graphsAttributesTypes.add(attribute.getType());
+
+ }
+ }
+
+ }
+
+ /**
+ *
+ *
+ * @param typesList1
+ * @param typesList2
+ * @return
+ */
+ private boolean areClanDisjoint(EList<EClass> typesList1, EList<EClass> typesList2) {
+ for (EClass type1 : typesList1) {
+ EList<EClass> clan1 = getClan(type1);
+ for (EClass type2 : typesList2) {
+ if (clan1.contains(type2)) {
+ return false;
+ }
+ }
+ }
+ for (EClass type2 : typesList2) {
+ EList<EClass> clan2 = getClan(type2);
+ for (EClass type1 : typesList1) {
+ if (clan2.contains(type1)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ *
+ * @param typesList1
+ * @param typesList2
+ * @return
+ */
+ private boolean areEdgeDisjoint(EList<EReference> typesList1, EList<EReference> typesList2) {
+ if (typesList1.size() <= typesList2.size()) {
+ for (EReference type1 : typesList1) {
+ if (typesList2.contains(type1))
+ return false;
+ }
+ } else {
+ for (EReference type2 : typesList2) {
+ if (typesList1.contains(type2))
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ *
+ * @param typesList1
+ * @param typesList2
+ * @return
+ */
+ private boolean areAttibuteDisjoint(EList<EAttribute> typesList1, EList<EAttribute> typesList2) {
+ if (typesList1.size() <= typesList2.size()) {
+ for (EAttribute type1 : typesList1) {
+ if (typesList2.contains(type1))
+ return false;
+ }
+ } else {
+ for (EAttribute type2 : typesList2) {
+ if (typesList1.contains(type2))
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ *
+ * @param eClass
+ * @return
+ */
+ private EList<EClass> getClan(EClass eClass) {
+ EList<EClass> eClasses = new BasicEList<EClass>();
+ eClasses.add(eClass);
+ eClasses.addAll(getAllSubclasses(eClass));
+ return eClasses;
+ }
+
+ /**
+ *
+ * @param eClass
+ * @return
+ */
+ private EList<EClass> getAllSubclasses(EClass eClass) {
+ EList<EClass> eClasses = new BasicEList<EClass>();
+ EPackage ePackage = eClass.getEPackage();
+ TreeIterator<EObject> iter = ePackage.eAllContents();
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (eObject instanceof EClass) {
+ EClass clazz = (EClass) eObject;
+ if (clazz.getEAllSuperTypes().contains(eClass)) {
+ eClasses.add(clazz);
+ }
+ }
+ }
+ return eClasses;
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/SWTResourceManager.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/SWTResourceManager.java
new file mode 100644
index 0000000..3daa583
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/SWTResourceManager.java
@@ -0,0 +1,485 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Google, Inc.
+ * 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:
+ * Google, Inc. - initial API and implementation
+ *******************************************************************************/
+package de.unimarburg.swt.ocl2ac.tool.ui;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Utility class for managing OS resources associated with SWT controls such as
+ * colors, fonts, images, etc.
+ * <p>
+ * !!! IMPORTANT !!! Application code must explicitly invoke the
+ * <code>dispose()</code> method to release the operating system resources
+ * managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ * <p>
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ *
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Color
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>();
+
+ /**
+ * Returns the system {@link Color} matching the specific ID.
+ *
+ * @param systemColorID
+ * the ID value for the color
+ * @return the system {@link Color} matching the specific ID
+ */
+ public static Color getColor(int systemColorID) {
+ Display display = Display.getCurrent();
+ return display.getSystemColor(systemColorID);
+ }
+
+ /**
+ * Returns a {@link Color} given its red, green and blue component values.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return the {@link Color} matching the given red, green and blue
+ * component values
+ */
+ public static Color getColor(int r, int g, int b) {
+ return getColor(new RGB(r, g, b));
+ }
+
+ /**
+ * Returns a {@link Color} given its RGB value.
+ *
+ * @param rgb
+ * the {@link RGB} value of the color
+ * @return the {@link Color} matching the RGB value
+ */
+ public static Color getColor(RGB rgb) {
+ Color color = m_colorMap.get(rgb);
+ if (color == null) {
+ Display display = Display.getCurrent();
+ color = new Color(display, rgb);
+ m_colorMap.put(rgb, color);
+ }
+ return color;
+ }
+
+ /**
+ * Dispose of all the cached {@link Color}'s.
+ */
+ public static void disposeColors() {
+ for (Color color : m_colorMap.values()) {
+ color.dispose();
+ }
+ m_colorMap.clear();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps image paths to images.
+ */
+ private static Map<String, Image> m_imageMap = new HashMap<String, Image>();
+
+ /**
+ * Returns an {@link Image} encoded by the specified {@link InputStream}.
+ *
+ * @param stream
+ * the {@link InputStream} encoding the image data
+ * @return the {@link Image} encoded by the specified input stream
+ */
+ protected static Image getImage(InputStream stream) throws IOException {
+ try {
+ Display display = Display.getCurrent();
+ ImageData data = new ImageData(stream);
+ if (data.transparentPixel > 0) {
+ return new Image(display, data, data.getTransparencyMask());
+ }
+ return new Image(display, data);
+ } finally {
+ stream.close();
+ }
+ }
+
+ /**
+ * Returns an {@link Image} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(String path) {
+ Image image = m_imageMap.get(path);
+ if (image == null) {
+ try {
+ image = getImage(new FileInputStream(path));
+ m_imageMap.put(path, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(path, image);
+ }
+ }
+ return image;
+ }
+
+ /**
+ * Returns an {@link Image} stored in the file at the specified path
+ * relative to the specified class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image
+ * @param path
+ * the path to the image file, if starts with <code>'/'</code>
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(Class<?> clazz, String path) {
+ String key = clazz.getName() + '|' + path;
+ Image image = m_imageMap.get(key);
+ if (image == null) {
+ try {
+ image = getImage(clazz.getResourceAsStream(path));
+ m_imageMap.put(key, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(key, image);
+ }
+ }
+ return image;
+ }
+
+ private static final int MISSING_IMAGE_SIZE = 10;
+
+ /**
+ * @return the small {@link Image} that can be used as placeholder for
+ * missing image.
+ */
+ private static Image getMissingImage() {
+ Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ //
+ GC gc = new GC(image);
+ gc.setBackground(getColor(SWT.COLOR_RED));
+ gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ gc.dispose();
+ //
+ return image;
+ }
+
+ /**
+ * Style constant for placing decorator image in top left corner of base
+ * image.
+ */
+ public static final int TOP_LEFT = 1;
+ /**
+ * Style constant for placing decorator image in top right corner of base
+ * image.
+ */
+ public static final int TOP_RIGHT = 2;
+ /**
+ * Style constant for placing decorator image in bottom left corner of base
+ * image.
+ */
+ public static final int BOTTOM_LEFT = 3;
+ /**
+ * Style constant for placing decorator image in bottom right corner of base
+ * image.
+ */
+ public static final int BOTTOM_RIGHT = 4;
+ /**
+ * Internal value.
+ */
+ protected static final int LAST_CORNER_KEY = 5;
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another
+ * image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @return {@link Image} The resulting decorated image
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another
+ * image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @param corner
+ * the corner to place decorator image
+ * @return the resulting decorated {@link Image}
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ Rectangle bib = baseImage.getBounds();
+ Rectangle dib = decorator.getBounds();
+ //
+ result = new Image(Display.getCurrent(), bib.width, bib.height);
+ //
+ GC gc = new GC(result);
+ gc.drawImage(baseImage, 0, 0);
+ if (corner == TOP_LEFT) {
+ gc.drawImage(decorator, 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ gc.drawImage(decorator, 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
+ }
+ gc.dispose();
+ //
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+
+ /**
+ * Dispose all of the cached {@link Image}'s.
+ */
+ public static void disposeImages() {
+ // dispose loaded images
+ {
+ for (Image image : m_imageMap.values()) {
+ image.dispose();
+ }
+ m_imageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Font
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps font names to fonts.
+ */
+ private static Map<String, Font> m_fontMap = new HashMap<String, Font>();
+ /**
+ * Maps fonts to their bold versions.
+ */
+ private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>();
+
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ *
+ * @param name
+ * the name of the font
+ * @param height
+ * the height of the font
+ * @param style
+ * the style of the font
+ * @return {@link Font} The font matching the name, height and style
+ */
+ public static Font getFont(String name, int height, int style) {
+ return getFont(name, height, style, false, false);
+ }
+
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ * Windows-specific strikeout and underline flags are also supported.
+ *
+ * @param name
+ * the name of the font
+ * @param size
+ * the size of the font
+ * @param style
+ * the style of the font
+ * @param strikeout
+ * the strikeout flag (warning: Windows only)
+ * @param underline
+ * the underline flag (warning: Windows only)
+ * @return {@link Font} The font matching the name, height, style, strikeout
+ * and underline
+ */
+ public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
+ String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
+ Font font = m_fontMap.get(fontName);
+ if (font == null) {
+ FontData fontData = new FontData(name, size, style);
+ if (strikeout || underline) {
+ try {
+ Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
+ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
+ if (logFont != null && logFontClass != null) {
+ if (strikeout) {
+ logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ if (underline) {
+ logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ }
+ } catch (Throwable e) {
+ System.err.println(
+ "Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ font = new Font(Display.getCurrent(), fontData);
+ m_fontMap.put(fontName, font);
+ }
+ return font;
+ }
+
+ /**
+ * Returns a bold version of the given {@link Font}.
+ *
+ * @param baseFont
+ * the {@link Font} for which a bold version is desired
+ * @return the bold version of the given {@link Font}
+ */
+ public static Font getBoldFont(Font baseFont) {
+ Font font = m_fontToBoldFontMap.get(baseFont);
+ if (font == null) {
+ FontData fontDatas[] = baseFont.getFontData();
+ FontData data = fontDatas[0];
+ font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
+ m_fontToBoldFontMap.put(baseFont, font);
+ }
+ return font;
+ }
+
+ /**
+ * Dispose all of the cached {@link Font}'s.
+ */
+ public static void disposeFonts() {
+ // clear fonts
+ for (Font font : m_fontMap.values()) {
+ font.dispose();
+ }
+ m_fontMap.clear();
+ // clear bold fonts
+ for (Font font : m_fontToBoldFontMap.values()) {
+ font.dispose();
+ }
+ m_fontToBoldFontMap.clear();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Cursor
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps IDs to cursors.
+ */
+ private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>();
+
+ /**
+ * Returns the system cursor matching the specific ID.
+ *
+ * @param id
+ * int The ID value for the cursor
+ * @return Cursor The system cursor matching the specific ID
+ */
+ public static Cursor getCursor(int id) {
+ Integer key = Integer.valueOf(id);
+ Cursor cursor = m_idToCursorMap.get(key);
+ if (cursor == null) {
+ cursor = new Cursor(Display.getDefault(), id);
+ m_idToCursorMap.put(key, cursor);
+ }
+ return cursor;
+ }
+
+ /**
+ * Dispose all of the cached cursors.
+ */
+ public static void disposeCursors() {
+ for (Cursor cursor : m_idToCursorMap.values()) {
+ cursor.dispose();
+ }
+ m_idToCursorMap.clear();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should
+ * only be called when the cached objects are no longer needed (e.g. on
+ * application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeImages();
+ disposeFonts();
+ disposeCursors();
+ }
+}
\ No newline at end of file
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/WizardGC2AppCond.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/WizardGC2AppCond.java
new file mode 100644
index 0000000..2306369
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/WizardGC2AppCond.java
@@ -0,0 +1,423 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.ui;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.NestedCondition;
+import org.eclipse.emf.henshin.model.Node;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.RowData;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.PlatformUI;
+
+import de.unimarburg.swt.ocl2ac.tool.commands.GC2AppCondCommand;
+import de.unimarburg.swt.ocl2ac.tool.optimizer.IntegrationChecker;
+import nestedcondition.NestedConstraint;
+
+public class WizardGC2AppCond extends Shell {
+ private static final String HENSHIN = ".henshin";
+ private Table tableNestedConstraints;
+ private Table tableRules;
+ private NestedConstraint selectedNestedConstraint = null;
+ private Rule selectedRule = null;
+ private IFile henshinFile = null;
+ private IFile constraintFile = null;
+ private final String ALPHA_NUMERIC_STRING = "abcdefghijklmnopqrstuvwxyz0123456789";
+
+ /**
+ * Create the shell.
+ *
+ * @param display
+ * @param mapAllRules
+ */
+ public WizardGC2AppCond(final Display display, IFile henshinFile,
+ HashMap<Integer, NestedConstraint> hashmapAllNestedconstraints, HashMap<Integer, Rule> hashmapAllRules,
+ IFile constraintFile) {
+ super(display, SWT.SHELL_TRIM);
+ this.henshinFile = henshinFile;
+ this.constraintFile = constraintFile;
+ setLayout(new RowLayout(SWT.HORIZONTAL));
+ Group groupNGCs = new Group(this, SWT.NONE);
+ groupNGCs.setLayout(new RowLayout(SWT.HORIZONTAL));
+ groupNGCs.setLayoutData(new RowData(489, 240));
+ groupNGCs.setText("Nested Graph Constraints");
+
+ Label lblngc = new Label(groupNGCs, SWT.NONE);
+ lblngc.setText("Please select a nested graph constraint");
+
+ tableNestedConstraints = new Table(groupNGCs, SWT.BORDER | SWT.FULL_SELECTION);
+ tableNestedConstraints.setLayoutData(new RowData(452, 180));
+ tableNestedConstraints.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+ tableNestedConstraints.setHeaderVisible(true);
+ tableNestedConstraints.setLinesVisible(true);
+
+ TableColumn clnID_NC = new TableColumn(tableNestedConstraints, SWT.NONE);
+ clnID_NC.setWidth(46);
+ clnID_NC.setText("ID");
+
+ TableColumn clnName_NC = new TableColumn(tableNestedConstraints, SWT.NONE);
+ clnName_NC.setWidth(431);
+ clnName_NC.setText("Nested Graph Constraint (C)");
+
+ fillTableNestedConstraints(hashmapAllNestedconstraints);
+
+ tableNestedConstraints.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (tableNestedConstraints.getItemCount() > 0) {
+ TableItem[] selectedItem = tableNestedConstraints.getSelection();
+ Integer nestedConstraintID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedNestedConstraint = hashmapAllNestedconstraints.get(nestedConstraintID);
+ }
+
+ }
+ });
+
+ Group groupRules = new Group(this, SWT.NONE);
+ groupRules.setLayoutData(new RowData(490, 240));
+ groupRules.setText("Rules");
+ groupRules.setLayout(new RowLayout(SWT.HORIZONTAL));
+
+ Label lblRule = new Label(groupRules, SWT.NONE);
+ lblRule.setText("Please select a rule");
+
+ tableRules = new Table(groupRules, SWT.BORDER | SWT.FULL_SELECTION);
+ tableRules.setLayoutData(new RowData(452, 180));
+ tableRules.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+
+ });
+ tableRules.setHeaderVisible(true);
+ tableRules.setLinesVisible(true);
+
+ TableColumn clnID_rule = new TableColumn(tableRules, SWT.NONE);
+ clnID_rule.setWidth(48);
+ clnID_rule.setText("ID");
+
+ TableColumn clnName_Rule = new TableColumn(tableRules, SWT.NONE);
+ clnName_Rule.setWidth(429);
+ clnName_Rule.setText("Rule (R)");
+ fillTableRules(hashmapAllRules);
+ Group groupButtons = new Group(this, SWT.NONE);
+ groupButtons.setLayoutData(new RowData(490, 120));
+
+ tableRules.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (tableRules.getItemCount() > 0) {
+ TableItem[] selectedItem = tableRules.getSelection();
+ Integer ruleID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedRule = (Rule) hashmapAllRules.get(ruleID);
+ }
+
+ }
+ });
+ groupButtons.setLayout(new RowLayout(SWT.HORIZONTAL));
+
+ // integrate
+ Button btnIntegrate = new Button(groupButtons, SWT.NONE);
+ btnIntegrate.setLayoutData(new RowData(SWT.DEFAULT, 35));
+ btnIntegrate.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ // Integrate and Lefting
+ if (selectedNestedConstraint != null && selectedRule != null) {
+ System.out.println(selectedNestedConstraint + " " + selectedRule);
+ GC2AppCondCommand ial = new GC2AppCondCommand(henshinFile);
+ setNamesToRuleNodes(selectedRule);
+ ial.enableOptimizer = false;
+
+ ial.integrateAndleft(selectedNestedConstraint, selectedRule);
+ long translationTime = ial.translationTime;
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Integration", "Integration is finished. The integration time is: ("
+ + (translationTime / (double) 1000) + ") second(s).");
+ close();
+
+ }
+ }
+ });
+ btnIntegrate.setText("Integrate");
+
+ // integrate all
+ Button btnIntegrateAllConstraints = new Button(groupButtons, SWT.NONE);
+ btnIntegrateAllConstraints.setLayoutData(new RowData(SWT.DEFAULT, 35));
+ btnIntegrateAllConstraints.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (selectedRule != null) {
+ long translationTime = 0;
+ setNamesToRuleNodes(selectedRule);
+
+ if (hashmapAllNestedconstraints != null) {
+ Iterator<Integer> keySetIterator = hashmapAllNestedconstraints.keySet().iterator();
+ while (keySetIterator.hasNext()) {
+ Integer key = keySetIterator.next();
+ NestedConstraint nestedConstraint = hashmapAllNestedconstraints.get(key);
+ GC2AppCondCommand ial = new GC2AppCondCommand(henshinFile);
+ ial.enableOptimizer = false;
+ ial.integrateAndleftInPlace(nestedConstraint, selectedRule);
+ translationTime += ial.translationTime;
+ }
+ }
+
+ try {
+ selectedRule.getModule().eResource().save(null);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ System.err.println("Error on persisting the rule");
+ }
+
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Integration", "Integration is finished. The integration time is: ("
+ + (translationTime / (double) 1000) + ") second(s).");
+ close();
+ }
+ }
+ });
+ btnIntegrateAllConstraints.setText("Integrate all constraints \r\ninto a rule");
+
+ // Check-for-Integration
+ Button btnCheckforintegration = new Button(groupButtons, SWT.NONE);
+ btnCheckforintegration.setLayoutData(new RowData(SWT.DEFAULT, 35));
+ btnCheckforintegration.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+
+ if (selectedNestedConstraint != null && selectedRule != null) {
+ IntegrationChecker op = new IntegrationChecker();
+ boolean mustIntegrate = op.mustIntegrate(selectedRule, selectedNestedConstraint);
+
+ if (mustIntegrate) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Info (required)", "The constraint SHOULD be integrated into the rule.");
+ boolean yes = MessageDialog.openQuestion(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Question",
+ "Do you want to continue integrating it?");
+ if (yes) {
+
+ // call the optimizer
+ System.out.println("The constraint " + selectedNestedConstraint.getName()
+ + " should be integrated into rule " + selectedRule.getName());
+ GC2AppCondCommand ial = new GC2AppCondCommand(henshinFile);
+ setNamesToRuleNodes(selectedRule);
+ System.out.println(this.getClass().getName() + " enables " + ial.getClass().getName());
+ ial.enableOptimizer = true;
+
+ ial.integrateAndleft(selectedNestedConstraint, selectedRule);
+ long translationTime = ial.translationTime;
+ MessageDialog.openInformation(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Integration",
+ "Integration is finished. The integration time is: ("
+ + (translationTime / (double) 1000) + ") second(s).");
+ close();
+ }
+
+ } else {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Info (not required)",
+ "There is NO need to integrate the selected constraint into the selected rule.");
+ close();
+
+ }
+ }
+ }
+ });
+ btnCheckforintegration.setText("Construct Optimized Validity-Preserving AC (C, R)");
+
+ // optimize all
+ Button btnIntegrateAllRequired = new Button(groupButtons, SWT.NONE);
+ btnIntegrateAllRequired.setLayoutData(new RowData(SWT.DEFAULT, 35));
+ btnIntegrateAllRequired.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+
+ if (selectedRule != null) {
+ String infoRequiredConstraint = "";
+ int numberOfIntegrated = 0;
+ long translationTime = 0;
+ setNamesToRuleNodes(selectedRule);
+
+ if (hashmapAllNestedconstraints != null) {
+ Iterator<Integer> keySetIterator = hashmapAllNestedconstraints.keySet().iterator();
+ while (keySetIterator.hasNext()) {
+ Integer key = keySetIterator.next();
+ NestedConstraint nestedConstraint = hashmapAllNestedconstraints.get(key);
+
+ IntegrationChecker op = new IntegrationChecker();
+ boolean mustIntegrate = op.mustIntegrate(selectedRule, nestedConstraint);
+ if (mustIntegrate) {
+
+ infoRequiredConstraint += nestedConstraint.getName() + System.lineSeparator();
+
+ System.out.println("(" + nestedConstraint.getName()
+ + ") constraint is required for the rule (" + selectedRule.getName() + ")");
+
+ // call the optimizer
+ System.out.println("The constraint " + selectedNestedConstraint.getName()
+ + " should be integrated into rule " + selectedRule.getName());
+ GC2AppCondCommand ial = new GC2AppCondCommand(henshinFile);
+ setNamesToRuleNodes(selectedRule);
+ System.out.println(this.getClass().getName() + " enables " + ial.getClass().getName());
+ ial.enableOptimizer = true;
+ ial.integrateAndleftInPlace(nestedConstraint, selectedRule);
+ translationTime += ial.translationTime;
+ numberOfIntegrated++;
+ }
+ }
+ }
+
+ try {
+ selectedRule.getModule().eResource().save(null);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ System.err.println("Error on persisting the rule");
+ }
+
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Integration",
+ "Integration is finished. The integration time is: (" + (translationTime / (double) 1000)
+ + ") second(s)." + System.lineSeparator() + System.lineSeparator()
+ + "Number of the required constraints are (" + numberOfIntegrated + "):"
+ + System.lineSeparator() + infoRequiredConstraint);
+
+ close();
+ }
+
+ }
+ });
+ btnIntegrateAllRequired.setText("Construct Optimized Validity-Preserving AC (All Cs, R)");
+
+ createContents();
+
+ tableNestedConstraints.notifyListeners(SWT.Selection, new Event());
+ tableRules.notifyListeners(SWT.Selection, new Event());
+ }
+
+ /**
+ * Create contents of the shell.
+ */
+ protected void createContents() {
+ setText("Integrator Wizard");
+ setSize(511, 728);
+
+ }
+
+ private void fillTableNestedConstraints(HashMap<Integer, NestedConstraint> hashmapAllNestedconstraints) {
+ if (hashmapAllNestedconstraints != null) {
+ tableNestedConstraints.removeAll();
+ Iterator<Integer> keySetIterator = hashmapAllNestedconstraints.keySet().iterator();
+ while (keySetIterator.hasNext()) {
+ Integer key = keySetIterator.next();
+ TableItem item = new TableItem(tableNestedConstraints, SWT.NONE);
+ item.setText(0, key.toString());
+ item.setText(1, hashmapAllNestedconstraints.get(key).getName());
+ }
+ tableNestedConstraints.select(0);
+ TableItem[] selectedItem = tableNestedConstraints.getSelection();
+ Integer ruleID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedNestedConstraint = hashmapAllNestedconstraints.get(ruleID);
+ }
+
+ }
+
+ private void fillTableRules(HashMap<Integer, Rule> hashmapAllRules) {
+ if (hashmapAllRules != null) {
+ tableRules.removeAll();
+ Iterator<Integer> keySetIterator = hashmapAllRules.keySet().iterator();
+ while (keySetIterator.hasNext()) {
+ Integer key = keySetIterator.next();
+ TableItem item = new TableItem(tableRules, SWT.NONE);
+ item.setText(0, key.toString());
+ item.setText(1, ((Rule) hashmapAllRules.get(key)).getName());
+ }
+ tableRules.select(0);
+ TableItem[] selectedItem = tableRules.getSelection();
+ Integer ruleID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedRule = (Rule) hashmapAllRules.get(ruleID);
+ }
+
+ }
+
+ private void setNamesToRuleNodes(Rule rule) {
+ // Nodes in LHS and RHS should have same names
+ for (Mapping m : rule.getMappings()) {
+ if (m.getImage() != null && m.getOrigin() != null) {
+ if (m.getImage().getName() == null && m.getOrigin().getName() == null) {
+ String nodeName = "rp" + randomAlphaNumeric(3);
+ m.getOrigin().setName(nodeName);
+ m.getImage().setName(nodeName);
+ }
+
+ }
+ }
+
+ // Nodes in NC should have same names
+ for (NestedCondition nc : rule.getLhs().getNestedConditions()) {
+ for (Mapping ncM : nc.getMappings()) {
+ if (ncM.getImage() != null && ncM.getOrigin() != null) {
+ if (ncM.getImage().getName() == null && ncM.getOrigin().getName() == null) {
+ String nodeName = "rf" + randomAlphaNumeric(3);
+ ncM.getOrigin().setName(nodeName);
+ ncM.getImage().setName(nodeName);
+ }
+ }
+ }
+ }
+
+ for (Node node : rule.getLhs().getNodes()) {
+ if (node.getName() == null)
+ node.setName("rd" + randomAlphaNumeric(3));
+ }
+
+ for (Node node : rule.getRhs().getNodes()) {
+ if (node.getName() == null)
+ node.setName("rc" + randomAlphaNumeric(3));
+ }
+ }
+
+ private String randomAlphaNumeric(int count) {
+ StringBuilder builder = new StringBuilder();
+ while (count-- != 0) {
+ int character = (int) (Math.random() * ALPHA_NUMERIC_STRING.length());
+ builder.append(ALPHA_NUMERIC_STRING.charAt(character));
+ }
+ return builder.toString();
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/WizardLaxCond2AppCond.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/WizardLaxCond2AppCond.java
new file mode 100644
index 0000000..2084a71
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/de/unimarburg/swt/ocl2ac/tool/ui/WizardLaxCond2AppCond.java
@@ -0,0 +1,350 @@
+/**
+ * <copyright>
+ * OCL2AC is developed by Nebras Nassar based on an initial version developed by Thorsten Arendt and Jan Steffen Becker.
+ * </copyright>
+ */
+package de.unimarburg.swt.ocl2ac.tool.ui;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.NestedCondition;
+import org.eclipse.emf.henshin.model.Node;
+import org.eclipse.emf.henshin.model.Rule;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowData;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.PlatformUI;
+
+import de.unimarburg.swt.ocl2ac.tool.commands.LaxCond2AppCondCommand;
+import de.unimarburg.swt.ocl2ac.tool.optimizer.IntegrationChecker;
+import laxcondition.Condition;
+
+public class WizardLaxCond2AppCond extends Shell {
+ private static final String HENSHIN = ".henshin";
+ private Table tableCompactConditions;
+ private Table tableRules;
+ private Condition selectedCompactCondition = null;
+ private Rule selectedRule = null;
+ private IFile henshinFile = null;
+ private IFile compactConditionModelFile = null;
+ private final String ALPHA_NUMERIC_STRING = "abcdefghijklmnopqrstuvwxyz0123456789";
+
+ /**
+ * Create the shell.
+ *
+ * @param display
+ * @param mapAllRules
+ */
+ public WizardLaxCond2AppCond(final Display display, IFile henshinFile,
+ HashMap<Integer, Condition> hashmapAllLaxCondition, HashMap<Integer, Rule> hashmapAllRules,
+ IFile compactConditionModelFile) {
+ super(display, SWT.SHELL_TRIM);
+ setLayout(new RowLayout(SWT.VERTICAL));
+ this.henshinFile = henshinFile;
+ this.compactConditionModelFile = compactConditionModelFile;
+ Group grpRepairActions = new Group(this, SWT.NONE);
+ grpRepairActions.setLayout(new GridLayout(1, false));
+ grpRepairActions.setLayoutData(new RowData(487, 248));
+ grpRepairActions.setText("Compact Graph Constraints");
+
+ Group groupRATop = new Group(grpRepairActions, SWT.NONE);
+ GridData gd_groupRATop = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_groupRATop.heightHint = 23;
+ gd_groupRATop.widthHint = 471;
+ groupRATop.setLayoutData(gd_groupRATop);
+
+ Label lblNewLabel_1 = new Label(groupRATop, SWT.NONE);
+ lblNewLabel_1.setBounds(10, 16, 283, 20);
+ lblNewLabel_1.setText("Please select a compact graph constraint");
+
+ tableCompactConditions = new Table(grpRepairActions, SWT.BORDER | SWT.FULL_SELECTION);
+ tableCompactConditions.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
+ GridData gd_tableAction = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
+ gd_tableAction.heightHint = 180;
+ tableCompactConditions.setLayoutData(gd_tableAction);
+ tableCompactConditions.setHeaderVisible(true);
+ tableCompactConditions.setLinesVisible(true);
+
+ TableColumn clnID_NC = new TableColumn(tableCompactConditions, SWT.NONE);
+ clnID_NC.setWidth(46);
+ clnID_NC.setText("ID");
+
+ TableColumn clnName_NC = new TableColumn(tableCompactConditions, SWT.NONE);
+ clnName_NC.setWidth(425);
+ clnName_NC.setText("Compact Graph Constraint");
+
+ fillTableCompactConditions(hashmapAllLaxCondition);
+
+ tableCompactConditions.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (tableCompactConditions.getItemCount() > 0) {
+ TableItem[] selectedItem = tableCompactConditions.getSelection();
+ Integer nestedConstraintID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedCompactCondition = hashmapAllLaxCondition.get(nestedConstraintID);
+ }
+
+ }
+ });
+
+ Group grpTargets = new Group(this, SWT.NONE);
+ grpTargets.setLayout(new GridLayout(1, false));
+ grpTargets.setLayoutData(new RowData(487, 239));
+ grpTargets.setText("Rules");
+
+ Group groupTargtTop = new Group(grpTargets, SWT.NONE);
+ GridData gd_groupTargtTop = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_groupTargtTop.heightHint = 36;
+ gd_groupTargtTop.widthHint = 477;
+ groupTargtTop.setLayoutData(gd_groupTargtTop);
+
+ Label lblPleaseSelectA = new Label(groupTargtTop, SWT.NONE);
+ lblPleaseSelectA.setBounds(10, 24, 213, 25);
+ lblPleaseSelectA.setText("Please select a rule");
+
+ tableRules = new Table(grpTargets, SWT.BORDER | SWT.FULL_SELECTION);
+ tableRules.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+
+ });
+
+ GridData gd_tableTargets = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
+ gd_tableTargets.heightHint = 187;
+ tableRules.setLayoutData(gd_tableTargets);
+ tableRules.setHeaderVisible(true);
+ tableRules.setLinesVisible(true);
+
+ TableColumn clnID_rule = new TableColumn(tableRules, SWT.NONE);
+ clnID_rule.setWidth(48);
+ clnID_rule.setText("ID");
+
+ TableColumn clnName_Rule = new TableColumn(tableRules, SWT.NONE);
+ clnName_Rule.setWidth(429);
+ clnName_Rule.setText("Rule");
+ fillTableRules(hashmapAllRules);
+ Group groupFooter = new Group(this, SWT.NONE);
+ groupFooter.setLayoutData(new RowData(488, 59));
+
+ tableRules.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (tableRules.getItemCount() > 0) {
+ TableItem[] selectedItem = tableRules.getSelection();
+ Integer ruleID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedRule = (Rule) hashmapAllRules.get(ruleID);
+ }
+
+ }
+ });
+
+ Button btnIntegrate = new Button(groupFooter, SWT.NONE);
+ btnIntegrate.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ // Integrate and Lefting
+ if (selectedCompactCondition != null && selectedRule != null) {
+
+ System.out.println(selectedCompactCondition + " " + selectedRule);
+
+ LaxCond2AppCondCommand ilcc2ac = new LaxCond2AppCondCommand(henshinFile);
+ setNamesToRuleNodes(selectedRule);
+ ilcc2ac.integrateAndleft(selectedCompactCondition, selectedRule);
+
+ long translationTime = ilcc2ac.translationTime;
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Integration", "Integration is finished. The integration time is: ("
+ + (translationTime / (double) 1000) + ") second(s).");
+ close();
+
+ }
+ }
+ });
+ btnIntegrate.setBounds(10, 24, 114, 34);
+ btnIntegrate.setText("Integrate");
+
+ Button btnCheckforintegration = new Button(groupFooter, SWT.NONE);
+ btnCheckforintegration.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+
+ if (selectedCompactCondition != null && selectedRule != null) {
+
+ IntegrationChecker op = new IntegrationChecker();
+ boolean mustIntegrate = op.mustIntegrateWithoutAttribute(selectedRule, selectedCompactCondition);
+ if (mustIntegrate) {
+
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Info (required)", "The constraint SHOULD be integrated into the rule.");
+
+ boolean yes = MessageDialog.openQuestion(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Question",
+ "Do you want to integrate it now?");
+ if (yes) {
+ System.out.println(selectedCompactCondition + " " + selectedRule);
+ LaxCond2AppCondCommand ilcc2ac = new LaxCond2AppCondCommand(henshinFile);
+ setNamesToRuleNodes(selectedRule);
+ ilcc2ac.integrateAndleft(selectedCompactCondition, selectedRule);
+ long translationTime = ilcc2ac.translationTime;
+ MessageDialog.openInformation(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Integration",
+ "Integration is finished. The integration time is: ("
+ + (translationTime / (double) 1000) + ") second(s).");
+ close();
+ }
+
+ } else {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Info (not required)",
+ "There is NO need to integrate the selected constraint into the selected rule since the rule application will not violate the constraint.");
+
+ boolean yes = MessageDialog.openQuestion(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Question",
+ "Do you want to integrate it anyway?");
+ if (yes) {
+ System.out.println(selectedCompactCondition + " " + selectedRule);
+ LaxCond2AppCondCommand ilcc2ac = new LaxCond2AppCondCommand(henshinFile);
+ setNamesToRuleNodes(selectedRule);
+ ilcc2ac.integrateAndleft(selectedCompactCondition, selectedRule);
+ long translationTime = ilcc2ac.translationTime;
+ MessageDialog.openInformation(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Integration",
+ "Integration is finished. The integration time is: ("
+ + (translationTime / (double) 1000) + ") second(s).");
+ close();
+ }
+ }
+ }
+
+ }
+ });
+ btnCheckforintegration.setBounds(142, 24, 155, 34);
+ btnCheckforintegration.setText("Check-for-Integration");
+
+ createContents();
+
+ tableCompactConditions.notifyListeners(SWT.Selection, new Event());
+ tableRules.notifyListeners(SWT.Selection, new Event());
+ }
+
+ /**
+ * Create contents of the shell.
+ */
+ protected void createContents() {
+ setText("Integrator Wizard (Shift + Left)");
+ setSize(520, 689);
+
+ }
+
+ private void fillTableCompactConditions(HashMap<Integer, Condition> hashmapAllCompactConditions) {
+ if (hashmapAllCompactConditions != null) {
+ tableCompactConditions.removeAll();
+ Iterator<Integer> keySetIterator = hashmapAllCompactConditions.keySet().iterator();
+ while (keySetIterator.hasNext()) {
+ Integer key = keySetIterator.next();
+ TableItem item = new TableItem(tableCompactConditions, SWT.NONE);
+ item.setText(0, key.toString());
+ item.setText(1, hashmapAllCompactConditions.get(key).getName());
+ }
+ tableCompactConditions.select(0);
+ TableItem[] selectedItem = tableCompactConditions.getSelection();
+ Integer ruleID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedCompactCondition = hashmapAllCompactConditions.get(ruleID);
+ }
+
+ }
+
+ private void fillTableRules(HashMap<Integer, Rule> hashmapAllRules) {
+ if (hashmapAllRules != null) {
+ tableRules.removeAll();
+ Iterator<Integer> keySetIterator = hashmapAllRules.keySet().iterator();
+ while (keySetIterator.hasNext()) {
+ Integer key = keySetIterator.next();
+ TableItem item = new TableItem(tableRules, SWT.NONE);
+ item.setText(0, key.toString());
+ item.setText(1, ((Rule) hashmapAllRules.get(key)).getName());
+ }
+ tableRules.select(0);
+ TableItem[] selectedItem = tableRules.getSelection();
+ Integer ruleID = Integer.parseInt(selectedItem[0].getText(0));
+ selectedRule = (Rule) hashmapAllRules.get(ruleID);
+ }
+
+ }
+
+ private void setNamesToRuleNodes(Rule rule) {
+ // Nodes in LHS and RHS should have same names
+ for (Mapping m : rule.getMappings()) {
+ if (m.getImage() != null && m.getOrigin() != null) {
+ if (m.getImage().getName() == null && m.getOrigin().getName() == null) {
+ String nodeName = "rp" + randomAlphaNumeric(3);
+ m.getOrigin().setName(nodeName);
+ m.getImage().setName(nodeName);
+ }
+
+ }
+ }
+
+ // Nodes in NC should have same names
+ for (NestedCondition nc : rule.getLhs().getNestedConditions()) {
+ for (Mapping ncM : nc.getMappings()) {
+ if (ncM.getImage() != null && ncM.getOrigin() != null) {
+ if (ncM.getImage().getName() == null && ncM.getOrigin().getName() == null) {
+ String nodeName = "rf" + randomAlphaNumeric(3);
+ ncM.getOrigin().setName(nodeName);
+ ncM.getImage().setName(nodeName);
+ }
+ }
+ }
+ }
+
+ for (Node node : rule.getLhs().getNodes()) {
+ if (node.getName() == null)
+ node.setName("rd" + randomAlphaNumeric(3));
+ }
+
+ for (Node node : rule.getRhs().getNodes()) {
+ if (node.getName() == null)
+ node.setName("rc" + randomAlphaNumeric(3));
+ }
+ }
+
+ private String randomAlphaNumeric(int count) {
+ StringBuilder builder = new StringBuilder();
+ while (count-- != 0) {
+ int character = (int) (Math.random() * ALPHA_NUMERIC_STRING.length());
+ builder.append(ALPHA_NUMERIC_STRING.charAt(character));
+ }
+ return builder.toString();
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+}
diff --git a/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/org/eclipse/wb/swt/SWTResourceManager.java b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/org/eclipse/wb/swt/SWTResourceManager.java
new file mode 100644
index 0000000..ad42c1e
--- /dev/null
+++ b/plugins/ocl2ac/de.unimarburg.swt.ocl2ac.tool/src/org/eclipse/wb/swt/SWTResourceManager.java
@@ -0,0 +1,485 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Google, Inc.
+ * 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:
+ * Google, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wb.swt;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Utility class for managing OS resources associated with SWT controls such as
+ * colors, fonts, images, etc.
+ * <p>
+ * !!! IMPORTANT !!! Application code must explicitly invoke the
+ * <code>dispose()</code> method to release the operating system resources
+ * managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ * <p>
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ *
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Color
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>();
+
+ /**
+ * Returns the system {@link Color} matching the specific ID.
+ *
+ * @param systemColorID
+ * the ID value for the color
+ * @return the system {@link Color} matching the specific ID
+ */
+ public static Color getColor(int systemColorID) {
+ Display display = Display.getCurrent();
+ return display.getSystemColor(systemColorID);
+ }
+
+ /**
+ * Returns a {@link Color} given its red, green and blue component values.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return the {@link Color} matching the given red, green and blue
+ * component values
+ */
+ public static Color getColor(int r, int g, int b) {
+ return getColor(new RGB(r, g, b));
+ }
+
+ /**
+ * Returns a {@link Color} given its RGB value.
+ *
+ * @param rgb
+ * the {@link RGB} value of the color
+ * @return the {@link Color} matching the RGB value
+ */
+ public static Color getColor(RGB rgb) {
+ Color color = m_colorMap.get(rgb);
+ if (color == null) {
+ Display display = Display.getCurrent();
+ color = new Color(display, rgb);
+ m_colorMap.put(rgb, color);
+ }
+ return color;
+ }
+
+ /**
+ * Dispose of all the cached {@link Color}'s.
+ */
+ public static void disposeColors() {
+ for (Color color : m_colorMap.values()) {
+ color.dispose();
+ }
+ m_colorMap.clear();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps image paths to images.
+ */
+ private static Map<String, Image> m_imageMap = new HashMap<String, Image>();
+
+ /**
+ * Returns an {@link Image} encoded by the specified {@link InputStream}.
+ *
+ * @param stream
+ * the {@link InputStream} encoding the image data
+ * @return the {@link Image} encoded by the specified input stream
+ */
+ protected static Image getImage(InputStream stream) throws IOException {
+ try {
+ Display display = Display.getCurrent();
+ ImageData data = new ImageData(stream);
+ if (data.transparentPixel > 0) {
+ return new Image(display, data, data.getTransparencyMask());
+ }
+ return new Image(display, data);
+ } finally {
+ stream.close();
+ }
+ }
+
+ /**
+ * Returns an {@link Image} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(String path) {
+ Image image = m_imageMap.get(path);
+ if (image == null) {
+ try {
+ image = getImage(new FileInputStream(path));
+ m_imageMap.put(path, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(path, image);
+ }
+ }
+ return image;
+ }
+
+ /**
+ * Returns an {@link Image} stored in the file at the specified path
+ * relative to the specified class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image
+ * @param path
+ * the path to the image file, if starts with <code>'/'</code>
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(Class<?> clazz, String path) {
+ String key = clazz.getName() + '|' + path;
+ Image image = m_imageMap.get(key);
+ if (image == null) {
+ try {
+ image = getImage(clazz.getResourceAsStream(path));
+ m_imageMap.put(key, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(key, image);
+ }
+ }
+ return image;
+ }
+
+ private static final int MISSING_IMAGE_SIZE = 10;
+
+ /**
+ * @return the small {@link Image} that can be used as placeholder for
+ * missing image.
+ */
+ private static Image getMissingImage() {
+ Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ //
+ GC gc = new GC(image);
+ gc.setBackground(getColor(SWT.COLOR_RED));
+ gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ gc.dispose();
+ //
+ return image;
+ }
+
+ /**
+ * Style constant for placing decorator image in top left corner of base
+ * image.
+ */
+ public static final int TOP_LEFT = 1;
+ /**
+ * Style constant for placing decorator image in top right corner of base
+ * image.
+ */
+ public static final int TOP_RIGHT = 2;
+ /**
+ * Style constant for placing decorator image in bottom left corner of base
+ * image.
+ */
+ public static final int BOTTOM_LEFT = 3;
+ /**
+ * Style constant for placing decorator image in bottom right corner of base
+ * image.
+ */
+ public static final int BOTTOM_RIGHT = 4;
+ /**
+ * Internal value.
+ */
+ protected static final int LAST_CORNER_KEY = 5;
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another
+ * image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @return {@link Image} The resulting decorated image
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another
+ * image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @param corner
+ * the corner to place decorator image
+ * @return the resulting decorated {@link Image}
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ Rectangle bib = baseImage.getBounds();
+ Rectangle dib = decorator.getBounds();
+ //
+ result = new Image(Display.getCurrent(), bib.width, bib.height);
+ //
+ GC gc = new GC(result);
+ gc.drawImage(baseImage, 0, 0);
+ if (corner == TOP_LEFT) {
+ gc.drawImage(decorator, 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ gc.drawImage(decorator, 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
+ }
+ gc.dispose();
+ //
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+
+ /**
+ * Dispose all of the cached {@link Image}'s.
+ */
+ public static void disposeImages() {
+ // dispose loaded images
+ {
+ for (Image image : m_imageMap.values()) {
+ image.dispose();
+ }
+ m_imageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Font
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps font names to fonts.
+ */
+ private static Map<String, Font> m_fontMap = new HashMap<String, Font>();
+ /**
+ * Maps fonts to their bold versions.
+ */
+ private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>();
+
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ *
+ * @param name
+ * the name of the font
+ * @param height
+ * the height of the font
+ * @param style
+ * the style of the font
+ * @return {@link Font} The font matching the name, height and style
+ */
+ public static Font getFont(String name, int height, int style) {
+ return getFont(name, height, style, false, false);
+ }
+
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ * Windows-specific strikeout and underline flags are also supported.
+ *
+ * @param name
+ * the name of the font
+ * @param size
+ * the size of the font
+ * @param style
+ * the style of the font
+ * @param strikeout
+ * the strikeout flag (warning: Windows only)
+ * @param underline
+ * the underline flag (warning: Windows only)
+ * @return {@link Font} The font matching the name, height, style, strikeout
+ * and underline
+ */
+ public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
+ String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
+ Font font = m_fontMap.get(fontName);
+ if (font == null) {
+ FontData fontData = new FontData(name, size, style);
+ if (strikeout || underline) {
+ try {
+ Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
+ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
+ if (logFont != null && logFontClass != null) {
+ if (strikeout) {
+ logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ if (underline) {
+ logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ }
+ } catch (Throwable e) {
+ System.err.println(
+ "Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ font = new Font(Display.getCurrent(), fontData);
+ m_fontMap.put(fontName, font);
+ }
+ return font;
+ }
+
+ /**
+ * Returns a bold version of the given {@link Font}.
+ *
+ * @param baseFont
+ * the {@link Font} for which a bold version is desired
+ * @return the bold version of the given {@link Font}
+ */
+ public static Font getBoldFont(Font baseFont) {
+ Font font = m_fontToBoldFontMap.get(baseFont);
+ if (font == null) {
+ FontData fontDatas[] = baseFont.getFontData();
+ FontData data = fontDatas[0];
+ font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
+ m_fontToBoldFontMap.put(baseFont, font);
+ }
+ return font;
+ }
+
+ /**
+ * Dispose all of the cached {@link Font}'s.
+ */
+ public static void disposeFonts() {
+ // clear fonts
+ for (Font font : m_fontMap.values()) {
+ font.dispose();
+ }
+ m_fontMap.clear();
+ // clear bold fonts
+ for (Font font : m_fontToBoldFontMap.values()) {
+ font.dispose();
+ }
+ m_fontToBoldFontMap.clear();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Cursor
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps IDs to cursors.
+ */
+ private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>();
+
+ /**
+ * Returns the system cursor matching the specific ID.
+ *
+ * @param id
+ * int The ID value for the cursor
+ * @return Cursor The system cursor matching the specific ID
+ */
+ public static Cursor getCursor(int id) {
+ Integer key = Integer.valueOf(id);
+ Cursor cursor = m_idToCursorMap.get(key);
+ if (cursor == null) {
+ cursor = new Cursor(Display.getDefault(), id);
+ m_idToCursorMap.put(key, cursor);
+ }
+ return cursor;
+ }
+
+ /**
+ * Dispose all of the cached cursors.
+ */
+ public static void disposeCursors() {
+ for (Cursor cursor : m_idToCursorMap.values()) {
+ cursor.dispose();
+ }
+ m_idToCursorMap.clear();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should
+ * only be called when the cached objects are no longer needed (e.g. on
+ * application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeImages();
+ disposeFonts();
+ disposeCursors();
+ }
+}
\ No newline at end of file
diff --git a/plugins/ocl2ac/info.txt b/plugins/ocl2ac/info.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/ocl2ac/info.txt