diff --git a/org.framed.iorm.ui/core/baseRules.editpolicy b/org.framed.iorm.ui/core/baseRules.editpolicy index a8989f82497a5e216396a60a54ac8b9c64a9a934..44a65f53f4e28b3b3821bb01740cc3aa81390e78 100644 --- a/org.framed.iorm.ui/core/baseRules.editpolicy +++ b/org.framed.iorm.ui/core/baseRules.editpolicy @@ -32,6 +32,10 @@ <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> </policies> + <policies action="Execute" actionType="CompartmentType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> + </policies> <policies action="Execute" actionType="Relationship"> <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> diff --git a/org.framed.iorm.ui/core/fulfillment/FulfillmentPattern.java b/org.framed.iorm.ui/core/fulfillment/FulfillmentPattern.java index a9f020d7adc96fdb8a5c509c49074467cff0c87b..84375e18ef7736f45cacbbc040b43afa6d59d2bc 100644 --- a/org.framed.iorm.ui/core/fulfillment/FulfillmentPattern.java +++ b/org.framed.iorm.ui/core/fulfillment/FulfillmentPattern.java @@ -81,7 +81,7 @@ public class FulfillmentPattern extends FRaMEDConnectionPattern { Anchor newAnchor = context.getNewAnchor(); org.framed.iorm.model.ModelElement newShape = UIUtil.getModelElementForAnchor(newAnchor); if(newShape != null) { - return EditPolicyService.getHandler(this.getDiagram()).canReconnect(context, newShape.getType()); + return EditPolicyService.getHandler(this.getDiagram()).canReconnect(context, this.modelType); } return false; } diff --git a/org.framed.iorm.ui/core/inheritance/InheritancePattern.java b/org.framed.iorm.ui/core/inheritance/InheritancePattern.java index 0c4a08899532b68d6410d6ec08e36381cadb39eb..b6f5b5b1337949f709ca03a4b1316b2a1ba6992d 100644 --- a/org.framed.iorm.ui/core/inheritance/InheritancePattern.java +++ b/org.framed.iorm.ui/core/inheritance/InheritancePattern.java @@ -92,7 +92,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern { if(oldShape != null && newShape != null) { if(oldShape.getContainer() == newShape.getContainer()) { if(newShape.getType() == oldShape.getType()) { - return true; //TODO: Handle by the EditPolicyHandler + return EditPolicyService.getHandler(this.getDiagram()).canReconnect(context, this.modelType); } } } } } return false; } diff --git a/org.framed.iorm.ui/modules/compartment/CompartmentTypePattern.java b/org.framed.iorm.ui/modules/compartment/CompartmentTypePattern.java index b8cb1e6b0a66649288988e65bcd57d8a65860f90..cb6aaba070099d8434a5c7cfaf11dc95af1b0573 100644 --- a/org.framed.iorm.ui/modules/compartment/CompartmentTypePattern.java +++ b/org.framed.iorm.ui/modules/compartment/CompartmentTypePattern.java @@ -42,7 +42,7 @@ import org.framed.iorm.featuremodel.FRaMEDFeature; import org.framed.iorm.model.Model; import org.framed.iorm.model.ModelElement; import org.framed.iorm.model.OrmFactory; -import org.framed.iorm.model.Segment; +import org.framed.iorm.model.Segment; import org.framed.iorm.model.Type; import org.framed.iorm.ui.FRaMEDShapePattern; import org.framed.iorm.ui.UILiterals; diff --git a/org.framed.iorm.ui/modules/relationship/RelationshipPattern.java b/org.framed.iorm.ui/modules/relationship/RelationshipPattern.java index 3ccacd49ccd1754416a9f4adbb6ff4e7950e477f..f15bf771726a245592732560caf6597b6b6c00cc 100644 --- a/org.framed.iorm.ui/modules/relationship/RelationshipPattern.java +++ b/org.framed.iorm.ui/modules/relationship/RelationshipPattern.java @@ -96,7 +96,7 @@ public class RelationshipPattern extends FRaMEDConnectionPattern { Anchor newAnchor = context.getNewAnchor(); org.framed.iorm.model.ModelElement newShape = UIUtil.getModelElementForAnchor(newAnchor); if(newShape != null) { - return EditPolicyService.getHandler(this.getDiagram()).canReconnect(context, newShape.getType()); + return EditPolicyService.getHandler(this.getDiagram()).canReconnect(context, this.modelType); } return false; } @@ -302,7 +302,7 @@ public class RelationshipPattern extends FRaMEDConnectionPattern { Anchor sourceAnchor = createContext.getSourceAnchor(); org.framed.iorm.model.ModelElement sourceShape = UIUtil.getModelElementForAnchor(sourceAnchor); if(sourceShape != null){ - return EditPolicyService.getHandler(this.getDiagram()).canStart(createContext, sourceShape.getType()); + return EditPolicyService.getHandler(this.getDiagram()).canStart(createContext, this.modelType); } return false; }