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

#Commit

changed visual appearence of constraints further,
relationsship now change their vis. appear. when they have an
intrarelcon attached,
changed editing tips for cardinalities
parent cfb4b656
Branches
No related tags found
No related merge requests found
Showing
with 61 additions and 39 deletions
...@@ -27,14 +27,22 @@ public class LayoutLiterals { ...@@ -27,14 +27,22 @@ public class LayoutLiterals {
* (1) the color of text or<br> * (1) the color of text or<br>
* (2) the color of lines or<br> * (2) the color of lines or<br>
* (3) the color of backgrounds or<br> * (3) the color of backgrounds or<br>
* (4) the color of graphiti shapes shadows or<br> * (4) the color of graphiti shapes shadows
* (5) the color of constraint texts and connections
*/ */
public static final IColorConstant COLOR_TEXT = IColorConstant.BLACK, public static final IColorConstant COLOR_TEXT = IColorConstant.BLACK,
COLOR_LINES = IColorConstant.BLACK, COLOR_LINES = IColorConstant.BLACK,
COLOR_BACKGROUND = IColorConstant.WHITE, COLOR_BACKGROUND = IColorConstant.WHITE,
COLOR_SHADOW = IColorConstant.GRAY, COLOR_SHADOW = IColorConstant.GRAY;
COLOR_CONSTRAINTS = IColorConstant.DARK_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 * layout integer for wizards
...@@ -55,7 +63,7 @@ public class LayoutLiterals { ...@@ -55,7 +63,7 @@ public class LayoutLiterals {
* (1) the color for a label showing a valid configuration or<br> * (1) the color for a label showing a valid configuration or<br>
* (2) the color for a label showing an invalid configuration * (2) the color for a label showing an invalid configuration
*/ */
public static Color COLOR_VALID_CONFIGURATION = new Color(Display.getCurrent(), 0, 0, 255), public static final Color COLOR_VALID_CONFIGURATION = new Color(Display.getCurrent(), 0, 0, 255),
COLOR_INVALID_CONFIGURATION = new Color(Display.getCurrent(), 255, 0, 0); COLOR_INVALID_CONFIGURATION = new Color(Display.getCurrent(), 255, 0, 0);
/** /**
...@@ -101,8 +109,8 @@ public class LayoutLiterals { ...@@ -101,8 +109,8 @@ public class LayoutLiterals {
/** /**
* layout integers for the text of occurrence constraints * layout integers for the text of occurrence constraints
*/ */
public static final int HEIGHT_OCCURRENCE_CONSTRAINT = 15, public static final int HEIGHT_CONSTRAINT = 15,
WIDTH_OCCURRENCE_CONSTRAINT = 30; WIDTH_CONSTRAINT = 30;
/** /**
* color value for connections * color value for connections
......
...@@ -31,7 +31,7 @@ public class TextLiterals { ...@@ -31,7 +31,7 @@ public class TextLiterals {
NAME_ALREADY_USED_COMPARTMENTTYPE = "Another compartment type already has the same name!", 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.", 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!", 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 * messages and titles used in the {@link EditRelationshipDialog} as tips when invalid inputs happen
...@@ -41,9 +41,9 @@ public class TextLiterals { ...@@ -41,9 +41,9 @@ public class TextLiterals {
EDITING_RELATIONSHIPS_NAME_ALREADY_USED_TITLE = "Relationships name is already used!", 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_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_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_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 * reason messages used in the <em>updateNeeded</em> operations of the shape pattern
......
...@@ -43,7 +43,7 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection ...@@ -43,7 +43,7 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection
/** /**
* the color values used for the polyline and the arrowhead gathered from {@link LayoutLiterals} * 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; COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD;
/** /**
...@@ -92,7 +92,7 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection ...@@ -92,7 +92,7 @@ public class AbstractInterRelationshipConstraintPattern extends FRaMEDConnection
connection.setStart(graphicalSourceAnchor); connection.setStart(graphicalSourceAnchor);
connection.setEnd(graphicalTargetAnchor); connection.setEnd(graphicalTargetAnchor);
Polyline polyline = graphicAlgorithmService.createPolyline(connection); Polyline polyline = graphicAlgorithmService.createPolyline(connection);
polyline.setForeground(manageColor(COLOR_CONSTRAINTS)); polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
polyline.setLineStyle(LineStyle.DASH); polyline.setLineStyle(LineStyle.DASH);
polyline.setLineWidth(2); polyline.setLineWidth(2);
return connection; return connection;
......
...@@ -95,13 +95,13 @@ public class RelationshipExclusionConstraintPattern extends AbstractInterRelatio ...@@ -95,13 +95,13 @@ public class RelationshipExclusionConstraintPattern extends AbstractInterRelatio
0, -1*ARROWHEAD_HEIGHT };//P3 0, -1*ARROWHEAD_HEIGHT };//P3
Polyline polylineTarget = graphicAlgorithmService.createPolyline(connectionDecoratorTarget, points); Polyline polylineTarget = graphicAlgorithmService.createPolyline(connectionDecoratorTarget, points);
polylineTarget.setLineWidth(2); polylineTarget.setLineWidth(2);
polylineTarget.setForeground(manageColor(COLOR_CONSTRAINTS)); polylineTarget.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_INTER_REL_CON); PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_INTER_REL_CON);
ConnectionDecorator connectionDecoratorSource = ConnectionDecorator connectionDecoratorSource =
pictogramElementCreateService.createConnectionDecorator(connection, false, 0, true); pictogramElementCreateService.createConnectionDecorator(connection, false, 0, true);
Polyline polylineSource = graphicAlgorithmService.createPolyline(connectionDecoratorSource, points); Polyline polylineSource = graphicAlgorithmService.createPolyline(connectionDecoratorSource, points);
polylineSource.setLineWidth(2); polylineSource.setLineWidth(2);
polylineSource.setForeground(manageColor(COLOR_CONSTRAINTS)); polylineSource.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_INTER_REL_CON); PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_INTER_REL_CON);
//Step 4 //Step 4
link(connection, addedRoleImplication); link(connection, addedRoleImplication);
......
...@@ -94,7 +94,7 @@ public class RelationshipImplicationConstraintPattern extends AbstractInterRelat ...@@ -94,7 +94,7 @@ public class RelationshipImplicationConstraintPattern extends AbstractInterRelat
0, 0, //P2 0, 0, //P2
-1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3
Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points); Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points);
arrowhead.setForeground(manageColor(COLOR_CONSTRAINTS)); arrowhead.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
arrowhead.setBackground(manageColor(COLOR_ARROWHEAD)); arrowhead.setBackground(manageColor(COLOR_ARROWHEAD));
PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_INTER_REL_CON); PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_INTER_REL_CON);
//Step 4 //Step 4
......
...@@ -6,7 +6,9 @@ import org.eclipse.graphiti.features.context.IDeleteContext; ...@@ -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.AddContext;
import org.eclipse.graphiti.features.context.impl.DeleteContext; import org.eclipse.graphiti.features.context.impl.DeleteContext;
import org.eclipse.graphiti.features.context.impl.MultiDeleteInfo; 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.Text;
import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
import org.eclipse.graphiti.mm.pictograms.Anchor; import org.eclipse.graphiti.mm.pictograms.Anchor;
import org.eclipse.graphiti.mm.pictograms.Connection; import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator; import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
...@@ -39,24 +41,23 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS ...@@ -39,24 +41,23 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS
/** /**
* the identifier for the icon of the create feature gathered from {@link IdentifierLiterals} * 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 * the value of the property shape id for the decorators added to the relationship by the intra relationship constraint gathered
* from {@link IdentifierLiterals} * 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, private final int HEIGHT_CONSTRAINT = LayoutLiterals.HEIGHT_CONSTRAINT;
COLOR_CONSTRAINTS = LayoutLiterals.COLOR_CONSTRAINTS;
/** /**
* 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 * Class constructor
...@@ -130,7 +131,8 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS ...@@ -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> * <p>
* @param addContext the context which has a reference to the relationship to add the constraint to * @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 * @param type the type of the constraint to add
...@@ -138,10 +140,15 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS ...@@ -138,10 +140,15 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS
*/ */
public PictogramElement addIntraRelationshipConstraint(IAddContext addContext, Type type) { public PictogramElement addIntraRelationshipConstraint(IAddContext addContext, Type type) {
Connection targetConnection = addContext.getTargetConnection(); 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 = ConnectionDecorator constraintName =
pictogramElementCreateService.createConnectionDecorator(targetConnection, true, 0.5, true); pictogramElementCreateService.createConnectionDecorator(targetConnection, true, 0.5, true);
Text nameText = graphicAlgorithmService.createText(constraintName, type.getName().toLowerCase()); 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); PropertyUtil.setShape_IdValue(constraintName, SHAPE_ID_INTRA_REL_CON_NAME_DECORATOR);
link(constraintName, addContext.getNewObject()); link(constraintName, addContext.getNewObject());
return constraintName; return constraintName;
...@@ -197,10 +204,17 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS ...@@ -197,10 +204,17 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS
//delete feature //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 @Override
public void delete(IDeleteContext deleteContext) { 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)); ((DeleteContext) deleteContext).setMultiDeleteInfo(new MultiDeleteInfo(false, false, 0));
super.delete(deleteContext); super.delete(deleteContext);
} }
......
...@@ -43,7 +43,7 @@ public abstract class AbstractRoleConstraintPattern extends FRaMEDConnectionPatt ...@@ -43,7 +43,7 @@ public abstract class AbstractRoleConstraintPattern extends FRaMEDConnectionPatt
/** /**
* the color values used for the polyline and the arrowhead gathered from {@link LayoutLiterals} * 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; COLOR_ARROWHEAD = LayoutLiterals.COLOR_ARROWHEAD;
//add feature //add feature
......
...@@ -93,8 +93,8 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern { ...@@ -93,8 +93,8 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern {
connection.setStart(sourceAnchor); connection.setStart(sourceAnchor);
connection.setEnd(targetAnchor); connection.setEnd(targetAnchor);
Polyline polyline = graphicAlgorithmService.createPolyline(connection); Polyline polyline = graphicAlgorithmService.createPolyline(connection);
polyline.setForeground(manageColor(COLOR_CONNECTIONS)); polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
polyline.setLineStyle(LineStyle.DASHDOT); polyline.setLineStyle(LineStyle.DASH);
polyline.setLineWidth(2); polyline.setLineWidth(2);
//Step2 //Step2
ConnectionDecorator connectionDecoratorTarget; ConnectionDecorator connectionDecoratorTarget;
...@@ -103,7 +103,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern { ...@@ -103,7 +103,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern {
0, 0, //P2 0, 0, //P2
-1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT };//P3 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT };//P3
Polygon arrowheadTarget = graphicAlgorithmService.createPolygon(connectionDecoratorTarget, pointsTarget); Polygon arrowheadTarget = graphicAlgorithmService.createPolygon(connectionDecoratorTarget, pointsTarget);
arrowheadTarget.setForeground(manageColor(COLOR_CONNECTIONS)); arrowheadTarget.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
arrowheadTarget.setBackground(manageColor(COLOR_ARROWHEAD)); arrowheadTarget.setBackground(manageColor(COLOR_ARROWHEAD));
PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR);
ConnectionDecorator connectionDecoratorSource; ConnectionDecorator connectionDecoratorSource;
...@@ -112,7 +112,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern { ...@@ -112,7 +112,7 @@ public class RoleEquivalencePattern extends AbstractRoleConstraintPattern {
0, 0, //P2 0, 0, //P2
-1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3
Polygon arrowheadSource = graphicAlgorithmService.createPolygon(connectionDecoratorSource, pointsSource); Polygon arrowheadSource = graphicAlgorithmService.createPolygon(connectionDecoratorSource, pointsSource);
arrowheadSource.setForeground(manageColor(COLOR_CONNECTIONS)); arrowheadSource.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
arrowheadSource.setBackground(manageColor(COLOR_ARROWHEAD)); arrowheadSource.setBackground(manageColor(COLOR_ARROWHEAD));
PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR);
//Step 3 //Step 3
......
...@@ -94,7 +94,7 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern { ...@@ -94,7 +94,7 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern {
connection.setStart(sourceAnchor); connection.setStart(sourceAnchor);
connection.setEnd(targetAnchor); connection.setEnd(targetAnchor);
Polyline polyline = graphicAlgorithmService.createPolyline(connection); Polyline polyline = graphicAlgorithmService.createPolyline(connection);
polyline.setForeground(manageColor(COLOR_CONNECTIONS)); polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
polyline.setLineStyle(LineStyle.DASH); polyline.setLineStyle(LineStyle.DASH);
polyline.setLineWidth(2); polyline.setLineWidth(2);
//Step2 //Step2
...@@ -104,7 +104,7 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern { ...@@ -104,7 +104,7 @@ public class RoleImplicationPattern extends AbstractRoleConstraintPattern {
0, 0, //P2 0, 0, //P2
-1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3 -1*ARROWHEAD_LENGTH, -1*ARROWHEAD_HEIGHT }; //P3
Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points); Polygon arrowhead = graphicAlgorithmService.createPolygon(connectionDecorator, points);
arrowhead.setForeground(manageColor(COLOR_CONNECTIONS)); arrowhead.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
arrowhead.setBackground(manageColor(COLOR_ARROWHEAD)); arrowhead.setBackground(manageColor(COLOR_ARROWHEAD));
PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); PropertyUtil.setShape_IdValue(connectionDecorator, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR);
//Step 3 //Step 3
......
...@@ -92,7 +92,7 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern { ...@@ -92,7 +92,7 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern {
connection.setStart(sourceAnchor); connection.setStart(sourceAnchor);
connection.setEnd(targetAnchor); connection.setEnd(targetAnchor);
Polyline polyline = graphicAlgorithmService.createPolyline(connection); Polyline polyline = graphicAlgorithmService.createPolyline(connection);
polyline.setForeground(manageColor(COLOR_CONNECTIONS)); polyline.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
polyline.setLineStyle(LineStyle.DASH); polyline.setLineStyle(LineStyle.DASH);
polyline.setLineWidth(2); polyline.setLineWidth(2);
//Step2 //Step2
...@@ -103,13 +103,13 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern { ...@@ -103,13 +103,13 @@ public class RoleProhibitionPattern extends AbstractRoleConstraintPattern {
0, -1*ARROWHEAD_HEIGHT }; //P3 0, -1*ARROWHEAD_HEIGHT }; //P3
Polyline polylineTarget = graphicAlgorithmService.createPolyline(connectionDecoratorTarget, points); Polyline polylineTarget = graphicAlgorithmService.createPolyline(connectionDecoratorTarget, points);
polylineTarget.setLineWidth(2); polylineTarget.setLineWidth(2);
polylineTarget.setForeground(manageColor(COLOR_CONNECTIONS)); polylineTarget.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); PropertyUtil.setShape_IdValue(connectionDecoratorTarget, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR);
ConnectionDecorator connectionDecoratorSource = ConnectionDecorator connectionDecoratorSource =
pictogramElementCreateService.createConnectionDecorator(connection, false, 0, true); pictogramElementCreateService.createConnectionDecorator(connection, false, 0, true);
Polyline polylineSource = graphicAlgorithmService.createPolyline(connectionDecoratorSource, points); Polyline polylineSource = graphicAlgorithmService.createPolyline(connectionDecoratorSource, points);
polylineSource.setLineWidth(2); polylineSource.setLineWidth(2);
polylineSource.setForeground(manageColor(COLOR_CONNECTIONS)); polylineSource.setForeground(manageColor(COLOR_CONSTRAINT_CONNECTION));
PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR); PropertyUtil.setShape_IdValue(connectionDecoratorSource, SHAPE_ID_ROLE_CONSTRAINT_DECORATOR);
//Step 3 //Step 3
link(connection, addedRoleProhibtion); link(connection, addedRoleProhibtion);
......
...@@ -130,8 +130,8 @@ public class RoleTypePattern extends FRaMEDShapePattern implements IPattern { ...@@ -130,8 +130,8 @@ public class RoleTypePattern extends FRaMEDShapePattern implements IPattern {
SHADOW_SIZE = LayoutLiterals.SHADOW_SIZE, SHADOW_SIZE = LayoutLiterals.SHADOW_SIZE,
HEIGHT_ATTRIBUTE_SHAPE = LayoutLiterals.HEIGHT_ATTRITBUTE_SHAPE, HEIGHT_ATTRIBUTE_SHAPE = LayoutLiterals.HEIGHT_ATTRITBUTE_SHAPE,
HEIGHT_OPERATION_SHAPE = LayoutLiterals.HEIGHT_OPERATION_SHAPE, HEIGHT_OPERATION_SHAPE = LayoutLiterals.HEIGHT_OPERATION_SHAPE,
HEIGHT_OCCURRENCE_CONSTRAINT = LayoutLiterals.HEIGHT_OCCURRENCE_CONSTRAINT, HEIGHT_OCCURRENCE_CONSTRAINT = LayoutLiterals.HEIGHT_CONSTRAINT,
WIDTH_OCCURRENCE_CONSTRAINT = LayoutLiterals.WIDTH_OCCURRENCE_CONSTRAINT; WIDTH_OCCURRENCE_CONSTRAINT = LayoutLiterals.WIDTH_CONSTRAINT;
/** /**
* colors gathered from {@link LayoutLiterals}, look there for reference * colors gathered from {@link LayoutLiterals}, look there for reference
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment