From d39e906e0594d70c2ed02e7e6aed7f640ec0a8dc Mon Sep 17 00:00:00 2001 From: Kevin Kassin <KK@Medion-PC> Date: Sat, 29 Jul 2017 13:37:47 +0200 Subject: [PATCH] #Commit changed visual appearence of constraints further, relationsship now change their vis. appear. when they have an intrarelcon attached, changed editing tips for cardinalities --- .../iorm/ui/literals/LayoutLiterals.java | 24 ++++++++----- .../framed/iorm/ui/literals/TextLiterals.java | 6 ++-- ...actInterRelationshipConstraintPattern.java | 4 +-- ...elationshipExclusionConstraintPattern.java | 4 +-- ...ationshipImplicationConstraintPattern.java | 2 +- ...actIntraRelationshipConstraintPattern.java | 34 +++++++++++++------ .../AbstractRoleConstraintPattern.java | 4 +-- .../RoleEquivalencePattern.java | 8 ++--- .../RoleImplicationPattern.java | 4 +-- .../RoleProhibitionPattern.java | 6 ++-- .../ui/pattern/shapes/RoleTypePattern.java | 4 +-- 11 files changed, 61 insertions(+), 39 deletions(-) diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/LayoutLiterals.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/LayoutLiterals.java index 42f96950..9f11155f 100644 --- a/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/LayoutLiterals.java +++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/LayoutLiterals.java @@ -27,14 +27,22 @@ public class LayoutLiterals { * (1) the color of text or<br> * (2) the color of lines or<br> * (3) the color of backgrounds or<br> - * (4) the color of graphiti shapes shadows or<br> - * (5) the color of constraint texts and connections + * (4) the color of graphiti shapes shadows */ public static final IColorConstant COLOR_TEXT = IColorConstant.BLACK, COLOR_LINES = IColorConstant.BLACK, COLOR_BACKGROUND = IColorConstant.WHITE, - COLOR_SHADOW = IColorConstant.GRAY, - COLOR_CONSTRAINTS = IColorConstant.DARK_GRAY; + COLOR_SHADOW = IColorConstant.GRAY; + + /** + * color values related to constraints + * <p> + * can be:<br> + * (1) the color of constraint texts or<br> + * (2) the color of constraint connections + */ + public static final IColorConstant COLOR_CONSTRAINT_TEXT = IColorConstant.DARK_GRAY, + COLOR_CONSTRAINT_CONNECTION = IColorConstant.GRAY; /** * layout integer for wizards @@ -55,8 +63,8 @@ public class LayoutLiterals { * (1) the color for a label showing a valid configuration or<br> * (2) the color for a label showing an invalid configuration */ - public static Color COLOR_VALID_CONFIGURATION = new Color(Display.getCurrent(), 0, 0, 255), - COLOR_INVALID_CONFIGURATION = new Color(Display.getCurrent(), 255, 0, 0); + public static final Color COLOR_VALID_CONFIGURATION = new Color(Display.getCurrent(), 0, 0, 255), + COLOR_INVALID_CONFIGURATION = new Color(Display.getCurrent(), 255, 0, 0); /** * layout integers for graphiti shapes @@ -101,8 +109,8 @@ public class LayoutLiterals { /** * layout integers for the text of occurrence constraints */ - public static final int HEIGHT_OCCURRENCE_CONSTRAINT = 15, - WIDTH_OCCURRENCE_CONSTRAINT = 30; + public static final int HEIGHT_CONSTRAINT = 15, + WIDTH_CONSTRAINT = 30; /** * color value for connections diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/TextLiterals.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/TextLiterals.java index 0f8fdc57..8b33dbfd 100644 --- a/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/TextLiterals.java +++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/literals/TextLiterals.java @@ -31,7 +31,7 @@ public class TextLiterals { NAME_ALREADY_USED_COMPARTMENTTYPE = "Another compartment type already has the same name!", DIRECTEDITING_ROLETYPE = "A role types name cant be empty and cant contains spaces. Numbers are allowed but not as first symbol.", NAME_ALREADY_USED_ROLETYPE = "Another role type in this compartment type already has the same name!", - DIRECTEDITING_OCCURRENCE_CONSTRAINT = "The Occurrence Constraint has to be in the form <number/asterisk> or <number>..<number/asterisk>!"; + DIRECTEDITING_OCCURRENCE_CONSTRAINT = "The Occurrence Constraint has to be in the form <0-9/*> or <0-9>..<0-9/*>!"; /** * messages and titles used in the {@link EditRelationshipDialog} as tips when invalid inputs happen @@ -41,9 +41,9 @@ public class TextLiterals { EDITING_RELATIONSHIPS_NAME_ALREADY_USED_TITLE = "Relationships name is already used!", EDITING_RELATIONSHIPS_NAME_ALREADY_USED = "Another relationship already in this compartment type already has the same name!", EDITING_RELATIONSHIPS_SOURCE_CARDINALITY_TITLE = "Relationships source cardinality is invalid!", - EDITING_RELATIONSHIPS_SOURCE_CARDINALITY = "The source cardinality has to be in the form <number/asterisk> or <number>..<number/asterisk>!", + EDITING_RELATIONSHIPS_SOURCE_CARDINALITY = "The source cardinality has to be in the form <0-9/*> or <0-9>..<0-9/*>!", EDITING_RELATIONSHIPS_TARGET_CARDINALITY_TITLE = "Relationships target cardinality is invalid!", - EDITING_RELATIONSHIPS_TARGET_CARDINALITY = "The target cardinality has to be in the form <number/asterisk> or <number>..<number/asterisk>!"; + EDITING_RELATIONSHIPS_TARGET_CARDINALITY = "The target cardinality has to be in the form <0-9/*> or <0-9>..<0-9/*>!"; /** * reason messages used in the <em>updateNeeded</em> operations of the shape pattern 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 07b8cfd3..54585254 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 @@ -43,7 +43,7 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection /** * the color values used for the polyline and the arrowhead gathered from {@link LayoutLiterals} */ - protected final IColorConstant COLOR_CONSTRAINTS = LayoutLiterals.COLOR_CONSTRAINTS, + protected final IColorConstant COLOR_CONSTRAINT_CONNECTION = LayoutLiterals.COLOR_CONSTRAINT_CONNECTION, COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD; /** @@ -92,7 +92,7 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection connection.setStart(graphicalSourceAnchor); connection.setEnd(graphicalTargetAnchor); Polyline polyline = graphicAlgorithmService.createPolyline(connection); - polyline.setForeground(manageColor(COLOR_CONSTRAINTS)); + polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); polyline.setLineStyle(LineStyle.DASH); polyline.setLineWidth(2); return connection; diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipExclusionConstraintPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipExclusionConstraintPattern.java index 266944f0..ca2af745 100644 --- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipExclusionConstraintPattern.java +++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/interrelationship/RelationshipExclusionConstraintPattern.java @@ -95,13 +95,13 @@ public class RelationshipExclusionConstraintPattern extends AbstractInterRelatio 0, -1*ARROWHEAD_HEIGHT };//P3 Polyline polylineTarget = graphicAlgorithmService.createPolyline(connectionDecoratorTarget, points); polylineTarget.setLineWidth(2); - polylineTarget.setForeground(manageColor(COLOR_CONSTRAINTS)); + polylineTarget.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_INTER_REL_CON); ConnectionDecorator connectionDecoratorSource = pictogramElementCreateService.createConnectionDecorator(connection, false, 0, true); Polyline polylineSource = graphicAlgorithmService.createPolyline(connectionDecoratorSource, points); polylineSource.setLineWidth(2); - polylineSource.setForeground(manageColor(COLOR_CONSTRAINTS)); + polylineSource.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_INTER_REL_CON); //Step 4 link(connection, addedRoleImplication); 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 20e5cb1c..377dd230 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 @@ -94,7 +94,7 @@ public class RelationshipImplicationConstraintPattern extends AbstractInterRelat 0, 0, //P2 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3 Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points); - arrowhead.setForeground(manageColor(COLOR_CONSTRAINTS)); + arrowhead.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); arrowhead.setBackground(manageColor(COLOR_ARROWHEAD)); PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_INTER_REL_CON); //Step 4 diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/intrarelationship/AbstractIntraRelationshipConstraintPattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/intrarelationship/AbstractIntraRelationshipConstraintPattern.java index b7355060..f28e0b54 100644 --- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/intrarelationship/AbstractIntraRelationshipConstraintPattern.java +++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/connections/intrarelationship/AbstractIntraRelationshipConstraintPattern.java @@ -6,7 +6,9 @@ import org.eclipse.graphiti.features.context.IDeleteContext; import org.eclipse.graphiti.features.context.impl.AddContext; import org.eclipse.graphiti.features.context.impl.DeleteContext; import org.eclipse.graphiti.features.context.impl.MultiDeleteInfo; +import org.eclipse.graphiti.mm.algorithms.Polyline; import org.eclipse.graphiti.mm.algorithms.Text; +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; @@ -39,24 +41,23 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS /** * the identifier for the icon of the create feature gathered from {@link IdentifierLiterals} */ - private static final String IMG_ID_FEATURE_INTRARELATIONSHIP_CONSTRAINT = IdentifierLiterals.IMG_ID_FEATURE_INTRARELATIONSHIP_CONSTRAINT; + private final String IMG_ID_FEATURE_INTRARELATIONSHIP_CONSTRAINT = IdentifierLiterals.IMG_ID_FEATURE_INTRARELATIONSHIP_CONSTRAINT; /** * the value of the property shape id for the decorators added to the relationship by the intra relationship constraint gathered * from {@link IdentifierLiterals} */ - protected static final String SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR = IdentifierLiterals.SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR; + private final String SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR = IdentifierLiterals.SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR; /** - * the color values gathered from {@link LayoutLiterals} + * height of the text shape for the intra relationship constraint */ - protected static final IColorConstant COLOR_CONNECTIONS = LayoutLiterals.COLOR_CONNECTIONS, - COLOR_CONSTRAINTS = LayoutLiterals.COLOR_CONSTRAINTS; + private final int HEIGHT_CONSTRAINT = LayoutLiterals.HEIGHT_CONSTRAINT; /** - * layout integers gathered from {@link LayoutLiterals} + * the color values gathered from {@link LayoutLiterals} */ - protected static final int DISTANCE_FROM_CONNECTION_LINE = LayoutLiterals.DISTANCE_FROM_CONNECTION_LINE; + private final IColorConstant COLOR_CONSTRAINT_TEXT = LayoutLiterals.COLOR_CONSTRAINT_TEXT; /** * Class constructor @@ -130,7 +131,8 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS } /** - * adds the graphical representation of an intra relationship constraint in the relationship + * adds the graphical representation of an intra relationship constraint in the relationship and changes the visual + * appearance of the relationship if it didn't had an intra relationship constraint before * <p> * @param addContext the context which has a reference to the relationship to add the constraint to * @param type the type of the constraint to add @@ -138,10 +140,15 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS */ public PictogramElement addIntraRelationshipConstraint(IAddContext addContext, Type type) { Connection targetConnection = addContext.getTargetConnection(); + Relation targetRelation = (Relation) getBusinessObjectForPictogramElement(targetConnection); + Polyline poyline = (Polyline) targetConnection.getGraphicsAlgorithm(); + int numberOfReferencedRelations = targetRelation.getReferencedRelation().size(); + poyline.setLineStyle(LineStyle.DASH); ConnectionDecorator constraintName = pictogramElementCreateService.createConnectionDecorator(targetConnection, true, 0.5, true); Text nameText = graphicAlgorithmService.createText(constraintName, type.getName().toLowerCase()); - nameText.setForeground(manageColor(COLOR_CONSTRAINTS)); + nameText.setForeground(manageColor(COLOR_CONSTRAINT_TEXT)); + graphicAlgorithmService.setLocation(nameText, 0, (numberOfReferencedRelations-1)*HEIGHT_CONSTRAINT); PropertyUtil.setShape_IdValue(constraintName, SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR); link(constraintName, addContext.getNewObject()); return constraintName; @@ -197,10 +204,17 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS //delete feature //~~~~~~~~~~~~~~ /** - * disables the "Are you sure?" message when intra relationship constraints + * disables the "Are you sure?" message when intra relationship constraints and changes the visual appearance of the + * relation if it does not longer has a intra relationship constraint after the execution of delete */ @Override public void delete(IDeleteContext deleteContext) { + Connection targetConnection = ((ConnectionDecorator) deleteContext.getPictogramElement()).getConnection(); + Relation targetRelation = (Relation) getBusinessObjectForPictogramElement(targetConnection); + if(targetRelation.getReferencedRelation().size() == 1) { + Polyline poyline = (Polyline) targetConnection.getGraphicsAlgorithm(); + poyline.setLineStyle(LineStyle.SOLID); + } ((DeleteContext) deleteContext).setMultiDeleteInfo(new MultiDeleteInfo(false, false, 0)); super.delete(deleteContext); } 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 dae9a31a..29dab692 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 @@ -38,12 +38,12 @@ public abstract class AbstractRoleConstraintPattern extends FRaMEDConnectionPatt * 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; + 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, + protected static final IColorConstant COLOR_CONSTRAINT_CONNECTION = LayoutLiterals.COLOR_CONSTRAINT_CONNECTION, 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 2ee41008..2739e70c 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 @@ -93,8 +93,8 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern { connection.setStart(sourceAnchor); connection.setEnd(targetAnchor); Polyline polyline = graphicAlgorithmService.createPolyline(connection); - polyline.setForeground(manageColor(COLOR_CONNECTIONS)); - polyline.setLineStyle(LineStyle.DASHDOT); + polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); + polyline.setLineStyle(LineStyle.DASH); polyline.setLineWidth(2); //Step2 ConnectionDecorator connectionDecoratorTarget; @@ -103,7 +103,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern { 0, 0, //P2 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT };//P3 Polygon arrowheadTarget = graphicAlgorithmService.createPolygon(connectionDecoratorTarget, pointsTarget); - arrowheadTarget.setForeground(manageColor(COLOR_CONNECTIONS)); + arrowheadTarget.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); arrowheadTarget.setBackground(manageColor(COLOR_ARROWHEAD)); PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); ConnectionDecorator connectionDecoratorSource; @@ -112,7 +112,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern { 0, 0, //P2 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3 Polygon arrowheadSource = graphicAlgorithmService.createPolygon(connectionDecoratorSource, pointsSource); - arrowheadSource.setForeground(manageColor(COLOR_CONNECTIONS)); + arrowheadSource.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); arrowheadSource.setBackground(manageColor(COLOR_ARROWHEAD)); PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); //Step 3 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 9ac53cdc..06e85830 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 @@ -94,7 +94,7 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern { connection.setStart(sourceAnchor); connection.setEnd(targetAnchor); Polyline polyline = graphicAlgorithmService.createPolyline(connection); - polyline.setForeground(manageColor(COLOR_CONNECTIONS)); + polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); polyline.setLineStyle(LineStyle.DASH); polyline.setLineWidth(2); //Step2 @@ -104,7 +104,7 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern { 0, 0, //P2 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3 Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points); - arrowhead.setForeground(manageColor(COLOR_CONNECTIONS)); + arrowhead.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); arrowhead.setBackground(manageColor(COLOR_ARROWHEAD)); PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); //Step 3 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 75c335bc..d23aa08e 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 @@ -92,7 +92,7 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern { connection.setStart(sourceAnchor); connection.setEnd(targetAnchor); Polyline polyline = graphicAlgorithmService.createPolyline(connection); - polyline.setForeground(manageColor(COLOR_CONNECTIONS)); + polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); polyline.setLineStyle(LineStyle.DASH); polyline.setLineWidth(2); //Step2 @@ -103,13 +103,13 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern { 0, -1*ARROWHEAD_HEIGHT }; //P3 Polyline polylineTarget = graphicAlgorithmService.createPolyline(connectionDecoratorTarget, points); polylineTarget.setLineWidth(2); - polylineTarget.setForeground(manageColor(COLOR_CONNECTIONS)); + polylineTarget.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); ConnectionDecorator connectionDecoratorSource = pictogramElementCreateService.createConnectionDecorator(connection, false, 0, true); Polyline polylineSource = graphicAlgorithmService.createPolyline(connectionDecoratorSource, points); polylineSource.setLineWidth(2); - polylineSource.setForeground(manageColor(COLOR_CONNECTIONS)); + polylineSource.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION)); PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); //Step 3 link(connection, addedRoleProhibtion); diff --git a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/shapes/RoleTypePattern.java b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/shapes/RoleTypePattern.java index c2bb496f..a89cb304 100644 --- a/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/shapes/RoleTypePattern.java +++ b/org.framed.iorm.ui/src/org/framed/iorm/ui/pattern/shapes/RoleTypePattern.java @@ -130,8 +130,8 @@ public class RoleTypePattern extends FRaMEDShapePattern implements IPattern { SHADOW_SIZE = LayoutLiterals.SHADOW_SIZE, HEIGHT_ATTRIBUTE_SHAPE = LayoutLiterals.HEIGHT_ATTRITBUTE_SHAPE, HEIGHT_OPERATION_SHAPE = LayoutLiterals.HEIGHT_OPERATION_SHAPE, - HEIGHT_OCCURRENCE_CONSTRAINT = LayoutLiterals.HEIGHT_OCCURRENCE_CONSTRAINT, - WIDTH_OCCURRENCE_CONSTRAINT = LayoutLiterals.WIDTH_OCCURRENCE_CONSTRAINT; + HEIGHT_OCCURRENCE_CONSTRAINT = LayoutLiterals.HEIGHT_CONSTRAINT, + WIDTH_OCCURRENCE_CONSTRAINT = LayoutLiterals.WIDTH_CONSTRAINT; /** * colors gathered from {@link LayoutLiterals}, look there for reference -- GitLab