Skip to content

Commit 2e05393

Browse files
gcoutableAxelRICHARD
authored andcommitted
[2053] Fix the ForkNode and JoinNode rendering
Bug: #2053 Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
1 parent 956f883 commit 2e05393

File tree

11 files changed

+55
-32
lines changed

11 files changed

+55
-32
lines changed

CHANGELOG.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Now the _end_ keyword is not displayed anymore in the label of these graphical n
9999
- https://github.com/eclipse-syson/syson/issues/2057[#2057] [diagrams] Fix the support for removing the multiplicity using the direct edit.
100100
- https://github.com/eclipse-syson/syson/issues/1938[#1938] [diagrams] Fix an issue where the _New Flow (flow)_ tool between two parameters was broken.
101101
- https://github.com/eclipse-syson/syson/issues/2058[#2058] [diagrams] Fix error when importing SysML snippets referencing unknown units which could make the resluting model inconsistent
102+
- https://github.com/eclipse-syson/syson/issues/2053[#2053] [diagrams] Prevent incoming and outgoing graphical edges of a graphical `ForkNode` or `JoindNode` to point empty space.
102103

103104
=== Improvements
104105

@@ -153,6 +154,8 @@ Tweak the diagnostic messages to help users understand where the erroneous eleme
153154
Make sure diagnostics are sorted according to their validated element and its containing document.
154155
- https://github.com/eclipse-syson/syson/issues/2042[#2042] [import] Improve error reporting while uploading a document.
155156
- https://github.com/eclipse-syson/syson/issues/2057[#2057] [diagrams] Add the support for empty value for multiplicity in the ANTLR grammar.
157+
- https://github.com/eclipse-syson/syson/issues/2053[#2053] [diagrams] The graphical `ForkNode` and `JoinNode` now use `RectangularNodeStyleDescription` and are restricted to horizontal resizing.
158+
Consequently, their entire footprint is filled with black, ensuring that all incoming and outgoing edges maintain a valid connection point.
156159

157160
=== New features
158161

backend/application/syson-application/src/test/resources/scripts/database-content/GeneralView-IncludeUseCaseUsage.sql

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

