Skip to content

Commit b1a234a

Browse files
froueneAxelRICHARD
authored andcommitted
[1024] Add wrap option on definition and usage node label
Bug: #1024 Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
1 parent 3a0e527 commit b1a234a

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

CHANGELOG.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
- https://github.com/eclipse-syson/syson/issues/938[#938] [general-view] Add `Satisfy Requirement Usage` to General View diagram.
2626
A new creation tool is available in the `Requirements` section of the palette, allowing the creation of `Satisfy Requirement Usage` objects.
2727
A new dra & drop tool is available on the diagram, allowing moving `Satisfy Requirement Usage` graphical nodes on the diagram.
28-
- The `General View` diagram is now proposed first when creating a diagram.
28+
- [explorer] The `General View` diagram is now proposed first when creating a diagram.
29+
- https://github.com/eclipse-syson/syson/issues/1024[#1024] [diagrams] Allow `Usage` and `Definition` graphical node labels to be wrapped to handle long names more easily.
2930

3031
=== New features
3132

backend/services/syson-services/src/main/java/org/eclipse/syson/util/ViewConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023, 2024 Obeo.
2+
* Copyright (c) 2023, 2025 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
@@ -19,7 +19,7 @@
1919
*/
2020
public class ViewConstants {
2121

22-
public static final String DEFAULT_NODE_WIDTH = "125";
22+
public static final String DEFAULT_NODE_WIDTH = "155";
2323

2424
public static final String DEFAULT_COMPARTMENT_NODE_HEIGHT = "60";
2525

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2025 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
@@ -30,6 +30,7 @@
3030
import org.eclipse.sirius.components.view.diagram.InsideLabelDescription;
3131
import org.eclipse.sirius.components.view.diagram.InsideLabelPosition;
3232
import org.eclipse.sirius.components.view.diagram.InsideLabelStyle;
33+
import org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy;
3334
import org.eclipse.sirius.components.view.diagram.LabelTextAlign;
3435
import org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription;
3536
import org.eclipse.sirius.components.view.diagram.NodeDescription;
@@ -174,6 +175,7 @@ protected InsideLabelDescription createInsideLabelDescription() {
174175
.position(InsideLabelPosition.TOP_CENTER)
175176
.style(this.createInsideLabelStyle())
176177
.textAlign(LabelTextAlign.CENTER)
178+
.overflowStrategy(LabelOverflowStrategy.WRAP)
177179
.build();
178180
}
179181

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2025 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
@@ -27,6 +27,7 @@
2727
import org.eclipse.sirius.components.view.diagram.InsideLabelDescription;
2828
import org.eclipse.sirius.components.view.diagram.InsideLabelPosition;
2929
import org.eclipse.sirius.components.view.diagram.InsideLabelStyle;
30+
import org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy;
3031
import org.eclipse.sirius.components.view.diagram.LabelTextAlign;
3132
import org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription;
3233
import org.eclipse.sirius.components.view.diagram.NodeDescription;
@@ -171,6 +172,7 @@ protected InsideLabelDescription createInsideLabelDescription() {
171172
.position(InsideLabelPosition.TOP_CENTER)
172173
.style(this.createInsideLabelStyle())
173174
.textAlign(LabelTextAlign.CENTER)
175+
.overflowStrategy(LabelOverflowStrategy.WRAP)
174176
.build();
175177
}
176178

doc/content/modules/user-manual/pages/release-notes/2025.4.0.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ A new creation tool can be found in the `Requirements` section of the palette.
4444
image::release-notes-gv-satisfy-requirement-usage.png[Satisfy Requirement Usage node creation tool, width=50%, height=50%]
4545

4646
- The `General View` diagram is now proposed first when creating a diagram.
47+
- It is now possible, in diagrams, to reduce the width of `Usages` (e.g. `Part`) and `Definition` (e.g. `Part Definition`) graphical nodes with a long name as their label can now be wrapped.
4748

4849

4950
== Dependency update

0 commit comments

Comments
 (0)