Skip to content
Snippets Groups Projects
Commit 7ff219e0 authored by Kevin Kassin's avatar Kevin Kassin
Browse files

#Commit 29.7 20:05

reversed implementation of setting referenced roles  from commit direcly
before
parent 2cc72ed2
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,6 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.util.IColorConstant;
import org.framed.iorm.model.OrmFactory;
import org.framed.iorm.model.Relation;
import org.framed.iorm.model.Shape;
import org.framed.iorm.model.Type;
import org.framed.iorm.ui.literals.IdentifierLiterals;
import org.framed.iorm.ui.literals.LayoutLiterals;
......@@ -215,10 +214,6 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
sourceShape.getContainer().getElements().add(newInheritance);
newInheritance.setSource(sourceShape);
newInheritance.setTarget(targetShape);
if(sourceShape.getType() == Type.ROLE_TYPE) {
newInheritance.getReferencedRoles().add((Shape) sourceShape);
newInheritance.getReferencedRoles().add((Shape) targetShape);
}
//Step 4
AddConnectionContext addContext = new AddConnectionContext(sourceAnchor, targetAnchor);
addContext.setNewObject(newInheritance);
......
......@@ -17,7 +17,6 @@ import org.eclipse.graphiti.util.IColorConstant;
import org.framed.iorm.model.NamedElement;
import org.framed.iorm.model.OrmFactory;
import org.framed.iorm.model.Relation;
import org.framed.iorm.model.Shape;
import org.framed.iorm.model.Type;
import org.framed.iorm.ui.graphitifeatures.EditRelationshipFeature;
import org.framed.iorm.ui.literals.IdentifierLiterals;
......@@ -280,9 +279,7 @@ public class RelationshipPattern extends FRaMEDConnectionPattern {
newRelationship.setContainer(sourceShape.getContainer());
sourceShape.getContainer().getElements().add(newRelationship);
newRelationship.setSource(sourceShape);
newRelationship.getReferencedRoles().add((Shape) sourceShape);
newRelationship.setTarget(targetShape);
newRelationship.getReferencedRoles().add((Shape) targetShape);
//Step 4
NamedElement sourceLabel = OrmFactory.eINSTANCE.createNamedElement();
NamedElement targetLabel = OrmFactory.eINSTANCE.createNamedElement();
......
......@@ -8,7 +8,6 @@ import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.util.IColorConstant;
import org.framed.iorm.model.OrmFactory;
import org.framed.iorm.model.Relation;
import org.framed.iorm.model.Shape;
import org.framed.iorm.model.Type;
import org.framed.iorm.ui.literals.IdentifierLiterals;
import org.framed.iorm.ui.literals.LayoutLiterals;
......@@ -136,9 +135,7 @@ public abstract class AbstractRoleConstraintPattern extends FRaMEDConnectionPatt
newRoleConstraint.setContainer(sourceShape.getContainer());
sourceShape.getContainer().getElements().add(newRoleConstraint);
newRoleConstraint.setSource(sourceShape);
newRoleConstraint.getReferencedRoles().add((Shape) sourceShape);
newRoleConstraint.setTarget(targetShape);
newRoleConstraint.getReferencedRoles().add((Shape) targetShape);
//Step 4
AddConnectionContext addContext = new AddConnectionContext(sourceAnchor, targetAnchor);
addContext.setNewObject(newRoleConstraint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment