From 35d40d07e241628871f1fbb78bc9080eea8f8e23 Mon Sep 17 00:00:00 2001 From: farihatanjin Date: Mon, 8 Mar 2021 09:49:10 -0500 Subject: [PATCH] #416 fix issues with PR --- .../cs/jetuml/diagram/builder/ClassDiagramBuilder.java | 4 ++-- .../cs/jetuml/diagram/builder/DiagramBuilder.java | 2 +- .../jetuml/diagram/builder/ObjectDiagramBuilder.java | 4 ++-- .../jetuml/diagram/builder/SequenceDiagramBuilder.java | 4 ++-- .../cs/jetuml/diagram/builder/StateDiagramBuilder.java | 4 ++-- .../jetuml/diagram/builder/UseCaseDiagramBuilder.java | 4 ++-- .../constraints/ClassDiagramEdgeConstraints.java | 10 +--------- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/ClassDiagramBuilder.java b/src/ca/mcgill/cs/jetuml/diagram/builder/ClassDiagramBuilder.java index 9a0a7e397..84e489a55 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/ClassDiagramBuilder.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/ClassDiagramBuilder.java @@ -48,7 +48,7 @@ public class ClassDiagramBuilder extends DiagramBuilder { private static final int PADDING = 10; private static final int TOP_HEIGHT = 20; - private static final ConstraintSet constraints = new ConstraintSet( + private static final ConstraintSet CONSTRAINTS = new ConstraintSet( EdgeConstraints.noteEdge(), EdgeConstraints.noteNode(), EdgeConstraints.maxEdges(1), @@ -114,7 +114,7 @@ public DiagramOperation createAddNodeOperation(Node pNode, Point pRequestedPosit @Override protected ConstraintSet getEdgeConstraints() { - return constraints; + return CONSTRAINTS; } private static boolean validChild(Node pPotentialChild) diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/DiagramBuilder.java b/src/ca/mcgill/cs/jetuml/diagram/builder/DiagramBuilder.java index fc4b66eaf..22036be82 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/DiagramBuilder.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/DiagramBuilder.java @@ -136,7 +136,7 @@ public final boolean canAdd(Edge pEdge, Point pStart, Point pEnd) } - return this.getEdgeConstraints().satisfied(pEdge, startNode.get(), endNode.get(), pStart, pEnd, aDiagram); + return getEdgeConstraints().satisfied(pEdge, startNode.get(), endNode.get(), pStart, pEnd, aDiagram); } diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/ObjectDiagramBuilder.java b/src/ca/mcgill/cs/jetuml/diagram/builder/ObjectDiagramBuilder.java index e08ed64c6..802463c52 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/ObjectDiagramBuilder.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/ObjectDiagramBuilder.java @@ -40,7 +40,7 @@ */ public class ObjectDiagramBuilder extends DiagramBuilder { - private static final ConstraintSet constraints = new ConstraintSet( + private static final ConstraintSet CONSTRAINTS = new ConstraintSet( EdgeConstraints.noteEdge(), EdgeConstraints.noteNode(), @@ -64,7 +64,7 @@ public ObjectDiagramBuilder( Diagram pDiagram ) @Override protected ConstraintSet getEdgeConstraints() { - return constraints; + return CONSTRAINTS; } @Override diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/SequenceDiagramBuilder.java b/src/ca/mcgill/cs/jetuml/diagram/builder/SequenceDiagramBuilder.java index 42f093484..e53ef45eb 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/SequenceDiagramBuilder.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/SequenceDiagramBuilder.java @@ -52,7 +52,7 @@ public class SequenceDiagramBuilder extends DiagramBuilder { private static final int CALL_NODE_YGAP = 5; private static final ImplicitParameterNodeViewer IMPLICIT_PARAMETER_NODE_VIEWER = new ImplicitParameterNodeViewer(); - private static final ConstraintSet constraints = new ConstraintSet( + private static final ConstraintSet CONSTRAINTS = new ConstraintSet( EdgeConstraints.noteEdge(), EdgeConstraints.noteNode(), EdgeConstraints.maxEdges(1), @@ -78,7 +78,7 @@ public SequenceDiagramBuilder( Diagram pDiagram ) protected ConstraintSet getEdgeConstraints() { - return constraints; + return CONSTRAINTS; } /** diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/StateDiagramBuilder.java b/src/ca/mcgill/cs/jetuml/diagram/builder/StateDiagramBuilder.java index 3239043ac..d98b71dac 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/StateDiagramBuilder.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/StateDiagramBuilder.java @@ -39,7 +39,7 @@ public class StateDiagramBuilder extends DiagramBuilder * @param pDiagram The diagram to wrap around. * @pre pDiagram != null; */ - private static final ConstraintSet constraints = new ConstraintSet( + private static final ConstraintSet CONSTRAINTS = new ConstraintSet( EdgeConstraints.noteEdge(), EdgeConstraints.noteNode(), @@ -57,6 +57,6 @@ public StateDiagramBuilder( Diagram pDiagram ) @Override protected ConstraintSet getEdgeConstraints() { - return constraints; + return CONSTRAINTS; } } diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/UseCaseDiagramBuilder.java b/src/ca/mcgill/cs/jetuml/diagram/builder/UseCaseDiagramBuilder.java index 56803f0e4..e9befed9e 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/UseCaseDiagramBuilder.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/UseCaseDiagramBuilder.java @@ -32,7 +32,7 @@ */ public class UseCaseDiagramBuilder extends DiagramBuilder { - private static final ConstraintSet constraints = new ConstraintSet( + private static final ConstraintSet CONSTRAINTS = new ConstraintSet( EdgeConstraints.noteEdge(), EdgeConstraints.noteNode(), @@ -55,6 +55,6 @@ public UseCaseDiagramBuilder( Diagram pDiagram ) @Override protected ConstraintSet getEdgeConstraints() { - return constraints; + return CONSTRAINTS; } } diff --git a/src/ca/mcgill/cs/jetuml/diagram/builder/constraints/ClassDiagramEdgeConstraints.java b/src/ca/mcgill/cs/jetuml/diagram/builder/constraints/ClassDiagramEdgeConstraints.java index bd73b5da6..7b5183288 100644 --- a/src/ca/mcgill/cs/jetuml/diagram/builder/constraints/ClassDiagramEdgeConstraints.java +++ b/src/ca/mcgill/cs/jetuml/diagram/builder/constraints/ClassDiagramEdgeConstraints.java @@ -36,15 +36,7 @@ */ public final class ClassDiagramEdgeConstraints { - private ClassDiagramEdgeConstraints() { - - noSelfGeneralization(); - noSelfDependency(); - noDirectCycles(GeneralizationEdge.class); - noDirectCycles(AggregationEdge.class); - noDirectCycles(AssociationEdge.class); - noCombinedAssociationAggregation(); - } + private ClassDiagramEdgeConstraints() {} /* * Self edges are not allowed for Generalization edges.