Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions CHANGELOG.adoc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"close": "Close"
},
"manageVisibilityModalMenuCheckBox": {
"all": "All"
"all": "All"
},
"labelAppearancePart": {
"hide": "Hide",
Expand Down Expand Up @@ -201,7 +201,8 @@
"fillCircle": "Fill Circle",
"crossedCircle": "Crossed Circle",
"closedArrowWithVerticalBar": "Closed Arrow with Vertical Bar",
"closedArrowWithDots": "Closed Arrow with Dots",
"closedArrowWithDots": "Closed Arrow with two Dots",
"closedArrowWith4Dots": "Closed Arrow with four Dots",
"manhattan": "Manhattan",
"smartManhattan": "Smart Manhattan",
"oblique": "Oblique",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"close": "Fermer"
},
"manageVisibilityModalMenuCheckBox": {
"all": "Tous"
"all": "Tous"
},
"labelAppearancePart": {
"hide": "Masquer",
Expand Down Expand Up @@ -201,7 +201,8 @@
"fillCircle": "Cercle plein",
"crossedCircle": "Cercle croisé",
"closedArrowWithVerticalBar": "Flèche de sortie avec barre verticale",
"closedArrowWithDots": "Flèche de sortie avec points",
"closedArrowWithDots": "Flèche de sortie avec deux points",
"closedArrowWith4Dots": "Flèche de sortie avec quatre points",
"manhattan": "Manhattan",
"smartManhattan": "Manhattan intelligent",
"oblique": "Oblique",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ enum ArrowStyle {
CrossedCircle
ClosedArrowWithVerticalBar
ClosedArrowWithDots
ClosedArrowWith4Dots
}

enum EdgeType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2023 Obeo.
* Copyright (c) 2019, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -18,5 +18,5 @@
* @author hmarchadour
*/
public enum ArrowStyle {
None, OutputArrow, InputArrow, OutputClosedArrow, InputClosedArrow, OutputFillClosedArrow, InputFillClosedArrow, Diamond, FillDiamond, InputArrowWithDiamond, InputArrowWithFillDiamond, Circle, FillCircle, CrossedCircle, ClosedArrowWithVerticalBar, ClosedArrowWithDots
None, OutputArrow, InputArrow, OutputClosedArrow, InputClosedArrow, OutputFillClosedArrow, InputFillClosedArrow, Diamond, FillDiamond, InputArrowWithDiamond, InputArrowWithFillDiamond, Circle, FillCircle, CrossedCircle, ClosedArrowWithVerticalBar, ClosedArrowWithDots, ClosedArrowWith4Dots
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023, 2025 Obeo.
* Copyright (c) 2023, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -94,6 +94,8 @@ const getMarker = (markerProps: MarkerProps) => {
return <ClosedArrowWithVerticalBar {...markerProps} key={markerProps.id} />;
case 'ClosedArrowWithDots':
return <ClosedArrowWithDots {...markerProps} key={markerProps.id} />;
case 'ClosedArrowWith4Dots':
return <ClosedArrowWith4Dots {...markerProps} key={markerProps.id} />;
default:
return <InputFillClosedArrow {...markerProps} key={markerProps.id} />;
}
Expand Down Expand Up @@ -291,6 +293,25 @@ const ClosedArrowWithDots = ({ id, edgeColor }: MarkerProps) => {
);
};

const ClosedArrowWith4Dots = ({ id, edgeColor }: MarkerProps) => {
const theme = useTheme();
const strokeColor: string = getSelectedColor(id, edgeColor, theme);
return (
<marker {...buildMarkerAttributes(id, 15, 10, 14, 5)}>
<path
strokeWidth={1}
fill={theme.palette.background.default}
d={'m 7 1 L 14 5 L 7 9 L 7 1 z'}
stroke={strokeColor}
/>
<circle r={1} cx={1} cy={2} fill={strokeColor} stroke={'none'} />
<circle r={1} cx={1} cy={8} fill={strokeColor} stroke={'none'} />
<circle r={1} cx={4} cy={2} fill={strokeColor} stroke={'none'} />
<circle r={1} cx={4} cy={8} fill={strokeColor} stroke={'none'} />
</marker>
);
};

const getSelectedColor = (id: string, edgeColor: string, theme: Theme): string => {
const selectedColor: string =
id.endsWith('--selected') && theme.palette.selected ? theme.palette.selected : getCSSColor(edgeColor, theme);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const getArrowOption = (t: TFunction) => [
{ value: 'CrossedCircle', label: t('crossedCircle') },
{ value: 'ClosedArrowWithVerticalBar', label: t('closedArrowWithVerticalBar') },
{ value: 'ClosedArrowWithDots', label: t('closedArrowWithDots') },
{ value: 'ClosedArrowWith4Dots', label: t('closedArrowWith4Dots') },
];

const getEdgeTypeOptions = (t: TFunction) => [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024, 2025 Obeo.
* Copyright (c) 2024, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -26,8 +26,12 @@

import org.eclipse.sirius.components.collaborative.dto.CreateChildInput;
import org.eclipse.sirius.components.collaborative.dto.CreateChildSuccessPayload;
import org.eclipse.sirius.components.collaborative.forms.dto.EditSelectInput;
import org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.forms.AbstractWidget;
import org.eclipse.sirius.components.forms.Select;
import org.eclipse.sirius.components.forms.tests.graphql.EditSelectMutationRunner;
import org.eclipse.sirius.web.AbstractIntegrationTests;
import org.eclipse.sirius.web.application.views.details.dto.DetailsEventInput;
import org.eclipse.sirius.web.data.StudioIdentifiers;
Expand Down Expand Up @@ -61,6 +65,9 @@ public class DiagramViewControllerIntegrationTests extends AbstractIntegrationTe
@Autowired
private CreateChildMutationRunner createChildMutationRunner;

@Autowired
private EditSelectMutationRunner editSelectMutationRunner;

@Autowired
private DetailsEventSubscriptionRunner detailsEventSubscriptionRunner;

Expand Down Expand Up @@ -149,4 +156,96 @@ public void givenAViewWhenADiagramDescriptionIsCreatedThenItIsCreatedProperly()
}


@Test
@GivenSiriusWebServer
@DisplayName("Given a diagram description, when an edge style is edited, then it is possible to select the ClosedArrowWith4Dots arrow style")
public void givenADiagramDescriptionWhenAEdgeStyleIsEditedThenItIsPossibleToSelectTheClosedArrowWith4DotsArrowStyle() {
var objectId = "a2a3713f-57bc-422b-92e8-b22ed69e94a8"; // The edge style of the sample studio
var detailsRepresentationId = this.representationIdBuilder.buildDetailsRepresentationId(List.of(objectId));
var input = new DetailsEventInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_EDITING_CONTEXT_ID, detailsRepresentationId);
var flux = this.detailsEventSubscriptionRunner.run(input)
.flux()
.filter(FormRefreshedEventPayload.class::isInstance);

var sourceArrowStyleWidgetId = new AtomicReference<String>();
var targetArrowStyleWidgetId = new AtomicReference<String>();
var closedArrowWith4DotsValue = new AtomicReference<String>();

Consumer<Object> formContentBeforeEdit = assertRefreshedFormThat(form -> {
var firstPage = form.getPages().get(0);
var firstGroup = firstPage.getGroups().get(0);
var sourceArrowStyleWidget = firstGroup.getWidgets().stream()
.filter(Select.class::isInstance)
.map(Select.class::cast)
.filter(selectWidget -> Objects.equals("Source Arrow Style", selectWidget.getLabel()))
.findFirst();
assertThat(sourceArrowStyleWidget).isPresent();
assertThat(sourceArrowStyleWidget.get().getValue()).isEqualTo("0");
var sourceArrowStyleWidgetOptions = sourceArrowStyleWidget.get().getOptions();
var optClosedArrowWith4Dots = sourceArrowStyleWidgetOptions.stream()
.filter(selectOption -> Objects.equals("ClosedArrowWith4Dots", selectOption.getLabel()))
.findFirst();
assertThat(optClosedArrowWith4Dots).isPresent();
sourceArrowStyleWidgetId.set(sourceArrowStyleWidget.get().getId());
closedArrowWith4DotsValue.set(optClosedArrowWith4Dots.get().getId());

var targetArrowStyleWidget = firstGroup.getWidgets().stream()
.filter(Select.class::isInstance)
.map(Select.class::cast)
.filter(selectWidget -> Objects.equals("Target Arrow Style", selectWidget.getLabel()))
.findFirst();
assertThat(targetArrowStyleWidget).isPresent();
assertThat(targetArrowStyleWidget.get().getValue()).isEqualTo("2");
assertThat(targetArrowStyleWidget.get().getOptions()).anyMatch(selectOption -> Objects.equals("ClosedArrowWith4Dots", selectOption.getLabel()));
targetArrowStyleWidgetId.set(targetArrowStyleWidget.get().getId());
});

Runnable editSourceArrowStyle = () -> {
var editSelectSourceArrowStyleInput = new EditSelectInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_EDITING_CONTEXT_ID, detailsRepresentationId, sourceArrowStyleWidgetId.get(), closedArrowWith4DotsValue.get());
var result = this.editSelectMutationRunner.run(editSelectSourceArrowStyleInput);
var typename = JsonPath.read(result.data(), "$.data.editSelect.__typename");
assertThat(typename).isEqualTo(SuccessPayload.class.getSimpleName());
};

Consumer<Object> formContentAfterSourceArrowStyleEdit = assertRefreshedFormThat(form -> {
var firstPage = form.getPages().get(0);
var firstGroup = firstPage.getGroups().get(0);
var sourceArrowStyleWidget = firstGroup.getWidgets().stream()
.filter(Select.class::isInstance)
.map(Select.class::cast)
.filter(selectWidget -> Objects.equals("Source Arrow Style", selectWidget.getLabel()))
.findFirst();
assertThat(sourceArrowStyleWidget).isPresent();
assertThat(sourceArrowStyleWidget.get().getValue()).isEqualTo(closedArrowWith4DotsValue.get());
});

Runnable editTargetArrowStyle = () -> {
var editSelectTargetArrowStyleInput = new EditSelectInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_EDITING_CONTEXT_ID, detailsRepresentationId, targetArrowStyleWidgetId.get(), closedArrowWith4DotsValue.get());
var result = this.editSelectMutationRunner.run(editSelectTargetArrowStyleInput);
var typename = JsonPath.read(result.data(), "$.data.editSelect.__typename");
assertThat(typename).isEqualTo(SuccessPayload.class.getSimpleName());
};

