mirror of
https://github.com/Echtzeitsysteme/BioPMFramework.git
synced 2024-06-03 10:32:02 +00:00
added Wizard and fixed some small issues
This commit is contained in:
parent
2540a7835b
commit
f8abb1c9ba
|
@ -6,6 +6,9 @@
|
|||
<semanticResources>platform:/resource/de.tu.darmstadt.es.KappaStructure/model/kappaStructure.ecore</semanticResources>
|
||||
<semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources>
|
||||
<semanticResources>platform:/resource/de.tu.darmstadt.es.KappaStructure/model/kappaStructure.genmodel</semanticResources>
|
||||
<semanticResources>platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign</semanticResources>
|
||||
<semanticResources>environment:/viewpoint</semanticResources>
|
||||
<semanticResources>http://www.eclipse.org/emf/2002/GenModel</semanticResources>
|
||||
<ownedViews xmi:type="viewpoint:DView" xmi:id="_J7q9YNm_Eee2dajx7reE_g">
|
||||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
|
||||
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" xmi:id="_KApkANm_Eee2dajx7reE_g" name="KappaRules" repPath="#_KAl5oNm_Eee2dajx7reE_g">
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
<eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="#//Node"
|
||||
eOpposite="#//Node/incommingEdges"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="from" eType="#//Node" eOpposite="#//Node/outgoingEdges"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="reference" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Mapping">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="rule" lowerBound="1" eType="#//KappaRule"
|
||||
|
|
|
@ -25,6 +25,8 @@ import de.tu.darmstadt.es.KappaRules.Target;
|
|||
import de.tu.darmstadt.es.KappaRules.exceptions.KappaRuleValidationException;
|
||||
import de.tu.darmstadt.es.kappaStructure.Agent;
|
||||
import de.tu.darmstadt.es.kappaStructure.InternalState;
|
||||
import de.tu.darmstadt.es.kappaStructure.KappaElement;
|
||||
import de.tu.darmstadt.es.kappaStructure.NamedElement;
|
||||
import de.tu.darmstadt.es.kappaStructure.Site;
|
||||
|
||||
public class KappaRuleValidator {
|
||||
|
@ -189,7 +191,8 @@ public class KappaRuleValidator {
|
|||
}
|
||||
|
||||
private String nodeToName(Node node) {
|
||||
return node.getElement().getName();
|
||||
KappaElement element = node.getElement();
|
||||
return element instanceof NamedElement? NamedElement.class.cast(node.getElement()).getName():"";
|
||||
}
|
||||
|
||||
private void setPersistent(ModifiableElement srcElement, ModifiableElement trgElement, KappaRule rule) {
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<styles xmi:type="notation:FilteringStyle" xmi:id="_1sS3E9aqEeerr8EOGfW8XA"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ShapeStyle" xmi:id="_1sSQAdaqEeerr8EOGfW8XA" fontName="Cantarell" fontHeight="8"/>
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_1sSQAtaqEeerr8EOGfW8XA" x="675" y="35" width="120" height="100"/>
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_1sSQAtaqEeerr8EOGfW8XA" x="660" y="245" width="120" height="100"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_qsVEINnMEee06JQu5hzWmA" type="2003" element="_qsCwQNnMEee06JQu5hzWmA">
|
||||
<children xmi:type="notation:Node" xmi:id="_qsWSQNnMEee06JQu5hzWmA" type="5007"/>
|
||||
|
@ -92,7 +92,7 @@
|
|||
<styles xmi:type="notation:FilteringStyle" xmi:id="_qsW5UtnMEee06JQu5hzWmA"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ShapeStyle" xmi:id="_qsVEIdnMEee06JQu5hzWmA" fontName="Cantarell" fontHeight="8"/>
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_qsVEItnMEee06JQu5hzWmA" x="675" y="210" width="120" height="100"/>
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_qsVEItnMEee06JQu5hzWmA" x="660" y="30" width="120" height="100"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:DiagramStyle" xmi:id="_ui6EctaoEeerr8EOGfW8XA"/>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_G_cr0NapEeerr8EOGfW8XA" type="4001" element="_G_KX8NapEeerr8EOGfW8XA" source="_-Lj0UNaoEeerr8EOGfW8XA" target="_DG5s8NapEeerr8EOGfW8XA">
|
||||
|
@ -159,68 +159,85 @@
|
|||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_pJF_ytarEeerr8EOGfW8XA" id="(1.0,0.35714285714285715)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_pJF_y9arEeerr8EOGfW8XA" id="(1.0,0.5)"/>
|
||||
</edges>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_uVYOcNnMEee06JQu5hzWmA" type="4001" element="_QeE3gNarEeerr8EOGfW8XA" source="_6FwnINapEeerr8EOGfW8XA" target="_qsVEINnMEee06JQu5hzWmA">
|
||||
<children xmi:type="notation:Node" xmi:id="_uVY1gNnMEee06JQu5hzWmA" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_uVY1gdnMEee06JQu5hzWmA" x="-408" y="-2"/>
|
||||
<edges xmi:type="notation:Edge" xmi:id="__7QwcOTXEeehW-R3ypiS5Q" type="4001" element="_CvvfQNarEeerr8EOGfW8XA" source="_-Lj0UNaoEeerr8EOGfW8XA" target="_1sSQANaqEeerr8EOGfW8XA">
|
||||
<children xmi:type="notation:Node" xmi:id="__7W3EOTXEeehW-R3ypiS5Q" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="__7W3EeTXEeehW-R3ypiS5Q" y="-10"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_uVY1gtnMEee06JQu5hzWmA" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_uVY1g9nMEee06JQu5hzWmA" x="-40" y="13"/>
|
||||
<children xmi:type="notation:Node" xmi:id="__7XeIOTXEeehW-R3ypiS5Q" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="__7XeIeTXEeehW-R3ypiS5Q" y="10"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_uVY1hNnMEee06JQu5hzWmA" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_uVY1hdnMEee06JQu5hzWmA" x="-26" y="-187"/>
|
||||
<children xmi:type="notation:Node" xmi:id="__7YsQOTXEeehW-R3ypiS5Q" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="__7YsQeTXEeehW-R3ypiS5Q" y="10"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_uVYOcdnMEee06JQu5hzWmA" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_uVYOctnMEee06JQu5hzWmA" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_uVYOc9nMEee06JQu5hzWmA" points="[0, 0, -286, 270]$[0, -35, -286, 235]$[305, -35, 19, 235]$[305, -257, 19, 13]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_uVZckNnMEee06JQu5hzWmA" id="(0.8050847457627118,0.0)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_1d8zoNnMEee06JQu5hzWmA" id="(0.7333333333333333,0.87)"/>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="__7QwceTXEeehW-R3ypiS5Q" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="__7QwcuTXEeehW-R3ypiS5Q" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="__7Qwc-TXEeehW-R3ypiS5Q" points="[0, 82, -269, 239]$[0, 114, -269, 271]$[225, 114, -44, 271]$[225, -108, -44, 49]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="__7bvkOTXEeehW-R3ypiS5Q" id="(0.725,0.17)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="__7bvkeTXEeehW-R3ypiS5Q" id="(0.5,0.5)"/>
|
||||
</edges>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_wFtjoNnMEee06JQu5hzWmA" type="4001" element="_Pby7INarEeerr8EOGfW8XA" source="_qvwGcNapEeerr8EOGfW8XA" target="_qsVEINnMEee06JQu5hzWmA">
|
||||
<children xmi:type="notation:Node" xmi:id="_wFtjpNnMEee06JQu5hzWmA" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_wFtjpdnMEee06JQu5hzWmA" x="-65" y="-10"/>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_B9Uu0OTYEeehW-R3ypiS5Q" type="4001" element="_Pby7INarEeerr8EOGfW8XA" source="_qvwGcNapEeerr8EOGfW8XA" target="_1sSQANaqEeerr8EOGfW8XA">
|
||||
<children xmi:type="notation:Node" xmi:id="_B9VV4OTYEeehW-R3ypiS5Q" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_B9VV4eTYEeehW-R3ypiS5Q" x="-197" y="-2"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_wFtjptnMEee06JQu5hzWmA" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_wFtjp9nMEee06JQu5hzWmA" x="-18" y="17"/>
|
||||
<children xmi:type="notation:Node" xmi:id="_B9VV4uTYEeehW-R3ypiS5Q" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_B9VV4-TYEeehW-R3ypiS5Q" x="3" y="22"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_wFuKsNnMEee06JQu5hzWmA" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_wFuKsdnMEee06JQu5hzWmA" x="-19" y="-59"/>
|
||||
<children xmi:type="notation:Node" xmi:id="_B9VV5OTYEeehW-R3ypiS5Q" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_B9VV5eTYEeehW-R3ypiS5Q" x="-49" y="-47"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_wFtjodnMEee06JQu5hzWmA" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_wFtjotnMEee06JQu5hzWmA" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wFtjo9nMEee06JQu5hzWmA" points="[0, -16, -241, 109]$[0, -46, -241, 79]$[291, -46, 50, 79]$[291, -113, 50, 12]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_wFuKstnMEee06JQu5hzWmA" id="(0.675,0.17)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_wFuKs9nMEee06JQu5hzWmA" id="(0.21666666666666667,0.8799999999999999)"/>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_B9Uu0eTYEeehW-R3ypiS5Q" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_B9Uu0uTYEeehW-R3ypiS5Q" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_B9Uu0-TYEeehW-R3ypiS5Q" points="[0, -16, -240, 86]$[0, -51, -240, 51]$[216, -51, -24, 51]$[216, -78, -24, 24]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_B9VV5uTYEeehW-R3ypiS5Q" id="(0.675,0.17)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_B9VV5-TYEeehW-R3ypiS5Q" id="(0.3333333333333333,0.76)"/>
|
||||
</edges>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_xj28oNnMEee06JQu5hzWmA" type="4001" element="_CvvfQNarEeerr8EOGfW8XA" source="_-Lj0UNaoEeerr8EOGfW8XA" target="_qsVEINnMEee06JQu5hzWmA">
|
||||
<children xmi:type="notation:Node" xmi:id="_xj3jstnMEee06JQu5hzWmA" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_xj3js9nMEee06JQu5hzWmA" x="32" y="-10"/>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_CdfcoOTYEeehW-R3ypiS5Q" type="4001" element="_QeE3gNarEeerr8EOGfW8XA" source="_6FwnINapEeerr8EOGfW8XA" target="_1sSQANaqEeerr8EOGfW8XA">
|
||||
<children xmi:type="notation:Node" xmi:id="_CdgDsOTYEeehW-R3ypiS5Q" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_CdgDseTYEeehW-R3ypiS5Q" x="-246"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_xj3jtNnMEee06JQu5hzWmA" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_xj3jtdnMEee06JQu5hzWmA" x="-9" y="4"/>
|
||||
<children xmi:type="notation:Node" xmi:id="_CdgDsuTYEeehW-R3ypiS5Q" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_CdgDs-TYEeehW-R3ypiS5Q" x="-47" y="5"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_xj3jttnMEee06JQu5hzWmA" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_xj3jt9nMEee06JQu5hzWmA" x="37" y="23"/>
|
||||
<children xmi:type="notation:Node" xmi:id="_CdgDtOTYEeehW-R3ypiS5Q" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_CdgDteTYEeehW-R3ypiS5Q" x="-135" y="-122"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_xj28odnMEee06JQu5hzWmA" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_xj3jsNnMEee06JQu5hzWmA" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_xj3jsdnMEee06JQu5hzWmA" points="[0, 82, -303, 35]$[0, 114, -303, 67]$[225, 114, -78, 67]$[225, 67, -78, 20]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_xj3juNnMEee06JQu5hzWmA" id="(0.725,0.17)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_zDFTsNnMEee06JQu5hzWmA" id="(0.7916666666666666,0.8)"/>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_CdfcoeTYEeehW-R3ypiS5Q" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_CdfcouTYEeehW-R3ypiS5Q" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Cdfco-TYEeehW-R3ypiS5Q" points="[0, 0, -203, 276]$[0, -20, -203, 256]$[290, -20, 87, 256]$[290, -222, 87, 54]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_CdgDtuTYEeehW-R3ypiS5Q" id="(0.8050847457627118,0.0)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_CdgDt-TYEeehW-R3ypiS5Q" id="(0.15833333333333333,0.45)"/>
|
||||
</edges>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_7CqZYNnMEee06JQu5hzWmA" type="4001" element="_7CgoYNnMEee06JQu5hzWmA" source="_qsVEINnMEee06JQu5hzWmA" target="_1sSQANaqEeerr8EOGfW8XA">
|
||||
<children xmi:type="notation:Node" xmi:id="_7CqZZNnMEee06JQu5hzWmA" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_7CqZZdnMEee06JQu5hzWmA" x="12" y="-10"/>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_PBnrkOTYEeehW-R3ypiS5Q" type="4001" element="_PBcFYOTYEeehW-R3ypiS5Q" source="_1sSQANaqEeerr8EOGfW8XA" target="_qsVEINnMEee06JQu5hzWmA">
|
||||
<children xmi:type="notation:Node" xmi:id="_PBoSoOTYEeehW-R3ypiS5Q" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_PBoSoeTYEeehW-R3ypiS5Q" x="1" y="-10"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_7CqZZtnMEee06JQu5hzWmA" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_7CqZZ9nMEee06JQu5hzWmA" x="20" y="11"/>
|
||||
<children xmi:type="notation:Node" xmi:id="_PBoSouTYEeehW-R3ypiS5Q" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_PBoSo-TYEeehW-R3ypiS5Q" x="6" y="10"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_7CqZaNnMEee06JQu5hzWmA" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_7CqZadnMEee06JQu5hzWmA" x="-32" y="10"/>
|
||||
<children xmi:type="notation:Node" xmi:id="_PBoSpOTYEeehW-R3ypiS5Q" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_PBoSpeTYEeehW-R3ypiS5Q" x="-6" y="10"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_7CqZYdnMEee06JQu5hzWmA" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_7CqZYtnMEee06JQu5hzWmA" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_7CqZY9nMEee06JQu5hzWmA" points="[0, -49, 0, 126]$[0, -79, 0, 96]$[6, -79, 6, 96]$[6, -126, 6, 49]"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_7CrAcdnMEee06JQu5hzWmA" id="(0.5,0.5)"/>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_PBnrkeTYEeehW-R3ypiS5Q" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_PBnrkuTYEeehW-R3ypiS5Q" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PBnrk-TYEeehW-R3ypiS5Q" points="[0, 0, -1, 166]$[0, -70, -1, 96]$[0, -70, -1, 96]$[0, -117, -1, 49]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PBoSpuTYEeehW-R3ypiS5Q" id="(0.4915254237288136,0.0)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PBoSp-TYEeehW-R3ypiS5Q" id="(0.5,0.5)"/>
|
||||
</edges>
|
||||
<edges xmi:type="notation:Edge" xmi:id="_QiclIOTYEeehW-R3ypiS5Q" type="4001" element="_QiPw0OTYEeehW-R3ypiS5Q" source="_DG5s8NapEeerr8EOGfW8XA" target="_qsVEINnMEee06JQu5hzWmA">
|
||||
<children xmi:type="notation:Node" xmi:id="_QiclJOTYEeehW-R3ypiS5Q" type="6001">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_QiclJeTYEeehW-R3ypiS5Q" x="24" y="-10"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_QiclJuTYEeehW-R3ypiS5Q" type="6002">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_QiclJ-TYEeehW-R3ypiS5Q" x="21" y="10"/>
|
||||
</children>
|
||||
<children xmi:type="notation:Node" xmi:id="_QiclKOTYEeehW-R3ypiS5Q" type="6003">
|
||||
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_QiclKeTYEeehW-R3ypiS5Q" x="3" y="-32"/>
|
||||
</children>
|
||||
<styles xmi:type="notation:ConnectorStyle" xmi:id="_QiclIeTYEeehW-R3ypiS5Q" routing="Tree"/>
|
||||
<styles xmi:type="notation:FontStyle" xmi:id="_QiclIuTYEeehW-R3ypiS5Q" fontName="Cantarell" fontHeight="8"/>
|
||||
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_QiclI-TYEeehW-R3ypiS5Q" points="[0, 49, -187, 45]$[0, 81, -187, 77]$[172, 81, -15, 77]$[172, 49, -15, 45]"/>
|
||||
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_QidMMOTYEeehW-R3ypiS5Q" id="(0.875,0.93)"/>
|
||||
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_WUwiAOTYEeehW-R3ypiS5Q" id="(0.21666666666666667,0.55)"/>
|
||||
</edges>
|
||||
</data>
|
||||
</ownedAnnotationEntries>
|
||||
|
@ -235,7 +252,7 @@
|
|||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_DGwjANapEeerr8EOGfW8XA" name="KappaContainer" tooltipText="" incomingEdges="_G_KX8NapEeerr8EOGfW8XA" width="12" height="10">
|
||||
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_DGwjANapEeerr8EOGfW8XA" name="KappaContainer" tooltipText="" outgoingEdges="_QiPw0OTYEeehW-R3ypiS5Q" incomingEdges="_G_KX8NapEeerr8EOGfW8XA" width="12" height="10">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaContainer"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaContainer"/>
|
||||
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
|
||||
|
@ -298,7 +315,7 @@
|
|||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1sJGENaqEeerr8EOGfW8XA" name="NamedElement" tooltipText="" incomingEdges="_7CgoYNnMEee06JQu5hzWmA" width="12" height="10">
|
||||
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1sJGENaqEeerr8EOGfW8XA" name="NamedElement" tooltipText="" outgoingEdges="_PBcFYOTYEeehW-R3ypiS5Q" incomingEdges="_CvvfQNarEeerr8EOGfW8XA _Pby7INarEeerr8EOGfW8XA _QeE3gNarEeerr8EOGfW8XA" width="12" height="10">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//NamedElement"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//NamedElement"/>
|
||||
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
|
||||
|
@ -318,7 +335,7 @@
|
|||
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
|
||||
</ownedElements>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_CvvfQNarEeerr8EOGfW8XA" sourceNode="_-LHIYNaoEeerr8EOGfW8XA" targetNode="_qsCwQNnMEee06JQu5hzWmA">
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_CvvfQNarEeerr8EOGfW8XA" sourceNode="_-LHIYNaoEeerr8EOGfW8XA" targetNode="_1sJGENaqEeerr8EOGfW8XA">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//Agent"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//Agent"/>
|
||||
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_CvxUcNarEeerr8EOGfW8XA" targetArrow="InputClosedArrow" routingStyle="tree">
|
||||
|
@ -330,7 +347,7 @@
|
|||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_Pby7INarEeerr8EOGfW8XA" sourceNode="_qvnjkNapEeerr8EOGfW8XA" targetNode="_qsCwQNnMEee06JQu5hzWmA">
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_Pby7INarEeerr8EOGfW8XA" sourceNode="_qvnjkNapEeerr8EOGfW8XA" targetNode="_1sJGENaqEeerr8EOGfW8XA">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//Site"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//Site"/>
|
||||
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_PbziMNarEeerr8EOGfW8XA" targetArrow="InputClosedArrow" routingStyle="tree">
|
||||
|
@ -342,7 +359,7 @@
|
|||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_QeE3gNarEeerr8EOGfW8XA" sourceNode="_6Fp5cNapEeerr8EOGfW8XA" targetNode="_qsCwQNnMEee06JQu5hzWmA">
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_QeE3gNarEeerr8EOGfW8XA" sourceNode="_6Fp5cNapEeerr8EOGfW8XA" targetNode="_1sJGENaqEeerr8EOGfW8XA">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//InternalState"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//InternalState"/>
|
||||
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_QeFekNarEeerr8EOGfW8XA" targetArrow="InputClosedArrow" routingStyle="tree">
|
||||
|
@ -368,7 +385,7 @@
|
|||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_qsCwQNnMEee06JQu5hzWmA" name="KappaElement" tooltipText="" outgoingEdges="_7CgoYNnMEee06JQu5hzWmA" incomingEdges="_QeE3gNarEeerr8EOGfW8XA _Pby7INarEeerr8EOGfW8XA _CvvfQNarEeerr8EOGfW8XA" width="12" height="10">
|
||||
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_qsCwQNnMEee06JQu5hzWmA" name="KappaElement" tooltipText="" incomingEdges="_PBcFYOTYEeehW-R3ypiS5Q _QiPw0OTYEeehW-R3ypiS5Q" width="12" height="10">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaElement"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaElement"/>
|
||||
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
|
||||
|
@ -380,15 +397,27 @@
|
|||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_7CgoYNnMEee06JQu5hzWmA" sourceNode="_qsCwQNnMEee06JQu5hzWmA" targetNode="_1sJGENaqEeerr8EOGfW8XA">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaElement"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaElement"/>
|
||||
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_7ChPcNnMEee06JQu5hzWmA" targetArrow="InputClosedArrow" routingStyle="tree">
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_PBcFYOTYEeehW-R3ypiS5Q" sourceNode="_1sJGENaqEeerr8EOGfW8XA" targetNode="_qsCwQNnMEee06JQu5hzWmA">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//NamedElement"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//NamedElement"/>
|
||||
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_PBcscOTYEeehW-R3ypiS5Q" targetArrow="InputClosedArrow" routingStyle="tree">
|
||||
<description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/>
|
||||
<beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_7ChPcdnMEee06JQu5hzWmA" showIcon="false">
|
||||
<beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_PBcsceTYEeehW-R3ypiS5Q" showIcon="false">
|
||||
<labelFormat>italic</labelFormat>
|
||||
</beginLabelStyle>
|
||||
<centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_7ChPctnMEee06JQu5hzWmA" showIcon="false"/>
|
||||
<centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_PBcscuTYEeehW-R3ypiS5Q" showIcon="false"/>
|
||||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/>
|
||||
</ownedDiagramElements>
|
||||
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_QiPw0OTYEeehW-R3ypiS5Q" sourceNode="_DGwjANapEeerr8EOGfW8XA" targetNode="_qsCwQNnMEee06JQu5hzWmA">
|
||||
<target xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaContainer"/>
|
||||
<semanticElements xmi:type="ecore:EClass" href="kappaStructure.ecore#//KappaContainer"/>
|
||||
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_QiPw0eTYEeehW-R3ypiS5Q" targetArrow="InputClosedArrow" routingStyle="tree">
|
||||
<description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/>
|
||||
<beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_QiPw0uTYEeehW-R3ypiS5Q" showIcon="false">
|
||||
<labelFormat>italic</labelFormat>
|
||||
</beginLabelStyle>
|
||||
<centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_QiPw0-TYEeehW-R3ypiS5Q" showIcon="false"/>
|
||||
</ownedStyle>
|
||||
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/>
|
||||
</ownedDiagramElements>
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
<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="kappaStructure" nsURI="http://www.es.tu-darmstadt.de/KappaStructure"
|
||||
nsPrefix="kappaStructure">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Agent" eSuperTypes="#//KappaElement">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Agent" eSuperTypes="#//NamedElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="contained" eType="#//KappaContainer"
|
||||
eOpposite="#//KappaContainer/agents"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="sites" upperBound="-1"
|
||||
eType="#//Site" containment="true" eOpposite="#//Site/agent"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="KappaContainer">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="KappaContainer" eSuperTypes="#//KappaElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="agents" upperBound="-1"
|
||||
eType="#//Agent" containment="true" eOpposite="#//Agent/contained"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Site" eSuperTypes="#//KappaElement">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Site" eSuperTypes="#//NamedElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="agent" eType="#//Agent"
|
||||
eOpposite="#//Agent/sites"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="states" upperBound="-1"
|
||||
|
@ -20,11 +20,11 @@
|
|||
<eStructuralFeatures xsi:type="ecore:EReference" name="connectedWith" upperBound="-1"
|
||||
eType="#//Site"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="InternalState" eSuperTypes="#//KappaElement">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="InternalState" eSuperTypes="#//NamedElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="site" eType="#//Site" eOpposite="#//Site/states"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true" eSuperTypes="#//KappaElement">
|
||||
<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="KappaElement" abstract="true" eSuperTypes="#//NamedElement"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="KappaElement" abstract="true"/>
|
||||
</ecore:EPackage>
|
||||
|
|
5
de.tu.darmstadt.es.NeoKappa.ide/plugin.xml
Normal file
5
de.tu.darmstadt.es.NeoKappa.ide/plugin.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
|
||||
</plugin>
|
|
@ -18,7 +18,8 @@ Require-Bundle: de.tu.darmstadt.es.NeoKappa,
|
|||
org.eclipse.xtend.lib;resolution:=optional,
|
||||
org.apache.log4j,
|
||||
org.eclipse.xtext.xbase.lib,
|
||||
de.tu.darmstadt.es.xtext.utils
|
||||
de.tu.darmstadt.es.xtext.utils,
|
||||
org.eclipse.pde.ui;bundle-version="3.10.50"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: de.tu.darmstadt.es.ui.quickfix,
|
||||
de.tu.darmstadt.es.ui.contentassist,
|
||||
|
|
|
@ -407,4 +407,20 @@
|
|||
type="text">
|
||||
</fileTypes>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.newWizards">
|
||||
<category
|
||||
id="de.tu.darmstadt.es.NeoKappa.ui.neokappa"
|
||||
name="NeoKappa">
|
||||
</category>
|
||||
<wizard
|
||||
canFinishEarly="false"
|
||||
category="de.tu.darmstadt.es.NeoKappa.ui.neokappa"
|
||||
class="de.tu.darmstadt.es.ui.wizard.NeoKappaWizard"
|
||||
hasPages="true"
|
||||
id="de.tu.darmstadt.es.NeoKappa.ui.NewNeoKappaProjectWizard"
|
||||
name="NewNeoKappaProjectWizard"
|
||||
project="true">
|
||||
</wizard>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package de.tu.darmstadt.es.ui.wizard;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard;
|
||||
|
||||
import org.eclipse.ui.INewWizard;
|
||||
|
||||
|
||||
import de.tu.darmstadt.es.xtext.utils.utils.WorkspaceHelper;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class NeoKappaWizard extends NewPluginProjectWizard implements INewWizard{
|
||||
|
||||
private String PLUGIN_PROJECT_NATURE_ID = "org.eclipse.pde.PluginNature";
|
||||
private String XTEXT_NATURE_ID = "org.eclipse.xtext.ui.shared.xtextNature";
|
||||
private String VIATRA_NATURE_ID = "org.eclipse.viatra.query.projectnature";
|
||||
private String JAVA_NATURE_ID = "org.eclipse.jdt.core.javanature";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean performFinish() {
|
||||
super.performFinish();
|
||||
|
||||
try {
|
||||
String projectName = this.fMainPage.getProjectName();
|
||||
IProject project = getProject(projectName);
|
||||
// WorkspaceHelper.INSTANCE.addNature(project, PLUGIN_PROJECT_NATURE_ID);
|
||||
WorkspaceHelper.INSTANCE.addNature(project, JAVA_NATURE_ID);
|
||||
WorkspaceHelper.INSTANCE.addNature(project, XTEXT_NATURE_ID);
|
||||
WorkspaceHelper.INSTANCE.addNature(project, VIATRA_NATURE_ID);
|
||||
// WorkspaceHelper.INSTANCE.addNeededFoldes(project);
|
||||
|
||||
} catch (CoreException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private IProject getProject(String projectName) {
|
||||
List <IProject> projects = WorkspaceHelper.INSTANCE.getAllProjectsInWorkspace();
|
||||
Optional<IProject> projectMonad = projects.parallelStream().filter(project -> project.getName().equals(projectName)).findFirst();
|
||||
return projectMonad.isPresent() ? projectMonad.get() : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -3,9 +3,13 @@ package de.tu.darmstadt.es.converter;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
import de.tu.darmstadt.es.KappaRules.BackwardRule;
|
||||
import de.tu.darmstadt.es.KappaRules.Edge;
|
||||
import de.tu.darmstadt.es.KappaRules.ForwardRule;
|
||||
|
@ -20,6 +24,7 @@ import de.tu.darmstadt.es.KappaRules.validation.KappaRuleValidator;
|
|||
import de.tu.darmstadt.es.kappaStructure.Agent;
|
||||
import de.tu.darmstadt.es.kappaStructure.InternalState;
|
||||
import de.tu.darmstadt.es.kappaStructure.KappaElement;
|
||||
import de.tu.darmstadt.es.kappaStructure.NamedElement;
|
||||
import de.tu.darmstadt.es.kappaStructure.Site;
|
||||
import de.tu.darmstadt.es.neoKappa.NKADescriptionContainer;
|
||||
import de.tu.darmstadt.es.neoKappa.NKAFile;
|
||||
|
@ -73,7 +78,7 @@ public class KappaRuleConverter {
|
|||
Source src = KappaRulesFactory.eINSTANCE.createSource();
|
||||
rule.setSource(src);
|
||||
src.setKappaModel(kappaStructureConverter.convertToKappaContainer(nkaFrom));
|
||||
fillGraph(src, src.getKappaModel().getAgents());
|
||||
fillGraph(src);
|
||||
}
|
||||
|
||||
if(nkaTo != null) {
|
||||
|
@ -81,30 +86,38 @@ public class KappaRuleConverter {
|
|||
rule.setTarget(trg);
|
||||
trg.setKappaModel(kappaStructureConverter.convertToKappaContainer(nkaTo));
|
||||
|
||||
fillGraph(trg, trg.getKappaModel().getAgents());
|
||||
fillGraph(trg);
|
||||
}
|
||||
}
|
||||
|
||||
private void fillGraph(Graph graph, List<Agent> agents) {
|
||||
agents.forEach(agent -> addAgentToGraph(graph, agent));
|
||||
private void fillGraph(Graph graph) {
|
||||
Node root = createNode(graph, graph.getKappaModel());
|
||||
List<Node> agentNodes=fillGraph(graph, graph.getKappaModel().getAgents());
|
||||
graph.getEdges().addAll(agentNodes.parallelStream().map(node -> createEdge(root, node, getEReferenceByName(graph.getKappaModel().eClass(), "agents"))).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private List<Node> fillGraph(Graph graph, List<Agent> agents) {
|
||||
List<Node> agentNodes = agents.stream().map(agent -> addAgentToGraph(graph, agent)).collect(Collectors.toList());
|
||||
final List<Node> siteNodes = graph.getNodes().parallelStream().filter(node -> node.getElement() instanceof Site).collect(Collectors.toList());
|
||||
List<List<Edge>> edges =siteNodes.parallelStream().map(node -> createConnections(node, new HashSet<Node>(siteNodes))).collect(Collectors.toList());
|
||||
graph.getEdges().addAll(edges.parallelStream().flatMap(edgeList -> edgeList.stream()).collect(Collectors.toList()));
|
||||
return agentNodes;
|
||||
}
|
||||
|
||||
private List<Edge> createConnections(Node siteNode, Set<Node> allNodes) {
|
||||
return Site.class.cast(siteNode.getElement()).getConnectedWith().stream().map(otherSite -> createEdge(siteNode, findNode(otherSite, allNodes))).collect(Collectors.toList());
|
||||
return Site.class.cast(siteNode.getElement()).getConnectedWith().stream().map(otherSite -> createEdge(siteNode, findNode(otherSite, allNodes), getEReferenceByName(siteNode.getElement().eClass(), "connectedWith"))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private Node findNode(Site site, final Set<Node> allNodes) {
|
||||
return allNodes.parallelStream().filter(node -> node.getElement().equals(site)).findFirst().get();
|
||||
}
|
||||
|
||||
private void addAgentToGraph(Graph graph, Agent agent) {
|
||||
private Node addAgentToGraph(Graph graph, Agent agent) {
|
||||
Node node = createNode(graph, agent);
|
||||
node.setIndexOfElement(agent.getContained().getAgents().indexOf(agent));
|
||||
List<Node> nodesFromSites = agent.getSites().stream().map(site -> convertSiteToNode(graph, site)).collect(Collectors.toList());
|
||||
graph.getEdges().addAll(nodesFromSites.stream().map(other -> createEdge(node, other)).collect(Collectors.toList()));
|
||||
graph.getEdges().addAll(nodesFromSites.stream().map(other -> createEdge(node, other, getEReferenceByName(agent.eClass(), "sites"))).collect(Collectors.toList()));
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +125,7 @@ public class KappaRuleConverter {
|
|||
Node node = createNode(graph, site);
|
||||
node.setIndexOfElement(site.getAgent().getSites().indexOf(site));
|
||||
List<Node> nodesFromSites = site.getStates().stream().map(state -> convertStateToNode(graph, state)).collect(Collectors.toList());
|
||||
graph.getEdges().addAll(nodesFromSites.stream().map(other -> createEdge(node, other)).collect(Collectors.toList()));
|
||||
graph.getEdges().addAll(nodesFromSites.stream().map(other -> createEdge(node, other, getEReferenceByName(site.eClass(), "states"))).collect(Collectors.toList()));
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -122,20 +135,30 @@ public class KappaRuleConverter {
|
|||
return node;
|
||||
}
|
||||
|
||||
private EReference getEReferenceByName(EClass eClass, String name) {
|
||||
Optional<EReference> monad = eClass.getEAllReferences().parallelStream().filter(ref -> ref.getName().equals(name)).findFirst();
|
||||
return monad.isPresent()? monad.get() : null;
|
||||
}
|
||||
|
||||
private Node createNode(Graph graph, KappaElement element) {
|
||||
Node node = KappaRulesFactory.eINSTANCE.createNode();
|
||||
node.setGraph(graph);
|
||||
node.setElement(element);
|
||||
node.setSymbol(element.getName() + ":" + element.eClass().getName());
|
||||
if(element instanceof NamedElement) {
|
||||
node.setSymbol(NamedElement.class.cast(element).getName() + ":" + element.eClass().getName());
|
||||
}
|
||||
else {
|
||||
node.setSymbol(element.eClass().getName());
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
private Edge createEdge(Node from, Node to) {
|
||||
private Edge createEdge(Node from, Node to, EReference reference) {
|
||||
Edge edge = KappaRulesFactory.eINSTANCE.createEdge();
|
||||
edge.setFrom(from);
|
||||
edge.setTo(to);
|
||||
edge.setSymbol(from.getSymbol() + " -> " +to.getSymbol() );
|
||||
edge.setReference(reference);
|
||||
return edge;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public abstract class AbstractNeoKappaGernerator extends AbstractGenerator{
|
|||
|
||||
protected void generateTestViatra(KappaRuleContainer kappaRuleContainer, Resource resource, ResourceSet resSet) {
|
||||
RuleToPatternConverter r2pc = new RuleToPatternConverter();
|
||||
EObject model = r2pc.createPatternModel(kappaRuleContainer);
|
||||
EObject model = r2pc.createPatternModel(kappaRuleContainer, getProjectName(resource)+ ".patterns");
|
||||
ResourceSet resourceSet = new ResourceSetImpl();
|
||||
URI rulesUri = createURIFromResource(resource, "model", "viatraConvertion.vql");
|
||||
try {
|
||||
|
@ -53,6 +53,10 @@ public abstract class AbstractNeoKappaGernerator extends AbstractGenerator{
|
|||
|
||||
}
|
||||
|
||||
protected String getProjectName(Resource resource) {
|
||||
return resource.getURI().toString().split("/")[2];
|
||||
}
|
||||
|
||||
protected URI createURIFromResource(Resource resource, String folder, String file){
|
||||
URI originUri = resource.getURI();
|
||||
List<String> segments = Arrays.asList(originUri.toString().split("/"));
|
||||
|
|
|
@ -10,5 +10,6 @@ Require-Bundle: de.tu.darmstadt.es.BiochemicalSimulationFramework,
|
|||
org.eclipse.viatra.query.patternlanguage,
|
||||
de.tu.darmstadt.es.xtext.utils,
|
||||
org.eclipse.emf.ecore,
|
||||
org.eclipse.viatra.query.patternlanguage.emf
|
||||
org.eclipse.viatra.query.patternlanguage.emf,
|
||||
org.eclipse.xtext
|
||||
Export-Package: de.tu.darmstadt.es.PatternMatchingEngine.viatra.modelconverter
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.eclipse.emf.ecore.EClass;
|
|||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EStructuralFeature;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.viatra.query.patternlanguage.patternLanguage.CompareConstraint;
|
||||
import org.eclipse.viatra.query.patternlanguage.patternLanguage.CompareFeature;
|
||||
import org.eclipse.viatra.query.patternlanguage.patternLanguage.ExecutionType;
|
||||
|
@ -34,6 +35,7 @@ import org.eclipse.viatra.query.patternlanguage.patternLanguage.Type;
|
|||
import org.eclipse.viatra.query.patternlanguage.patternLanguage.Variable;
|
||||
import org.eclipse.viatra.query.patternlanguage.patternLanguage.VariableReference;
|
||||
import org.eclipse.viatra.query.patternlanguage.patternLanguage.VariableValue;
|
||||
import org.eclipse.xtext.EcoreUtil2;
|
||||
|
||||
import de.tu.darmstadt.es.KappaRules.BackwardRule;
|
||||
import de.tu.darmstadt.es.KappaRules.Edge;
|
||||
|
@ -53,13 +55,14 @@ public class RuleToPatternConverter {
|
|||
|
||||
private PackageImport packageImport;
|
||||
|
||||
public PatternModel createPatternModel(KappaRuleContainer kappaRuleContainer) {
|
||||
public PatternModel createPatternModel(KappaRuleContainer kappaRuleContainer, String packageName) {
|
||||
//patternmodel creation
|
||||
PatternModel patternModel = EMFPatternLanguageFactory.eINSTANCE.createPatternModel();
|
||||
patternModel.setPackageName("abc"); // TODO SaschaEdwinZander insert real packagename
|
||||
patternModel.setPackageName(packageName);
|
||||
|
||||
// create imports
|
||||
patternModel.setImportPackages(createImport(kappaRuleContainer.eClass().getEPackage()));
|
||||
patternModel.setImportPackages(createImport(EcoreUtil2.eAllOfType(kappaRuleContainer, KappaContainer.class).stream().findFirst().get().eClass().getEPackage()));
|
||||
|
||||
//Pattern creation
|
||||
List<KappaRule> rules = kappaRuleContainer.getRules().parallelStream().filter(rule -> rule.getSource() != null).collect(Collectors.toList());
|
||||
|
@ -91,7 +94,6 @@ public class RuleToPatternConverter {
|
|||
TypeCounter typeCounter = new TypeCounter();
|
||||
BiMap<String, EObject> nameElementCache = new HashBiMap<>();
|
||||
List<Parameter> parameters = source.getNodes().stream().map(node -> generateParameter(node.getElement(), nameElementCache, typeCounter)).collect(Collectors.toList());
|
||||
parameters.add(generateParameter(source.getKappaModel(), nameElementCache, typeCounter));
|
||||
pattern.getParameters().addAll(parameters);
|
||||
|
||||
//create Body
|
||||
|
@ -115,34 +117,37 @@ public class RuleToPatternConverter {
|
|||
|
||||
// create distinction of same types in main patterns
|
||||
if(!(rule instanceof SubRule))
|
||||
createConstraintsForDistinction(body, parameters, parameterRefCache);
|
||||
createConstraintsForDistinction(body, parameters, parameterRefCache);
|
||||
|
||||
KappaContainer model = rule.getSource().getKappaModel();
|
||||
List<Node> agentNodes = rule.getSource().getNodes().parallelStream().filter(node -> node.getElement() instanceof Agent).collect(Collectors.toList());
|
||||
body.getConstraints().addAll(startCreateConnection(model, agentNodes, nameElementCache, parameterRefCache));
|
||||
Node root = rule.getSource().getNodes().parallelStream().filter(node -> node.getElement() instanceof KappaContainer).findFirst().get();
|
||||
body.getConstraints().addAll(startCreateConnection(root, nameElementCache, parameterRefCache));
|
||||
}
|
||||
|
||||
private List<PathExpressionConstraint> startCreateConnection(KappaContainer model, List<Node> nodes, BiMap<String, EObject> nameElementCache, BiMap<Parameter, ParameterRef> parameterRefCache) {
|
||||
private List<PathExpressionConstraint> startCreateConnection(Node root, BiMap<String, EObject> nameElementCache, BiMap<Parameter, ParameterRef> parameterRefCache) {
|
||||
List<PathExpressionConstraint> constraints = new ArrayList<>();
|
||||
constraints.addAll(nodes.parallelStream().map(node -> createPathExpressionConstraint(model, node.getElement(), nameElementCache, parameterRefCache)).collect(Collectors.toList()));
|
||||
|
||||
Set<Edge> visited = new HashSet<>(); //for cycles
|
||||
Stack<Node> stack = new Stack<>();
|
||||
stack.addAll(nodes);
|
||||
stack.push(root);
|
||||
|
||||
while(!stack.isEmpty()) {
|
||||
Node srcNode = stack.pop();
|
||||
List<Edge> edges = srcNode.getOutgoingEdges().parallelStream().filter(edge -> !visited.contains(edge)).collect(Collectors.toList());
|
||||
visited.addAll(edges);
|
||||
constraints.addAll(edges.parallelStream().map(edge -> createPathExpressionConstraint(edge, nameElementCache, parameterRefCache)).collect(Collectors.toList()));
|
||||
List<Node> targets = edges.parallelStream().map(edge -> edge.getTo()).collect(Collectors.toList());
|
||||
constraints.addAll(targets.parallelStream().map(targetNode -> createPathExpressionConstraint(srcNode.getElement(), targetNode.getElement(), nameElementCache, parameterRefCache)).collect(Collectors.toList()));
|
||||
stack.addAll(targets);
|
||||
}
|
||||
|
||||
return constraints;
|
||||
}
|
||||
|
||||
private PathExpressionConstraint createPathExpressionConstraint(EObject source, EObject target, BiMap<String, EObject> nameElementCache, BiMap<Parameter, ParameterRef> parameterRefCache) {
|
||||
private PathExpressionConstraint createPathExpressionConstraint(Edge edge, BiMap<String, EObject> nameElementCache, BiMap<Parameter, ParameterRef> parameterRefCache) {
|
||||
//init
|
||||
Node srcNode = edge.getFrom();
|
||||
Node trgNode = edge.getTo();
|
||||
EObject source = srcNode.getElement();
|
||||
EObject target = trgNode.getElement();
|
||||
PathExpressionConstraint constraint = PatternLanguageFactory.eINSTANCE.createPathExpressionConstraint();
|
||||
|
||||
//create head
|
||||
|
@ -155,7 +160,7 @@ public class RuleToPatternConverter {
|
|||
//create Tail
|
||||
PathExpressionTail tail = PatternLanguageFactory.eINSTANCE.createPathExpressionTail();
|
||||
head.setTail(tail);
|
||||
tail.setType(createReferenceType(source.eClass(), target));
|
||||
tail.setType(createReferenceType(edge));
|
||||
|
||||
//create Src
|
||||
String srcTypeName = nameElementCache.getKey(source);
|
||||
|
@ -170,12 +175,9 @@ public class RuleToPatternConverter {
|
|||
return constraint;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ReferenceType createReferenceType(EClass sourceType, EObject target) {
|
||||
ReferenceType referenceType = EMFPatternLanguageFactory.eINSTANCE.createReferenceType();
|
||||
EStructuralFeature feature = target.eContainingFeature();
|
||||
referenceType.setRefname(feature);
|
||||
private ReferenceType createReferenceType(Edge edge) {
|
||||
ReferenceType referenceType = EMFPatternLanguageFactory.eINSTANCE.createReferenceType();
|
||||
referenceType.setRefname(edge.getReference());
|
||||
return referenceType;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ Require-Bundle: org.eclipse.xtext,
|
|||
org.eclipse.xtext.ui,
|
||||
org.eclipse.emf.ecore,
|
||||
org.apache.log4j,
|
||||
org.eclipse.ui
|
||||
org.eclipse.ui,
|
||||
org.eclipse.core.resources
|
||||
Export-Package: de.tu.darmstadt.es.xtext.utils.exceptions,
|
||||
de.tu.darmstadt.es.xtext.utils.scoping,
|
||||
de.tu.darmstadt.es.xtext.utils.scoping.utils,
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package de.tu.darmstadt.es.xtext.utils.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
||||
public class WorkspaceHelper {
|
||||
|
||||
public final static WorkspaceHelper INSTANCE = new WorkspaceHelper();
|
||||
|
||||
private final String SRC = "src";
|
||||
|
||||
private WorkspaceHelper() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of all projects in the workspace
|
||||
*/
|
||||
public List<IProject> getAllProjectsInWorkspace() {
|
||||
return Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects());
|
||||
}
|
||||
|
||||
public boolean projectExist(String projectName) {
|
||||
return getAllProjectsInWorkspace().parallelStream().anyMatch(project -> projectName.equalsIgnoreCase(project.getName()));
|
||||
}
|
||||
|
||||
public IProject createEmptyProject(String projectName) throws CoreException {
|
||||
IProgressMonitor progressMonitor = new NullProgressMonitor();
|
||||
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
||||
IProject project = root.getProject(projectName);
|
||||
project.create(progressMonitor);
|
||||
project.open(progressMonitor);
|
||||
|
||||
return project;
|
||||
}
|
||||
|
||||
public void addNature(IProject project, String natureID) throws CoreException {
|
||||
IProjectDescription description = project.getDescription();
|
||||
|
||||
String[] natures = description.getNatureIds();
|
||||
String[] newNatures = new String[natures.length + 1];
|
||||
System.arraycopy(natures, 0, newNatures, 0, natures.length);
|
||||
newNatures[natures.length] = natureID;
|
||||
|
||||
// validate the natures
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
IStatus status = workspace.validateNatureSet(newNatures);
|
||||
|
||||
// only apply new nature, if the status is ok
|
||||
if (status.getCode() == IStatus.OK) {
|
||||
description.setNatureIds(newNatures);
|
||||
project.setDescription(description, null);
|
||||
}
|
||||
}
|
||||
|
||||
public IFolder getSrcFolder(IProject project) {
|
||||
return project.getFolder(SRC);
|
||||
}
|
||||
|
||||
public void addNeededFoldes(IProject project) throws CoreException{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue