From b5894cd1b914b697cffaf51ccb13ba38ed940ca8 Mon Sep 17 00:00:00 2001
From: Kevin Kassin <KK@Medion-PC>
Date: Wed, 26 Jul 2017 18:21:42 +0200
Subject: [PATCH] #Commit 26.7 18:20

implemented now visible inter relationship constraints (not fully
implemented)
---
 .../EditRelationshipFeature.java              | 30 ++++----
 .../iorm/ui/literals/IdentifierLiterals.java  |  8 ++-
 .../connections/RelationshipPattern.java      | 32 +++++++--
 ...actInterRelationshipConstraintPattern.java | 36 +++++++++-
 ...ationshipImplicationConstraintPattern.java | 72 ++++++++++++++++++-
 .../AbstractRoleConstraintPattern.java        | 14 ++++
 .../RoleEquivalencePattern.java               | 19 +----
 .../RoleImplicationPattern.java               | 14 ----
 .../RoleProhibitionPattern.java               | 13 ----
 9 files changed, 166 insertions(+), 72 deletions(-)

diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/graphitifeatures/EditRelationshipFeature.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/graphitifeatures/EditRelationshipFeature.java
index c5c3bfc3..68dd3d73 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/graphitifeatures/EditRelationshipFeature.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/graphitifeatures/EditRelationshipFeature.java
@@ -92,20 +92,18 @@ public class EditRelationshipFeature extends AbstractCustomFeature {
 		int returnCode = editDialog.open();
 		if(returnCode == Window.OK) {
 			for(ConnectionDecorator decorator : connection.getConnectionDecorators()) {
-				Text text = (Text) decorator.getGraphicsAlgorithm();
-				if(PropertyUtil.isShape_IdValue(decorator, SHAPE_ID_RELATIONSHIP_NAME_DECORATOR)) {
-					text.setValue(relationshipValues.get(0));
-					businessObject.setName(relationshipValues.get(0));
-				}
-				if(PropertyUtil.isShape_IdValue(decorator, SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR)) {
-					text.setValue(relationshipValues.get(1));
-					businessObject.getSourceLabel().setName(relationshipValues.get(1));
-				}
-				if(PropertyUtil.isShape_IdValue(decorator, SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR)) {
-					text.setValue(relationshipValues.get(2));
-					businessObject.getTargetLabel().setName(relationshipValues.get(2));
-				}
-			}
-		}
-	}
+				if(decorator.getGraphicsAlgorithm() instanceof Text) {
+					Text text = (Text) decorator.getGraphicsAlgorithm();
+					if(PropertyUtil.isShape_IdValue(decorator, SHAPE_ID_RELATIONSHIP_NAME_DECORATOR)) {
+						text.setValue(relationshipValues.get(0));
+						businessObject.setName(relationshipValues.get(0));
+					}
+					if(PropertyUtil.isShape_IdValue(decorator, SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR)) {
+						text.setValue(relationshipValues.get(1));
+						businessObject.getSourceLabel().setName(relationshipValues.get(1));
+					}
+					if(PropertyUtil.isShape_IdValue(decorator, SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR)) {
+						text.setValue(relationshipValues.get(2));
+						businessObject.getTargetLabel().setName(relationshipValues.get(2));
+	}	}	}	}	}
 }
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/IdentifierLiterals.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/IdentifierLiterals.java
index f9442a30..09cd20b6 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/IdentifierLiterals.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/IdentifierLiterals.java
@@ -207,13 +207,19 @@ public class IdentifierLiterals {
 	 */
 	public static final String SHAPE_ID_RELATIONSHIP_NAME_DECORATOR = "shape_rst_name",
 							   SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR = "shape_rst_source_cardinality",
-							   SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR = "shape_rst_target_cardinality";
+							   SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR = "shape_rst_target_cardinality",
+							   SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR = "shape_rst_anchor";
 	
 	/**
 	 * identifier used for the connection decorators of the intra relationship constraints
 	 */
 	public static final String SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR = "shape_irc_name";
 	
+	/**
+	 * identifier used for role constraint connection decorators
+	 */
+	public static final String SHAPE_ID_INTER_REL_CON = "shape_inter_rel_con";
+	
 	/**
 	 * identifiers used for role types
 	 * <p>
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/RelationshipPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/RelationshipPattern.java
index 309ef964..23819cdb 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/RelationshipPattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/RelationshipPattern.java
@@ -7,10 +7,14 @@ import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
 import org.eclipse.graphiti.features.context.impl.CustomContext;
 import org.eclipse.graphiti.features.custom.ICustomFeature;
 import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.Rectangle;
 import org.eclipse.graphiti.mm.algorithms.Text;
 import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor;
+import org.eclipse.graphiti.mm.pictograms.ChopboxAnchor;
 import org.eclipse.graphiti.mm.pictograms.Connection;
 import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
 import org.eclipse.graphiti.mm.pictograms.PictogramElement;
 import org.eclipse.graphiti.util.IColorConstant;
 import org.framed.iorm.model.NamedElement;
@@ -62,7 +66,8 @@ public class RelationshipPattern extends FRaMEDConnectionPattern {
 	 */
 	private static final String SHAPE_ID_RELATIONSHIP_NAME_DECORATOR = IdentifierLiterals.SHAPE_ID_RELATIONSHIP_NAME_DECORATOR,
 			   					SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR = IdentifierLiterals.SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR,
-			   					SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR = IdentifierLiterals.SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR;
+			   					SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR = IdentifierLiterals.SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR,
+			   					SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR = IdentifierLiterals.SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR;
 	
 	/**
 	 * the color values used for the polyline and the texts of the relationship gathered from {@link LayoutLiterals}
@@ -124,6 +129,7 @@ public class RelationshipPattern extends FRaMEDConnectionPattern {
 	 * Step 1: create a connection shape and polyline as its graphic algorithm<br>
 	 * Step 2: create the a connection decorator for the relationships name<br>
 	 * Step 3: create the a connection decorators for the cardinalities<br>
+	 * TODO
 	 * Step 4: link the pictogram elements and the business objects<br>
 	 * Step 5: opens the wizard to edit the relationships name and cardinalities
 	 */
@@ -146,35 +152,47 @@ public class RelationshipPattern extends FRaMEDConnectionPattern {
 	    Text nameText = graphicAlgorithmService.createText(connectionDecoratorForName, addedRelationship.getName());
 	    graphicAlgorithmService.setLocation(nameText, 0, -1*DISTANCE_FROM_CONNECTION_LINE);
 	    nameText.setForeground(manageColor(COLOR_TEXT)); 
-	    PropertyUtil.setShape_IdValue(connectionDecoratorForName, SHAPE_ID_RELATIONSHIP_NAME_DECORATOR);
 	    //Step 3
 	    ConnectionDecorator connectionDecoratorForSourceLabel = 
 	    	pictogramElementCreateService.createConnectionDecorator(connection, true, 0.1, true);
 	    Text sourceLabel = graphicAlgorithmService.createText(connectionDecoratorForSourceLabel, addedRelationship.getSourceLabel().getName());
 	    graphicAlgorithmService.setLocation(sourceLabel, 0, -1*DISTANCE_FROM_CONNECTION_LINE);
 	    sourceLabel.setForeground(manageColor(COLOR_TEXT));
-	    PropertyUtil.setShape_IdValue(connectionDecoratorForSourceLabel, SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR);
-	    //Step 3
+	    
 	    ConnectionDecorator connectionDecoratorForTargetLabel = 
 	    	pictogramElementCreateService.createConnectionDecorator(connection, true, 0.9, true);
 	    Text targetLabel = graphicAlgorithmService.createText(connectionDecoratorForTargetLabel, addedRelationship.getTargetLabel().getName());
 	    graphicAlgorithmService.setLocation(targetLabel, 0, -1*DISTANCE_FROM_CONNECTION_LINE);
 	    targetLabel.setForeground(manageColor(COLOR_TEXT));
-	    PropertyUtil.setShape_IdValue(connectionDecoratorForTargetLabel, SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR);
-		//Step 4 
+	   
+	    //Step 4
+	    ConnectionDecorator connectionDecoratorForAnchor = 
+	    	pictogramElementCreateService.createConnectionDecorator(connection, true, 0.5, true);
+	    Rectangle rectangle = graphicAlgorithmService.createRectangle(connectionDecoratorForAnchor);
+	    graphicAlgorithmService.setSize(rectangle, 1, 1);
+	    //TODO erkl�ren addAnchor graphical model
+	    pictogramElementCreateService.createChopboxAnchor(connectionDecoratorForAnchor);
+	    //Step 4 
 		link(connection, addedRelationship);
 		link(connectionDecoratorForName, addedRelationship);
 		link(connectionDecoratorForSourceLabel, addedRelationship);
 		link(connectionDecoratorForTargetLabel, addedRelationship);
+		link(connectionDecoratorForAnchor, addedRelationship);
+		//TODO
+		PropertyUtil.setShape_IdValue(connectionDecoratorForName, SHAPE_ID_RELATIONSHIP_NAME_DECORATOR);
+		PropertyUtil.setShape_IdValue(connectionDecoratorForSourceLabel, SHAPE_ID_RELATIONSHIP_SOURCE_CARDINALITY_DECORATOR);
+		PropertyUtil.setShape_IdValue(connectionDecoratorForTargetLabel, SHAPE_ID_RELATIONSHIP_TARGET_CARDINALITY_DECORATOR);
+		PropertyUtil.setShape_IdValue(connectionDecoratorForAnchor, SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR);
 		//Step 5
 		CustomContext customContext = new CustomContext();
 		PictogramElement[] pictogramElement = new PictogramElement[1];
 		pictogramElement[0] = connection;
 		customContext.setPictogramElements(pictogramElement);
+		//TODO erkl�ren CreateAnchor businessmodel
+		pictogramElementCreateService.createChopboxAnchor(connection);
 		EditRelationshipFeature editRelationshipFeature = getEditRelationshipFeature(customContext);
 		if(editRelationshipFeature.canExecute(customContext))
 			editRelationshipFeature.execute(customContext);
-		pictogramElementCreateService.createChopboxAnchor(connection);
 		return connection;
 	}
 	
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/AbstractInterRelationshipConstraintPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/AbstractInterRelationshipConstraintPattern.java
index cfe3dd3d..9a837677 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/AbstractInterRelationshipConstraintPattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/AbstractInterRelationshipConstraintPattern.java
@@ -1,12 +1,16 @@
 package org.framed.iorm.ui.pattern.connections.interrelationship;
 
+import org.eclipse.graphiti.features.context.IAddContext;
 import org.eclipse.graphiti.features.context.ICreateConnectionContext;
 import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
 import org.eclipse.graphiti.mm.pictograms.Anchor;
 import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.util.IColorConstant;
 import org.framed.iorm.model.OrmFactory;
 import org.framed.iorm.model.Relation;
 import org.framed.iorm.model.Type;
+import org.framed.iorm.ui.literals.IdentifierLiterals;
 import org.framed.iorm.ui.literals.LayoutLiterals;
 import org.framed.iorm.ui.pattern.connections.FRaMEDConnectionPattern;
 import org.framed.iorm.ui.util.ConnectionPatternUtil;
@@ -14,11 +18,21 @@ import org.framed.iorm.ui.util.ConnectionPatternUtil;
 //TODO
 public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnectionPattern {
 	
+	//TODO
+	protected final String SHAPE_ID_INTER_REL_CON = IdentifierLiterals.SHAPE_ID_INTER_REL_CON,
+					       SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR = IdentifierLiterals.SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR;
+	
 	/**
 	 * the layout integers used to layout the arrowhead of the inheritances gathered from {@link LayoutLiterals}
 	 */
-	private static final int ARROWHEAD_LENGTH = LayoutLiterals.ARROWHEAD_LENGTH,
-							 ARROWHEAD_HEIGHT = LayoutLiterals.ARROWHEAD_HEIGHT;
+	protected final int ARROWHEAD_LENGTH = LayoutLiterals.ARROWHEAD_LENGTH,
+					    ARROWHEAD_HEIGHT = LayoutLiterals.ARROWHEAD_HEIGHT;
+	
+	/**
+	 * the color values used for the polyline and the arrowhead gathered from {@link LayoutLiterals}
+	 */
+	protected final IColorConstant COLOR_CONNECTIONS = LayoutLiterals.COLOR_CONNECTIONS,
+								   COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD;
 	
 	/**
 	 * Class constructor
@@ -27,6 +41,24 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection
 		super();
 	}
 	
+	//add feature
+	//~~~~~~~~~~~
+	/**
+	 * calculates if a inter relationship constraint can be added to the pictogram diagram
+	 * <p>
+	 * returns true if the business object is a inter relationship constraint of the given type
+	 * @return if an inter relationship constraint can be added
+	 */
+	public boolean canAddInterRelationshipConstraint(IAddContext addContext, Type type) {
+		if(addContext.getNewObject() instanceof Relation) {
+			Relation relation = (Relation) addContext.getNewObject();
+			if(relation.getType() == type) {
+				return true; 
+			}   
+		}
+		return false;
+	}
+	
 	//create feature
 	//~~~~~~~~~~~~~~
 	/**
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipImplicationConstraintPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipImplicationConstraintPattern.java
index 1583b114..84f158e9 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipImplicationConstraintPattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipImplicationConstraintPattern.java
@@ -1,12 +1,22 @@
 package org.framed.iorm.ui.pattern.connections.interrelationship;
 
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.context.IAddConnectionContext;
+import org.eclipse.graphiti.features.context.IAddContext;
 import org.eclipse.graphiti.features.context.ICreateConnectionContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
 import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.framed.iorm.model.Relation;
 import org.framed.iorm.model.Type;
 import org.framed.iorm.ui.literals.IdentifierLiterals;
-import org.framed.iorm.ui.literals.LayoutLiterals;
 import org.framed.iorm.ui.literals.NameLiterals;
-import org.framed.iorm.ui.pattern.connections.roleconstraint.AbstractRoleConstraintPattern;
+import org.framed.iorm.ui.util.PropertyUtil;
 
 //TODO
 public class RelationshipImplicationConstraintPattern extends AbstractInterRelationshipConstraintPattern {
@@ -46,6 +56,64 @@ public class RelationshipImplicationConstraintPattern extends AbstractInterRelat
 		return IMG_ID_FEATURE_RELATIONSHIP_IMPLICATION;
 	}
 	
+	//add feature
+	//~~~~~~~~~~~
+	/**
+	 * uses the super types equivalent operation to calculate if the relationship implications can be added
+	 */
+	@Override
+	public boolean canAdd(IAddContext addContext) {
+		return canAddInterRelationshipConstraint(addContext, Type.RELATIONSHIP_IMPLICATION);
+	}
+	
+	/**
+	 * adds the role equivalences to the pictogram diagram using the following steps:
+	 * <p>
+	 * Step 1: create a connection shape and dashed polyline as its graphic algorithm
+	 * Step 2: create the connection decorators and arrowheads as their graphics algorithms 
+	 * Step 3: link the pictogram elements and the business objects
+	 */
+	@Override
+	public PictogramElement add(IAddContext addContext) {
+		IAddConnectionContext addConnectionContext = (IAddConnectionContext) addContext;
+	    Relation addedRoleImplication = (Relation) addContext.getNewObject();
+	    //TEST
+	    Connection sourceConnection = (Connection) addConnectionContext.getSourceAnchor().getParent();
+	    Connection targetConnection = (Connection) addConnectionContext.getTargetAnchor().getParent();
+	    Anchor graphicalSourceAnchor = null,
+	    	   graphicalTargetAnchor = null;
+	    for(ConnectionDecorator connectionDecorator : sourceConnection.getConnectionDecorators()) {
+	    	if(PropertyUtil.isShape_IdValue(connectionDecorator, SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR))
+	    		graphicalSourceAnchor = connectionDecorator.getAnchors().get(0);
+	    }
+	    for(ConnectionDecorator connectionDecorator : targetConnection.getConnectionDecorators()) {
+	    	if(PropertyUtil.isShape_IdValue(connectionDecorator, SHAPE_ID_RELATIONSHIP_ANCHOR_DECORATOR))
+	    		graphicalTargetAnchor = connectionDecorator.getAnchors().get(0);
+	    }
+	    if(graphicalSourceAnchor == null || graphicalTargetAnchor == null) return null;
+	    //Step 1
+	    Connection connection = pictogramElementCreateService.createFreeFormConnection(getDiagram());
+	    connection.setStart(graphicalSourceAnchor);
+	    connection.setEnd(graphicalTargetAnchor);
+	    Polyline polyline = graphicAlgorithmService.createPolyline(connection);
+	    polyline.setForeground(manageColor(COLOR_CONNECTIONS));
+	    polyline.setLineStyle(LineStyle.DASH);
+	    polyline.setLineWidth(2);
+	    //Step2
+	    ConnectionDecorator connectionDecorator;
+	    connectionDecorator = pictogramElementCreateService.createConnectionDecorator(connection, false, 1.0, true);
+	    int points[] = new int[] { -1*ARROWHEAD_LENGTH, ARROWHEAD_HEIGHT, 		//Point 1
+	    						   0, 0, 										//P2
+	    						   -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT };	//P3						 
+	    Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points);
+	    arrowhead.setForeground(manageColor(COLOR_CONNECTIONS));
+	    arrowhead.setBackground(manageColor(COLOR_ARROWHEAD));
+	    PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_INTER_REL_CON);
+	    //Step 3
+	    link(connection, addedRoleImplication);
+	    return connection;
+	}
+	
 	//create feature
 	//~~~~~~~~~~~~~~  
 	/**
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/AbstractRoleConstraintPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/AbstractRoleConstraintPattern.java
index c6136fde..0b2800c6 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/AbstractRoleConstraintPattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/AbstractRoleConstraintPattern.java
@@ -5,10 +5,12 @@ import org.eclipse.graphiti.features.context.ICreateConnectionContext;
 import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
 import org.eclipse.graphiti.mm.pictograms.Anchor;
 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.Type;
 import org.framed.iorm.ui.literals.IdentifierLiterals;
+import org.framed.iorm.ui.literals.LayoutLiterals;
 import org.framed.iorm.ui.pattern.connections.FRaMEDConnectionPattern;
 import org.framed.iorm.ui.util.ConnectionPatternUtil;
 
@@ -32,6 +34,18 @@ public abstract class AbstractRoleConstraintPattern extends FRaMEDConnectionPatt
 		super();
 	}
 	
+	/**
+	 * the layout integers used to layout the arrowhead of the role equivalences gathered from {@link LayoutLiterals}
+	 */
+	protected static final int ARROWHEAD_LENGTH = LayoutLiterals.ARROWHEAD_LENGTH,
+							 ARROWHEAD_HEIGHT = LayoutLiterals.ARROWHEAD_HEIGHT;
+	
+	/**
+	 * the color values used for the polyline and the arrowhead gathered from {@link LayoutLiterals}
+	 */
+	protected static final IColorConstant COLOR_CONNECTIONS = LayoutLiterals.COLOR_CONNECTIONS,
+										  COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD;
+	
 	//add feature
 	//~~~~~~~~~~~
 	/**
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleEquivalencePattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleEquivalencePattern.java
index 30f7997a..2ee41008 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleEquivalencePattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleEquivalencePattern.java
@@ -10,11 +10,9 @@ import org.eclipse.graphiti.mm.pictograms.Anchor;
 import org.eclipse.graphiti.mm.pictograms.Connection;
 import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
 import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.util.IColorConstant;
 import org.framed.iorm.model.Relation;
 import org.framed.iorm.model.Type;
 import org.framed.iorm.ui.literals.IdentifierLiterals;
-import org.framed.iorm.ui.literals.LayoutLiterals;
 import org.framed.iorm.ui.literals.NameLiterals;
 import org.framed.iorm.ui.util.PropertyUtil;
 
@@ -40,19 +38,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern {
 	 * the identifier for the icon of the create feature gathered from {@link IdentifierLiterals}
 	 */
 	private static final String IMG_ID_FEATURE_ROLEEQUIVALENCE = IdentifierLiterals.IMG_ID_FEATURE_ROLEEQUIVALENCE;
-	
-	/**
-	 * the layout integers used to layout the arrowhead of the inheritances gathered from {@link LayoutLiterals}
-	 */
-	private static final int ARROWHEAD_LENGTH = LayoutLiterals.ARROWHEAD_LENGTH,
-							 ARROWHEAD_HEIGHT = LayoutLiterals.ARROWHEAD_HEIGHT;
-							 
-	/**
-	 * the color values used for the polyline and the arrowhead of the role equivalences gathered from {@link LayoutLiterals}
-	 */
-	private static final IColorConstant COLOR_CONNECTIONS = LayoutLiterals.COLOR_CONNECTIONS,
-										COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD;		
-	
+		
 	/**
 	 * Class constructor
 	 */
@@ -78,7 +64,6 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern {
 		return IMG_ID_FEATURE_ROLEEQUIVALENCE;
 	}
 	
-	
 	//add feature
 	//~~~~~~~~~~~
 	/**
@@ -109,7 +94,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern {
 	    connection.setEnd(targetAnchor);
 	    Polyline polyline = graphicAlgorithmService.createPolyline(connection);
 	    polyline.setForeground(manageColor(COLOR_CONNECTIONS));
-	    polyline.setLineStyle(LineStyle.DASH);
+	    polyline.setLineStyle(LineStyle.DASHDOT);
 	    polyline.setLineWidth(2);
 	    //Step2
 	    ConnectionDecorator connectionDecoratorTarget;
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleImplicationPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleImplicationPattern.java
index 90daa81f..9ac53cdc 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleImplicationPattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleImplicationPattern.java
@@ -10,11 +10,9 @@ import org.eclipse.graphiti.mm.pictograms.Anchor;
 import org.eclipse.graphiti.mm.pictograms.Connection;
 import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
 import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.util.IColorConstant;
 import org.framed.iorm.model.Relation;
 import org.framed.iorm.model.Type;
 import org.framed.iorm.ui.literals.IdentifierLiterals;
-import org.framed.iorm.ui.literals.LayoutLiterals;
 import org.framed.iorm.ui.literals.NameLiterals;
 import org.framed.iorm.ui.util.PropertyUtil;
 
@@ -41,18 +39,6 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern {
 	 */
 	private static final String IMG_ID_FEATURE_ROLEIMPLICATION = IdentifierLiterals.IMG_ID_FEATURE_ROLEIMPLICATION;
 	
-	/**
-	 * the layout integers used to layout the arrowhead of the role equivalences gathered from {@link LayoutLiterals}
-	 */
-	private static final int ARROWHEAD_LENGTH = LayoutLiterals.ARROWHEAD_LENGTH,
-							 ARROWHEAD_HEIGHT = LayoutLiterals.ARROWHEAD_HEIGHT;
-							 
-	/**
-	 * the color values used for the polyline and the arrowhead of role equivalences gathered from {@link LayoutLiterals}
-	 */
-	private static final IColorConstant COLOR_CONNECTIONS = LayoutLiterals.COLOR_CONNECTIONS,
-										COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD;		
-	
 	/**
 	 * Class constructor
 	 */
diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleProhibitionPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleProhibitionPattern.java
index 8da15177..18cec74c 100644
--- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleProhibitionPattern.java
+++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/roleconstraint/RoleProhibitionPattern.java
@@ -9,11 +9,9 @@ import org.eclipse.graphiti.mm.pictograms.Anchor;
 import org.eclipse.graphiti.mm.pictograms.Connection;
 import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
 import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.util.IColorConstant;
 import org.framed.iorm.model.Relation;
 import org.framed.iorm.model.Type;
 import org.framed.iorm.ui.literals.IdentifierLiterals;
-import org.framed.iorm.ui.literals.LayoutLiterals;
 import org.framed.iorm.ui.literals.NameLiterals;
 import org.framed.iorm.ui.util.PropertyUtil;
 
@@ -40,17 +38,6 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern {
 	 */
 	private static final String IMG_ID_FEATURE_ROLEPROHIBITION = IdentifierLiterals.IMG_ID_FEATURE_ROLEPROHIBITION;
 	
-	/**
-	 * the layout integers used to layout the arrowhead of the role equivalences gathered from {@link LayoutLiterals}
-	 */
-	private static final int ARROWHEAD_LENGTH = LayoutLiterals.ARROWHEAD_LENGTH,
-							 ARROWHEAD_HEIGHT = LayoutLiterals.ARROWHEAD_HEIGHT;
-	
-	/**
-	 * the color values used for the polyline gathered from {@link LayoutLiterals}
-	 */
-	private static final IColorConstant COLOR_CONNECTIONS = LayoutLiterals.COLOR_CONNECTIONS;		
-	
 	/**
 	 * Class constructor
 	 */
-- 
GitLab