backend/application/syson-application/src/test/resources/scripts/database-content/SysON-Studio.sql

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/AbstractControlNodeActionNodeDescriptionProvider.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.eclipse.sirius.components.view.diagram.EdgeTool;
2626
import org.eclipse.sirius.components.view.diagram.NodeDescription;
2727
import org.eclipse.sirius.components.view.diagram.NodePalette;
28+
import org.eclipse.sirius.components.view.diagram.NodeStyleDescription;
2829
import org.eclipse.sirius.components.view.diagram.OutsideLabelDescription;
2930
import org.eclipse.sirius.components.view.diagram.OutsideLabelPosition;
3031
import org.eclipse.sirius.components.view.diagram.OutsideLabelStyle;
@@ -69,12 +70,7 @@ public AbstractControlNodeActionNodeDescriptionProvider(IColorProvider colorProv
6970
*/
7071
protected abstract EClass getDomainType();
7172

72-
/**
73-
* Implementers should provide the path of the image associated to the actual node description.
74-
*
75-
* @return The String representing the path to access the image associated to the node description.
76-
*/
77-
protected abstract String getImagePath();
73+
protected abstract NodeStyleDescription createNodeStyleDescription();
7874

7975
/**
8076
* Implementers should provide the label used by the removal tool of the actual node description.
@@ -91,9 +87,7 @@ protected String getDefaultHeightExpression() {
9187
return "12";
9288
}
9389

94-
protected UserResizableDirection isNodeResizable() {
95-
return UserResizableDirection.BOTH;
96-
}
90+
protected abstract UserResizableDirection isNodeResizable();
9791

9892
@Override
9993
public NodeDescription create() {
@@ -107,7 +101,7 @@ public NodeDescription create() {
107101
.name(this.descriptionNameGenerator.getNodeName(this.getNodeDescriptionName()))
108102
.semanticCandidatesExpression(AQLUtils.getSelfServiceCallExpression("getExposedElements",
109103
List.of(domainType, org.eclipse.sirius.components.diagrams.description.NodeDescription.ANCESTORS, IEditingContext.EDITING_CONTEXT, DiagramContext.DIAGRAM_CONTEXT)))
110-
.style(this.createImageNodeStyleDescription(this.getImagePath()))
104+
.style(this.createNodeStyleDescription())
111105
.userResizable(this.isNodeResizable())
112106
.synchronizationPolicy(SynchronizationPolicy.SYNCHRONIZED)
113107
.build();

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/DecisionActionNodeDescriptionProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2026 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
1414

1515
import org.eclipse.emf.ecore.EClass;
1616
import org.eclipse.sirius.components.view.builder.providers.IColorProvider;
17+
import org.eclipse.sirius.components.view.diagram.NodeStyleDescription;
1718
import org.eclipse.sirius.components.view.diagram.UserResizableDirection;
1819
import org.eclipse.syson.sysml.SysmlPackage;
1920
import org.eclipse.syson.util.IDescriptionNameGenerator;
@@ -42,8 +43,8 @@ protected EClass getDomainType() {
4243
}
4344

4445
@Override
45-
protected String getImagePath() {
46-
return "images/decision_action.svg";
46+
protected NodeStyleDescription createNodeStyleDescription() {
47+
return this.createImageNodeStyleDescription("images/decision_action.svg");
4748
}
4849

4950
@Override

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/ForkActionNodeDescriptionProvider.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2026 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -14,6 +14,8 @@
1414

1515
import org.eclipse.emf.ecore.EClass;
1616
import org.eclipse.sirius.components.view.builder.providers.IColorProvider;
17+
import org.eclipse.sirius.components.view.diagram.NodeStyleDescription;
18+
import org.eclipse.sirius.components.view.diagram.UserResizableDirection;
1719
import org.eclipse.syson.sysml.SysmlPackage;
1820
import org.eclipse.syson.util.IDescriptionNameGenerator;
1921

@@ -41,12 +43,22 @@ protected EClass getDomainType() {
4143
}
4244

4345
@Override
44-
protected String getImagePath() {
45-
return "images/fork_action.svg";
46+
protected String getRemoveToolLabel() {
47+
return "Remove Fork";
4648
}
4749

4850
@Override
49-
protected String getRemoveToolLabel() {
50-
return "Remove Fork";
51+
protected UserResizableDirection isNodeResizable() {
52+
return UserResizableDirection.HORIZONTAL;
53+
}
54+
55+
@Override
56+
protected NodeStyleDescription createNodeStyleDescription() {
57+
return this.diagramBuilderHelper.newRectangularNodeStyleDescription()
58+
.borderColor(this.colorProvider.getColor("transparent"))
59+
.borderRadius(0)
60+
.borderSize(0)
61+
.background(this.colorProvider.getColor("black"))
62+
.build();
5163
}
5264
}

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/JoinActionNodeDescriptionProvider.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2026 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -14,6 +14,8 @@
1414

1515
import org.eclipse.emf.ecore.EClass;
1616
import org.eclipse.sirius.components.view.builder.providers.IColorProvider;
17+
import org.eclipse.sirius.components.view.diagram.NodeStyleDescription;
18+
import org.eclipse.sirius.components.view.diagram.UserResizableDirection;
1719
import org.eclipse.syson.sysml.SysmlPackage;
1820
import org.eclipse.syson.util.IDescriptionNameGenerator;
1921

@@ -41,12 +43,22 @@ protected EClass getDomainType() {
4143
}
4244

4345
@Override
44-
protected String getImagePath() {
45-
return "images/join_action.svg";
46+
protected String getRemoveToolLabel() {
47+
return "Remove Join";
4648
}
4749

4850
@Override
49-
protected String getRemoveToolLabel() {
50-
return "Remove Join";
51+
protected UserResizableDirection isNodeResizable() {
52+
return UserResizableDirection.HORIZONTAL;
53+
}
54+
55+
@Override
56+
protected NodeStyleDescription createNodeStyleDescription() {
57+
return this.diagramBuilderHelper.newRectangularNodeStyleDescription()
58+
.borderColor(this.colorProvider.getColor("transparent"))
59+
.borderRadius(0)
60+
.borderSize(0)
61+
.background(this.colorProvider.getColor("black"))
62+
.build();
5163
}
5264
}

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/nodes/MergeActionNodeDescriptionProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2026 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
1414

1515
import org.eclipse.emf.ecore.EClass;
1616
import org.eclipse.sirius.components.view.builder.providers.IColorProvider;
17+
import org.eclipse.sirius.components.view.diagram.NodeStyleDescription;
1718
import org.eclipse.sirius.components.view.diagram.UserResizableDirection;
1819
import org.eclipse.syson.sysml.SysmlPackage;
1920
import org.eclipse.syson.util.IDescriptionNameGenerator;
@@ -42,8 +43,8 @@ protected EClass getDomainType() {
4243
}
4344

4445
@Override
45-
protected String getImagePath() {
46-
return "images/merge_action.svg";
46+
protected NodeStyleDescription createNodeStyleDescription() {
47+
return this.createImageNodeStyleDescription("images/merge_action.svg");
4748
}
4849

4950
@Override

backend/views/syson-diagram-common-view/src/main/resources/images/fork_action.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

backend/views/syson-diagram-common-view/src/main/resources/images/join_action.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)