Consumer<Object> formContentAfterTargetArrowStyleEdit = assertRefreshedFormThat(form -> {
var firstPage = form.getPages().get(0);
var firstGroup = firstPage.getGroups().get(0);

var targetArrowStyleWidget = firstGroup.getWidgets().stream()
.filter(Select.class::isInstance)
.map(Select.class::cast)
.filter(selectWidget -> Objects.equals("Target Arrow Style", selectWidget.getLabel()))
.findFirst();
assertThat(targetArrowStyleWidget).isPresent();
assertThat(targetArrowStyleWidget.get().getValue()).isEqualTo(closedArrowWith4DotsValue.get());
});

StepVerifier.create(flux)
.consumeNextWith(formContentBeforeEdit)
.then(editSourceArrowStyle)
.consumeNextWith(formContentAfterSourceArrowStyleEdit)
.then(editTargetArrowStyle)
.consumeNextWith(formContentAfterTargetArrowStyleEdit)
.thenCancel()
.verify(Duration.ofSeconds(100));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021, 2025 Obeo.
* Copyright (c) 2021, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -88,7 +88,7 @@ protected void addOnWestAtCreationBorderNodesPropertyDescriptor(Object object) {
protected ItemPropertyDescriptor createItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, String displayName, String description, EStructuralFeature feature,
boolean isSettable, boolean multiLine, boolean sortChoices, Object staticImage, String category, String[] filterFlags) {
if (List.of(DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_WEST_AT_CREATION_BORDER_NODES, DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_EAST_AT_CREATION_BORDER_NODES,
DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_SOUTH_AT_CREATION_BORDER_NODES, DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_NORTH_AT_CREATION_BORDER_NODES)
DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_SOUTH_AT_CREATION_BORDER_NODES, DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_NORTH_AT_CREATION_BORDER_NODES)
.contains(feature)) {
return new ItemPropertyDescriptor(adapterFactory, resourceLocator, displayName, description, feature, isSettable, multiLine, sortChoices, staticImage, category, filterFlags, null) {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021, 2025 Obeo.
* Copyright (c) 2021, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -94,7 +94,7 @@ protected void addOnWestAtCreationBorderNodesPropertyDescriptor(Object object) {
protected ItemPropertyDescriptor createItemPropertyDescriptor(AdapterFactory adapterFactory, ResourceLocator resourceLocator, String displayName, String description, EStructuralFeature feature,
boolean isSettable, boolean multiLine, boolean sortChoices, Object staticImage, String category, String[] filterFlags) {
if (List.of(DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_WEST_AT_CREATION_BORDER_NODES, DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_EAST_AT_CREATION_BORDER_NODES,
DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_SOUTH_AT_CREATION_BORDER_NODES, DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_NORTH_AT_CREATION_BORDER_NODES)
DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_SOUTH_AT_CREATION_BORDER_NODES, DiagramPackage.Literals.LAYOUT_STRATEGY_DESCRIPTION__ON_NORTH_AT_CREATION_BORDER_NODES)
.contains(feature)) {
return new ItemPropertyDescriptor(adapterFactory, resourceLocator, displayName, description, feature, isSettable, multiLine, sortChoices, staticImage, category, filterFlags, null) {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright (c) 2021, 2025 Obeo.
# Copyright (c) 2021, 2026 Obeo.
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
Expand Down Expand Up @@ -236,6 +236,7 @@ _UI_ArrowStyle_FillCircle_literal=FillCircle
_UI_ArrowStyle_CrossedCircle_literal=CrossedCircle
_UI_ArrowStyle_ClosedArrowWithVerticalBar_literal=ClosedArrowWithVerticalBar
_UI_ArrowStyle_ClosedArrowWithDots_literal=ClosedArrowWithDots
_UI_ArrowStyle_ClosedArrowWith4Dots_literal = ClosedArrowWith4Dots
_UI_LayoutDirection_Column_literal=Column
_UI_LineStyle_Solid_literal=Solid
_UI_LineStyle_Dash_literal=Dash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 Obeo.
* Copyright (c) 2023, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -168,7 +168,15 @@ public enum ArrowStyle implements Enumerator {
* @generated
* @ordered
*/
CLOSED_ARROW_WITH_DOTS(15, "ClosedArrowWithDots", "ClosedArrowWithDots");
CLOSED_ARROW_WITH_DOTS(15, "ClosedArrowWithDots", "ClosedArrowWithDots"),
/**
* The '<em><b>Closed Arrow With4 Dots</b></em>' literal object. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #CLOSED_ARROW_WITH4_DOTS_VALUE
* @generated
* @ordered
*/
CLOSED_ARROW_WITH4_DOTS(16, "ClosedArrowWith4Dots", "ClosedArrowWith4Dots");

/**
* The '<em><b>None</b></em>' literal value. <!-- begin-user-doc --> <!-- end-user-doc -->
Expand Down Expand Up @@ -330,13 +338,24 @@ public enum ArrowStyle implements Enumerator {
*/
public static final int CLOSED_ARROW_WITH_DOTS_VALUE = 15;

/**
* The '<em><b>Closed Arrow With4 Dots</b></em>' literal value. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #CLOSED_ARROW_WITH4_DOTS
* @model name="ClosedArrowWith4Dots"
* @generated
* @ordered
*/
public static final int CLOSED_ARROW_WITH4_DOTS_VALUE = 16;

/**
* An array of all the '<em><b>Arrow Style</b></em>' enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private static final ArrowStyle[] VALUES_ARRAY = new ArrowStyle[] { NONE, OUTPUT_ARROW, INPUT_ARROW, OUTPUT_CLOSED_ARROW, INPUT_CLOSED_ARROW, OUTPUT_FILL_CLOSED_ARROW, INPUT_FILL_CLOSED_ARROW,
DIAMOND, FILL_DIAMOND, INPUT_ARROW_WITH_DIAMOND, INPUT_ARROW_WITH_FILL_DIAMOND, CIRCLE, FILL_CIRCLE, CROSSED_CIRCLE, CLOSED_ARROW_WITH_VERTICAL_BAR, CLOSED_ARROW_WITH_DOTS, };
DIAMOND, FILL_DIAMOND, INPUT_ARROW_WITH_DIAMOND, INPUT_ARROW_WITH_FILL_DIAMOND, CIRCLE, FILL_CIRCLE, CROSSED_CIRCLE, CLOSED_ARROW_WITH_VERTICAL_BAR, CLOSED_ARROW_WITH_DOTS,
CLOSED_ARROW_WITH4_DOTS, };

/**
* A public read-only list of all the '<em><b>Arrow Style</b></em>' enumerators. <!-- begin-user-doc --> <!--
Expand Down Expand Up @@ -427,6 +446,8 @@ public static ArrowStyle get(int value) {
return CLOSED_ARROW_WITH_VERTICAL_BAR;
case CLOSED_ARROW_WITH_DOTS_VALUE:
return CLOSED_ARROW_WITH_DOTS;
case CLOSED_ARROW_WITH4_DOTS_VALUE:
return CLOSED_ARROW_WITH4_DOTS;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023, 2025 Obeo.
* Copyright (c) 2023, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -3425,6 +3425,7 @@ public void initializePackageContents() {
this.addEEnumLiteral(this.arrowStyleEEnum, ArrowStyle.CROSSED_CIRCLE);
this.addEEnumLiteral(this.arrowStyleEEnum, ArrowStyle.CLOSED_ARROW_WITH_VERTICAL_BAR);
this.addEEnumLiteral(this.arrowStyleEEnum, ArrowStyle.CLOSED_ARROW_WITH_DOTS);
this.addEEnumLiteral(this.arrowStyleEEnum, ArrowStyle.CLOSED_ARROW_WITH4_DOTS);

this.initEEnum(this.layoutDirectionEEnum, LayoutDirection.class, "LayoutDirection");
this.addEEnumLiteral(this.layoutDirectionEEnum, LayoutDirection.COLUMN);
Expand Down
Loading
Loading