diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 314887f3cc..f03ddc42d2 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -98,6 +98,7 @@ image:doc/screenshots/insideLabelPositions.png[Inside label positions, 70%] - https://github.com/eclipse-sirius/sirius-web/issues/3623[#3623] [form] Remove unused form payload - https://github.com/eclipse-sirius/sirius-web/issues/3627[#3627] [form] Remove unused mutation in form - https://github.com/eclipse-sirius/sirius-web/issues/3606[#3606] [test] Improve error handling in ExecuteEditingContextFunctionRunner and ExecuteEditingContextFunctionEventHandler +- https://github.com/eclipse-sirius/sirius-web/issues/3561[#3561] [diagram] Add support for background and border on diagram labels == v2024.5.0 diff --git a/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts b/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts index 10d5926661..5877e73d39 100644 --- a/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts @@ -552,4 +552,61 @@ describe('Diagram - inside outside labels', () => { }); }); }); + + context('Given a view with inside label on rectangular node with background on label style', () => { + let studioProjectId: string = ''; + let domainName: string = ''; + + before(() => { + cy.createProjectFromTemplate('studio-template').then((res) => { + const payload = res.body.data.createProjectFromTemplate; + if (isCreateProjectFromTemplateSuccessPayload(payload)) { + const projectId = payload.project.id; + studioProjectId = projectId; + + const project = new Project(); + project.visit(projectId); + project.disableDeletionConfirmationDialog(); + + const explorer = new Explorer(); + const details = new Details(); + explorer.getTreeItemByLabel('DomainNewModel').dblclick(); + cy.get('[title="domain::Domain"]').then(($div) => { + domainName = $div.data().testid; + explorer.expand('ViewNewModel'); + explorer.expand('View'); + explorer.expand(`${domainName} Diagram Description`); + explorer.expand('Entity1 Node'); + explorer.expand('aql:self.name'); + explorer.select('InsideLabelStyle'); + details.openReferenceWidgetOptions('Background'); + details.selectReferenceWidgetOption('cyan 500'); + }); + } + }); + }); + + after(() => cy.deleteProject(studioProjectId)); + context('When we create a new instance project', () => { + let instanceProjectId: string = ''; + + beforeEach(() => { + const studio = new Studio(); + studio.createProjectFromDomain('Cypress - Studio Instance', domainName, 'Root').then((res) => { + instanceProjectId = res.projectId; + new Explorer().createRepresentation('Root', `${domainName} Diagram Description`, 'diagram'); + }); + }); + + afterEach(() => cy.deleteProject(instanceProjectId)); + + it('Then the label background matches the selected color', () => { + const explorer = new Explorer(); + const details = new Details(); + explorer.createObject('Root', 'Entity1s Entity1'); + details.getTextField('Name').type('Entity 1{enter}'); + cy.getByTestId('Label content - Entity 1').invoke('css', 'background').should('contain', 'rgb(0, 188, 212)'); + }); + }); + }); }); diff --git a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/EdgeMappingConverterTests.java b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/EdgeMappingConverterTests.java index 02076a8117..f55dbd6b02 100644 --- a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/EdgeMappingConverterTests.java +++ b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/EdgeMappingConverterTests.java @@ -31,6 +31,7 @@ import org.eclipse.sirius.components.diagrams.InsideLabelLocation; import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy; import org.eclipse.sirius.components.diagrams.LabelTextAlign; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.diagrams.description.EdgeDescription; import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription; @@ -101,6 +102,11 @@ private NodeDescription createNodeDescription(String id) { .underlineProvider(variableManager -> false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription(id) diff --git a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/TestDiagramBuilder.java b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/TestDiagramBuilder.java index 1f45b24d0d..e2432e42e0 100644 --- a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/TestDiagramBuilder.java +++ b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/diagrams/TestDiagramBuilder.java @@ -100,6 +100,10 @@ public Node getNode(String id, boolean withLabel) { .color("#000000") .fontSize(16) .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); InsideLabel insideLabel = InsideLabel.newLabel(UUID.randomUUID().toString()) .text("text") diff --git a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/CreateViewOperationHandlerTests.java b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/CreateViewOperationHandlerTests.java index e2b1c8278c..1e0d8b8494 100644 --- a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/CreateViewOperationHandlerTests.java +++ b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/CreateViewOperationHandlerTests.java @@ -203,6 +203,11 @@ private NodeDescription getNodeDescription(String nodeDescriptionId) { .underlineProvider(variableManager -> false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescriptionId") diff --git a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/DeleteViewOperationHandlerTests.java b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/DeleteViewOperationHandlerTests.java index e44439d9b7..8034843968 100644 --- a/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/DeleteViewOperationHandlerTests.java +++ b/packages/compatibility/backend/sirius-components-compatibility-emf/src/test/java/org/eclipse/sirius/components/compatibility/emf/compatibility/operations/DeleteViewOperationHandlerTests.java @@ -102,7 +102,16 @@ public void initialize() { .insideLabel(InsideLabel.newLabel(UUID.randomUUID().toString()) .text(OperationTestContext.ROOT_PACKAGE_NAME) .insideLabelLocation(InsideLabelLocation.TOP_CENTER) - .style(LabelStyle.newLabelStyle().color("").fontSize(0).iconURL(List.of()).build()) + .style(LabelStyle + .newLabelStyle() + .color("") + .fontSize(0) + .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) + .build()) .isHeader(false) .displayHeaderSeparator(false) .overflowStrategy(LabelOverflowStrategy.NONE) @@ -180,6 +189,11 @@ private NodeDescription getNodeDescription(String nodeDescriptionId) { .underlineProvider(variableManager -> false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescriptionId") diff --git a/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/diagrams/LabelStyleDescriptionConverter.java b/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/diagrams/LabelStyleDescriptionConverter.java index 9910079b69..ee2f819bf1 100644 --- a/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/diagrams/LabelStyleDescriptionConverter.java +++ b/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/diagrams/LabelStyleDescriptionConverter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2023 Obeo. + * Copyright (c) 2019, 2024 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 @@ -17,6 +17,7 @@ import java.util.function.Function; import org.eclipse.sirius.components.core.api.IObjectService; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription; import org.eclipse.sirius.components.interpreter.AQLInterpreter; import org.eclipse.sirius.components.representations.VariableManager; @@ -29,6 +30,8 @@ */ public class LabelStyleDescriptionConverter { + private static final String DEFAULT_COLOR = "transparent"; + private final AQLInterpreter interpreter; private final IObjectService objectService; @@ -67,11 +70,8 @@ public LabelStyleDescription convert(org.eclipse.sirius.viewpoint.description.st return 16; }; - Function colorProvider = variableManager -> { - return new ColorDescriptionConverter(this.interpreter, variableManager.getVariables()).convert(labelStyleDescription.getLabelColor()); - }; + Function colorProvider = variableManager -> new ColorDescriptionConverter(this.interpreter, variableManager.getVariables()).convert(labelStyleDescription.getLabelColor()); - // @formatter:off return LabelStyleDescription.newLabelStyleDescription() .colorProvider(colorProvider) .fontSizeProvider(fontSizeProvider) @@ -80,7 +80,11 @@ public LabelStyleDescription convert(org.eclipse.sirius.viewpoint.description.st .underlineProvider(variableManager -> fontFormats.contains(FontFormat.UNDERLINE_LITERAL)) .strikeThroughProvider(variableManager -> fontFormats.contains(FontFormat.STRIKE_THROUGH_LITERAL)) .iconURLProvider(iconURLProvider) + .backgroundProvider(variableManager -> DEFAULT_COLOR) + .borderColorProvider(variableManager -> DEFAULT_COLOR) + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); - // @formatter:on } } diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/resources/schema/diagram.graphqls b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/resources/schema/diagram.graphqls index 1985729d8b..1ecbd9e309 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/resources/schema/diagram.graphqls +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/resources/schema/diagram.graphqls @@ -163,6 +163,11 @@ type LabelStyle { italic: Boolean! strikeThrough: Boolean! underline: Boolean! + borderColor: String! + borderRadius: Int! + borderSize: Int! + borderStyle: LineStyle! + background: String! } union INodeStyle = ImageNodeStyle | IconLabelNodeStyle | RectangularNodeStyle diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetConnectorToolsEventHandlerTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetConnectorToolsEventHandlerTests.java index 938616e141..22c3206720 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetConnectorToolsEventHandlerTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetConnectorToolsEventHandlerTests.java @@ -38,6 +38,7 @@ import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy; import org.eclipse.sirius.components.diagrams.LabelStyle; import org.eclipse.sirius.components.diagrams.LabelTextAlign; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.Node; import org.eclipse.sirius.components.diagrams.NodeType; import org.eclipse.sirius.components.diagrams.Position; @@ -99,6 +100,10 @@ private Node getNode(String id, String targetObjectId) { .color("#000000") .fontSize(16) .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); InsideLabel insideLabel = InsideLabel.newLabel(UUID.randomUUID().toString()) .text("text") diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InitialDirectEditElementLabelEventHandlerTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InitialDirectEditElementLabelEventHandlerTests.java index d335008d6e..b89b889ec5 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InitialDirectEditElementLabelEventHandlerTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InitialDirectEditElementLabelEventHandlerTests.java @@ -33,6 +33,7 @@ import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy; import org.eclipse.sirius.components.diagrams.LabelStyle; import org.eclipse.sirius.components.diagrams.LabelTextAlign; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.Node; import org.eclipse.sirius.components.diagrams.OutsideLabel; import org.eclipse.sirius.components.diagrams.OutsideLabelLocation; @@ -118,6 +119,10 @@ public void testInitialDirectEditElementLabelOnNodeWithoutInsideLabelEventHandle .color("#000000") .fontSize(16) .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); Node node = new TestDiagramBuilder().getNodeWithOutsideLabels(UUID.randomUUID().toString(), false, List.of(new OutsideLabel(labelId, "text", OutsideLabelLocation.BOTTOM_MIDDLE, labelStyle, LabelOverflowStrategy.NONE, LabelTextAlign.LEFT))); diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InvokeSingleClickOnDiagramElementToolEventHandlerTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InvokeSingleClickOnDiagramElementToolEventHandlerTests.java index 5940a4557c..24e2ab4c34 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InvokeSingleClickOnDiagramElementToolEventHandlerTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InvokeSingleClickOnDiagramElementToolEventHandlerTests.java @@ -76,30 +76,20 @@ public class InvokeSingleClickOnDiagramElementToolEventHandlerTests { private static final String DIAGRAM_ID = "diagramId"; - private static final String EDGE_1_ID = "edge1"; - private static final String EDGE_DESCRIPTION_ID = "edgeDescriptionId"; - private static final String EDITING_CONTEXT_ID = "editingContextId"; - private static final String NODE_DESCRIPTION_ID = "nodeDescriptionId"; - private static final String NODE_1_ID = "node1"; - private static final String OBJECT_1_ID = "object1"; - private static final String LINK_1_ID = "link1"; - private static final String REPRESENTATION_ID = "representationId"; - private static final String SELECTED_OBJECT_ID = "selectedObjectId"; - private static final String TOOL_ID = "toolId"; - private static final String TOOL_IMAGE_URL = "imageURL"; - private static final String TOOL_LABEL = "label"; + private static final String TRANSPARENT_COLOR_NAME = "transparent"; + private static final String BLACK_COLOR_NAME = "black"; @Test public void testInvokeToolOnDiagram() { @@ -381,6 +371,10 @@ private Node createNode(String nodeId, String nodeDescriptionId, String targetOb .color("#000001") .fontSize(16) .iconURL(List.of()) + .background(TRANSPARENT_COLOR_NAME) + .borderColor(BLACK_COLOR_NAME) + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); var label = InsideLabel.newLabel(UUID.randomUUID().toString()) .text("text") @@ -420,6 +414,11 @@ private NodeDescription createNodeDescription(String nodeDescriptionId) { .underlineProvider(variableManager -> false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> TRANSPARENT_COLOR_NAME) + .borderColorProvider(variableManager -> BLACK_COLOR_NAME) + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); var insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescription") @@ -457,6 +456,10 @@ private Edge createEdge(String edgeId, String edgeDescriptionId, String targetOb .color("#000002") .fontSize(14) .iconURL(List.of()) + .background(TRANSPARENT_COLOR_NAME) + .borderColor(BLACK_COLOR_NAME) + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); var label = Label.newLabel(UUID.randomUUID().toString()) diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramBuilder.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramBuilder.java index 67fa6f4fc5..c331e605cb 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramBuilder.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramBuilder.java @@ -112,6 +112,10 @@ private Node getNode(String id, boolean withInsideLabel, List outs .color("#000000") .fontSize(16) .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); InsideLabel insideLabel = InsideLabel.newLabel(UUID.randomUUID().toString()) .text("text") diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramDescriptionBuilder.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramDescriptionBuilder.java index 2f3864c209..21d1e1a535 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramDescriptionBuilder.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/TestDiagramDescriptionBuilder.java @@ -100,6 +100,11 @@ public NodeDescription getNodeDescription(String nodeDescriptionId, Function false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescriptionId") diff --git a/packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/label/LabelBuilder.java b/packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/label/LabelBuilder.java index c618977866..7d57b8c526 100644 --- a/packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/label/LabelBuilder.java +++ b/packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/label/LabelBuilder.java @@ -20,6 +20,7 @@ import org.eclipse.sirius.components.diagrams.InsideLabelLocation; import org.eclipse.sirius.components.diagrams.Label; import org.eclipse.sirius.components.diagrams.LabelStyle; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.Position; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.diagrams.components.LabelType; @@ -31,6 +32,8 @@ */ public final class LabelBuilder { + public static final String DEFAULT_COLOR_TRANSPARENT = "transparent"; + public Label basicLabel(String text, LabelType labelType) { LabelStyle labelStyle = LabelStyle.newLabelStyle() .color("black") @@ -40,6 +43,10 @@ public Label basicLabel(String text, LabelType labelType) { .underline(false) .strikeThrough(false) .iconURL(List.of()) + .background(DEFAULT_COLOR_TRANSPARENT) + .borderColor(DEFAULT_COLOR_TRANSPARENT) + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); return Label.newLabel(UUID.randomUUID().toString()) @@ -61,6 +68,10 @@ public InsideLabel basicInsideLabel(String text, LabelType labelType, boolean is .underline(false) .strikeThrough(false) .iconURL(List.of()) + .background(DEFAULT_COLOR_TRANSPARENT) + .borderColor(DEFAULT_COLOR_TRANSPARENT) + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); return InsideLabel.newLabel(UUID.randomUUID().toString()) diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/LabelStyle.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/LabelStyle.java index 6a493ca466..a8833f9eca 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/LabelStyle.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/LabelStyle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2023 Obeo. + * Copyright (c) 2019, 2024 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 @@ -39,6 +39,16 @@ public final class LabelStyle { private List iconURL; + private String background; + + private String borderColor; + + private int borderSize; + + private int borderRadius; + + private LineStyle borderStyle; + private LabelStyle() { // Prevent instantiation } @@ -75,6 +85,26 @@ public List getIconURL() { return this.iconURL; } + public String getBackground() { + return this.background; + } + + public String getBorderColor() { + return this.borderColor; + } + + public int getBorderSize() { + return this.borderSize; + } + + public int getBorderRadius() { + return this.borderRadius; + } + + public LineStyle getBorderStyle() { + return this.borderStyle; + } + /** * The builder used to create the label style. * @@ -97,6 +127,16 @@ public static final class Builder { private List iconURL; + private String background; + + private String borderColor; + + private int borderSize; + + private int borderRadius; + + private LineStyle borderStyle; + private Builder() { } @@ -135,6 +175,31 @@ public Builder iconURL(List iconURL) { return this; } + public Builder background(String background) { + this.background = Objects.requireNonNull(background); + return this; + } + + public Builder borderColor(String borderColor) { + this.borderColor = Objects.requireNonNull(borderColor); + return this; + } + + public Builder borderSize(int borderSize) { + this.borderSize = borderSize; + return this; + } + + public Builder borderRadius(int borderRadius) { + this.borderRadius = borderRadius; + return this; + } + + public Builder borderStyle(LineStyle borderStyle) { + this.borderStyle = Objects.requireNonNull(borderStyle); + return this; + } + public LabelStyle build() { LabelStyle labelDescription = new LabelStyle(); labelDescription.color = Objects.requireNonNull(this.color); @@ -144,7 +209,11 @@ public LabelStyle build() { labelDescription.strikeThrough = this.strikeThrough; labelDescription.underline = this.underline; labelDescription.iconURL = Objects.requireNonNull(this.iconURL); - + labelDescription.background = Objects.requireNonNull(this.background); + labelDescription.borderColor = Objects.requireNonNull(this.borderColor); + labelDescription.borderSize = this.borderSize; + labelDescription.borderRadius = this.borderRadius; + labelDescription.borderStyle = Objects.requireNonNull(this.borderStyle); return labelDescription; } } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/InsideLabelComponent.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/InsideLabelComponent.java index 8ac3c5569c..a0bc778feb 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/InsideLabelComponent.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/InsideLabelComponent.java @@ -18,6 +18,7 @@ import org.eclipse.sirius.components.diagrams.InsideLabelLocation; import org.eclipse.sirius.components.diagrams.LabelStyle; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription; import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription; import org.eclipse.sirius.components.diagrams.elements.InsideLabelElementProps; @@ -61,6 +62,11 @@ public Element render() { Boolean strikeThrough = labelStyleDescription.getStrikeThroughProvider().apply(variableManager); Boolean underline = labelStyleDescription.getUnderlineProvider().apply(variableManager); List iconURL = labelStyleDescription.getIconURLProvider().apply(variableManager); + String background = labelStyleDescription.getBackgroundProvider().apply(variableManager); + String borderColor = labelStyleDescription.getBorderColorProvider().apply(variableManager); + Integer borderRadius = labelStyleDescription.getBorderRadiusProvider().apply(variableManager); + Integer borderSize = labelStyleDescription.getBorderSizeProvider().apply(variableManager); + LineStyle borderLineStyle = labelStyleDescription.getBorderStyleProvider().apply(variableManager); InsideLabelLocation insideLabelLocation = insideLabelDescription.getInsideLabelLocation(); @@ -72,6 +78,11 @@ public Element render() { .strikeThrough(strikeThrough) .underline(underline) .iconURL(iconURL) + .background(background) + .borderColor(borderColor) + .borderRadius(borderRadius) + .borderSize(borderSize) + .borderStyle(borderLineStyle) .build(); InsideLabelElementProps insideLabelElementProps = InsideLabelElementProps.newInsideLabelElementProps(id) diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/LabelComponent.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/LabelComponent.java index 9d13cb4f29..c2debc39a5 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/LabelComponent.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/LabelComponent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2023 Obeo and others. + * Copyright (c) 2019, 2024 Obeo and others. * 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 @@ -19,6 +19,7 @@ import org.eclipse.sirius.components.diagrams.Label; import org.eclipse.sirius.components.diagrams.LabelStyle; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.Position; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.diagrams.description.LabelDescription; @@ -60,6 +61,11 @@ public Element render() { Boolean strikeThrough = labelStyleDescription.getStrikeThroughProvider().apply(variableManager); Boolean underline = labelStyleDescription.getUnderlineProvider().apply(variableManager); List iconURL = labelStyleDescription.getIconURLProvider().apply(variableManager); + String background = labelStyleDescription.getBackgroundProvider().apply(variableManager); + String borderColor = labelStyleDescription.getBorderColorProvider().apply(variableManager); + Integer borderRadius = labelStyleDescription.getBorderRadiusProvider().apply(variableManager); + Integer borderSize = labelStyleDescription.getBorderSizeProvider().apply(variableManager); + LineStyle borderLineStyle = labelStyleDescription.getBorderStyleProvider().apply(variableManager); Position position = optionalPreviousLabel.map(Label::getPosition).orElse(Position.UNDEFINED); Size size = optionalPreviousLabel.map(Label::getSize).orElse(Size.UNDEFINED); @@ -74,6 +80,11 @@ public Element render() { .strikeThrough(strikeThrough) .underline(underline) .iconURL(iconURL) + .background(background) + .borderColor(borderColor) + .borderRadius(borderRadius) + .borderSize(borderSize) + .borderStyle(borderLineStyle) .build(); LabelElementProps labelElementProps = LabelElementProps.newLabelElementProps(id) diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/OutsideLabelComponent.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/OutsideLabelComponent.java index 9d48d9ebe4..ff8de5679f 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/OutsideLabelComponent.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/OutsideLabelComponent.java @@ -17,6 +17,7 @@ import java.util.UUID; import org.eclipse.sirius.components.diagrams.LabelStyle; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription; import org.eclipse.sirius.components.diagrams.description.OutsideLabelDescription; import org.eclipse.sirius.components.diagrams.elements.OutsideLabelElementProps; @@ -54,6 +55,11 @@ public Element render() { Boolean strikeThrough = labelStyleDescription.getStrikeThroughProvider().apply(variableManager); Boolean underline = labelStyleDescription.getUnderlineProvider().apply(variableManager); List iconURL = labelStyleDescription.getIconURLProvider().apply(variableManager); + String background = labelStyleDescription.getBackgroundProvider().apply(variableManager); + String borderColor = labelStyleDescription.getBorderColorProvider().apply(variableManager); + Integer borderRadius = labelStyleDescription.getBorderRadiusProvider().apply(variableManager); + Integer borderSize = labelStyleDescription.getBorderSizeProvider().apply(variableManager); + LineStyle borderLineStyle = labelStyleDescription.getBorderStyleProvider().apply(variableManager); var labelStyle = LabelStyle.newLabelStyle() .color(color) @@ -63,6 +69,11 @@ public Element render() { .strikeThrough(strikeThrough) .underline(underline) .iconURL(iconURL) + .background(background) + .borderColor(borderColor) + .borderRadius(borderRadius) + .borderSize(borderSize) + .borderStyle(borderLineStyle) .build(); OutsideLabelElementProps outsideLabelElementProps = OutsideLabelElementProps.newOutsideLabelElementProps(id) diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/LabelStyleDescription.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/LabelStyleDescription.java index f5948e04fe..d9d51cc9c7 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/LabelStyleDescription.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/LabelStyleDescription.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2023 Obeo. + * Copyright (c) 2019, 2024 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 @@ -17,6 +17,7 @@ import java.util.function.Function; import org.eclipse.sirius.components.annotations.Immutable; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.representations.VariableManager; /** @@ -41,6 +42,16 @@ public final class LabelStyleDescription { private Function> iconURLProvider; + private Function backgroundProvider; + + private Function borderColorProvider; + + private Function borderSizeProvider; + + private Function borderRadiusProvider; + + private Function borderStyleProvider; + private LabelStyleDescription() { // Prevent instantiation } @@ -77,6 +88,26 @@ public Function> getIconURLProvider() { return this.iconURLProvider; } + public Function getBackgroundProvider() { + return this.backgroundProvider; + } + + public Function getBorderColorProvider() { + return this.borderColorProvider; + } + + public Function getBorderSizeProvider() { + return this.borderSizeProvider; + } + + public Function getBorderRadiusProvider() { + return this.borderRadiusProvider; + } + + public Function getBorderStyleProvider() { + return this.borderStyleProvider; + } + /** * The builder used to create a new label description. * @@ -99,6 +130,16 @@ public static final class Builder { private Function> iconURLProvider; + private Function backgroundProvider; + + private Function borderColorProvider; + + private Function borderSizeProvider; + + private Function borderRadiusProvider; + + private Function borderStyleProvider; + private Builder() { } @@ -137,6 +178,31 @@ public Builder iconURLProvider(Function> iconURLPr return this; } + public Builder backgroundProvider(Function backgroundProvider) { + this.backgroundProvider = Objects.requireNonNull(backgroundProvider); + return this; + } + + public Builder borderColorProvider(Function borderColorProvider) { + this.borderColorProvider = Objects.requireNonNull(borderColorProvider); + return this; + } + + public Builder borderSizeProvider(Function borderSizeProvider) { + this.borderSizeProvider = Objects.requireNonNull(borderSizeProvider); + return this; + } + + public Builder borderRadiusProvider(Function borderRadiusProvider) { + this.borderRadiusProvider = Objects.requireNonNull(borderRadiusProvider); + return this; + } + + public Builder borderStyleProvider(Function borderStyleProvider) { + this.borderStyleProvider = Objects.requireNonNull(borderStyleProvider); + return this; + } + public LabelStyleDescription build() { LabelStyleDescription styleDescription = new LabelStyleDescription(); styleDescription.colorProvider = Objects.requireNonNull(this.colorProvider); @@ -146,6 +212,11 @@ public LabelStyleDescription build() { styleDescription.strikeThroughProvider = Objects.requireNonNull(this.strikeThroughProvider); styleDescription.underlineProvider = Objects.requireNonNull(this.underlineProvider); styleDescription.iconURLProvider = Objects.requireNonNull(this.iconURLProvider); + styleDescription.backgroundProvider = Objects.requireNonNull(this.backgroundProvider); + styleDescription.borderColorProvider = Objects.requireNonNull(this.borderColorProvider); + styleDescription.borderSizeProvider = Objects.requireNonNull(this.borderSizeProvider); + styleDescription.borderRadiusProvider = Objects.requireNonNull(this.borderRadiusProvider); + styleDescription.borderStyleProvider = Objects.requireNonNull(this.borderStyleProvider); return styleDescription; } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementChangeVisibilityTests.java b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementChangeVisibilityTests.java index 700a1ac25b..9140852d3b 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementChangeVisibilityTests.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementChangeVisibilityTests.java @@ -117,6 +117,11 @@ private NodeDescription createNodeDescription(String elementId, List COLOR) .fontSizeProvider(variableManager -> LABEL_FONT_SIZE) .iconURLProvider(VariableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription(UUID.randomUUID().toString()) diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererEdgeTests.java b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererEdgeTests.java index c961fd0c91..d8cdfc3cb1 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererEdgeTests.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererEdgeTests.java @@ -175,6 +175,11 @@ private NodeDescription getNodeDescription(String nodeDescriptionId) { .underlineProvider(variableManager -> false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescriptionId") diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererNodeTests.java b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererNodeTests.java index 5de9f483d2..2d55f8b03d 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererNodeTests.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererNodeTests.java @@ -253,6 +253,11 @@ private Diagram createDiagram(Function styleProvide .colorProvider(VariableManager -> LABEL_COLOR) .fontSizeProvider(variableManager -> LABEL_FONT_SIZE) .iconURLProvider(VariableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLbelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescriptionId") diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/UnsynchronizedDiagramTests.java b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/UnsynchronizedDiagramTests.java index eee9c0c531..d82117c277 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/UnsynchronizedDiagramTests.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/UnsynchronizedDiagramTests.java @@ -278,6 +278,11 @@ private DiagramDescription getDiagramDescription(Function "#FFFFFF") .fontSizeProvider(variableManager -> 10) .iconURLProvider(VariableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("insideLabelDescriptionId") @@ -298,9 +303,7 @@ private DiagramDescription getDiagramDescription(Function childrenLayoutStrategyProvider = variableManager -> { - return new FreeFormLayoutStrategy(); - }; + Function childrenLayoutStrategyProvider = variableManager -> new FreeFormLayoutStrategy(); NodeDescription subUnsynchronizedNodeDescription = NodeDescription.newNodeDescription("subUnsynchronized") .synchronizationPolicy(SynchronizationPolicy.UNSYNCHRONIZED) diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/IconLabelNodeConverter.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/IconLabelNodeConverter.ts index 2aa76e1197..7845d843aa 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/IconLabelNodeConverter.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/IconLabelNodeConverter.ts @@ -26,7 +26,7 @@ import { IconLabelNodeData } from '../renderer/node/IconsLabelNode.types'; import { GQLDiagramDescription } from '../representation/DiagramRepresentation.types'; import { IConvertEngine, INodeConverter } from './ConvertEngine.types'; import { isListLayoutStrategy } from './convertDiagram'; -import { convertLabelStyle, convertOutsideLabels } from './convertLabel'; +import { convertLabelStyle, convertOutsideLabels, convertContentStyle } from './convertLabel'; const defaultPosition: XYPosition = { x: 0, y: 0 }; @@ -95,6 +95,9 @@ const toIconLabelNode = ( style: { ...convertLabelStyle(labelStyle), }, + contentStyle: { + ...convertContentStyle(labelStyle), + }, iconURL: labelStyle.iconURL, isHeader: insideLabel.isHeader, displayHeaderSeparator: insideLabel.displayHeaderSeparator, diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertDiagram.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertDiagram.ts index 7c97bd57f8..9fddfd17cd 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertDiagram.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertDiagram.ts @@ -34,7 +34,7 @@ import { IconLabelNodeConverter } from './IconLabelNodeConverter'; import { ImageNodeConverter } from './ImageNodeConverter'; import { ListNodeConverter } from './ListNodeConverter'; import { RectangleNodeConverter } from './RectangleNodeConverter'; -import { convertLabelStyle } from './convertLabel'; +import { convertLabelStyle, convertContentStyle } from './convertLabel'; const nodeDepth = (nodeId2node: Map, nodeId: string): number => { const node = nodeId2node.get(nodeId); @@ -61,6 +61,9 @@ const convertEdgeLabel = (gqlEdgeLabel: GQLLabel): EdgeLabel => { zIndex: 1001, ...convertLabelStyle(gqlEdgeLabel.style), }, + contentStyle: { + ...convertContentStyle(gqlEdgeLabel.style), + }, }; }; diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertLabel.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertLabel.ts index 97f338d66f..c1d01d8aaa 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertLabel.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertLabel.ts @@ -18,6 +18,7 @@ import { } from '../graphql/subscription/labelFragment.types'; import { OutsideLabels, InsideLabel, NodeData } from '../renderer/DiagramRenderer.types'; import { AlignmentMap } from './convertDiagram.types'; +import { convertLineStyle } from './convertDiagram'; export const convertInsideLabel = ( gqlInsideLabel: GQLInsideLabel | undefined, @@ -43,6 +44,9 @@ export const convertInsideLabel = ( textAlign: convertLabelTextAlign(gqlInsideLabel.textAlign), ...convertLabelStyle(labelStyle), }, + contentStyle: { + ...convertContentStyle(labelStyle), + }, iconURL: labelStyle.iconURL, overflowStrategy: gqlInsideLabel.overflowStrategy, headerSeparatorStyle: { @@ -106,6 +110,9 @@ export const convertOutsideLabels = (gqlOutsideLabels: GQLOutsideLabel[]): Outsi textAlign: convertLabelTextAlign(gqlOutsideLabel.textAlign), ...convertLabelStyle(labelStyle), }, + contentStyle: { + ...convertContentStyle(labelStyle), + }, overflowStrategy, }; @@ -159,3 +166,15 @@ const convertLabelTextAlign = (textAlign: GQLLabelTextAlign): 'left' | 'right' | return 'center'; } }; + +export const convertContentStyle = (gqlLabelStyle: GQLLabelStyle): React.CSSProperties => { + const style: React.CSSProperties = {}; + + style.background = gqlLabelStyle.background; + style.borderColor = gqlLabelStyle.borderColor; + style.borderRadius = gqlLabelStyle.borderRadius; + style.borderWidth = gqlLabelStyle.borderSize; + style.borderStyle = convertLineStyle(gqlLabelStyle.borderStyle); + + return style; +}; diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.ts index 7a028ade27..4eb9250f5e 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.ts @@ -23,6 +23,11 @@ fragment labelFragment on Label { underline strikeThrough iconURL + background + borderColor + borderStyle + borderSize + borderRadius } } `; @@ -44,6 +49,11 @@ fragment insideLabelFragment on InsideLabel { underline strikeThrough iconURL + background + borderColor + borderStyle + borderSize + borderRadius } } `; @@ -62,6 +72,11 @@ fragment outsideLabelFragment on OutsideLabel { underline strikeThrough iconURL + background + borderColor + borderStyle + borderSize + borderRadius } overflowStrategy } diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.types.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.types.ts index 8b0dd48e66..b7b3dabfdf 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.types.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/labelFragment.types.ts @@ -62,4 +62,9 @@ export interface GQLLabelStyle { underline: boolean; strikeThrough: boolean; iconURL: string[]; + background: string; + borderColor: string; + borderStyle: string; + borderSize: string; + borderRadius: number; } diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.types.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.types.ts index 433370326a..832cafa572 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.types.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.types.ts @@ -85,6 +85,7 @@ export interface InsideLabel { text: string; iconURL: string[]; style: React.CSSProperties; + contentStyle: React.CSSProperties; isHeader: boolean; displayHeaderSeparator: boolean; overflowStrategy: LabelOverflowStrategy; @@ -101,6 +102,7 @@ export interface EdgeLabel { text: string; iconURL: string[]; style: React.CSSProperties; + contentStyle: React.CSSProperties; } export interface OutsideLabel { @@ -108,5 +110,6 @@ export interface OutsideLabel { text: string; iconURL: string[]; style: React.CSSProperties; + contentStyle: React.CSSProperties; overflowStrategy: LabelOverflowStrategy; } diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/Label.tsx b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/Label.tsx index 1ebd814b0a..25029830b0 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/Label.tsx +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/Label.tsx @@ -69,7 +69,7 @@ const labelStyle = ( }; }; -const labelContentStyle = (label: EdgeLabel | InsideLabel | OutsideLabel): React.CSSProperties => { +const labelContentStyle = (theme: Theme, label: EdgeLabel | InsideLabel | OutsideLabel): React.CSSProperties => { const labelContentStyle: React.CSSProperties = { display: 'flex', alignItems: 'center', @@ -85,7 +85,14 @@ const labelContentStyle = (label: EdgeLabel | InsideLabel | OutsideLabel): React default: break; } - return labelContentStyle; + return { + ...labelContentStyle, + ...label.contentStyle, + background: label.contentStyle.background ? getCSSColor(String(label.contentStyle.background), theme) : undefined, + borderColor: label.contentStyle.borderColor + ? getCSSColor(String(label.contentStyle.borderColor), theme) + : undefined, + }; }; const labelOverflowStyle = (label: EdgeLabel | InsideLabel | OutsideLabel): React.CSSProperties => { @@ -124,7 +131,10 @@ export const Label = memo(({ diagramElementId, label, faded, transform }: LabelP label.id === currentlyEditedLabelId && !readOnly ? ( ) : ( -
+
{label.text}
diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/DefaultViewResourceProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/DefaultViewResourceProvider.java index 5444ef30a5..8555ff9e1e 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/DefaultViewResourceProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/DefaultViewResourceProvider.java @@ -54,6 +54,8 @@ public class DefaultViewResourceProvider implements IDefaultViewResourceProvider { private static final String VIEW_DOCUMENT_NAME = "ViewNewModel"; + private static final String COLOR_NAME_DARK = "color_dark"; + private static final String COLOR_NAME_TRANSPARENT = "color_transparent"; private final List migrationParticipants; @@ -106,7 +108,7 @@ private NodeDescription createNodeDescriptionsEntity1(View view, String domainNa entity1Node.setName("Entity1 Node"); entity1Node.setDomainType(domainName + "::Entity1"); entity1Node.setSemanticCandidatesExpression("aql:self.eContents()"); - entity1Node.setInsideLabel(this.createInsideLabelDescription()); + entity1Node.setInsideLabel(this.createInsideLabelDescription(view)); entity1Node.setSynchronizationPolicy(SynchronizationPolicy.SYNCHRONIZED); entity1Node.setStyle(this.createRectangularNodeStyle(view, "color_blue", "border_blue")); entity1Node.setPalette(defaultToolsFactory.createDefaultNodePalette()); @@ -118,7 +120,7 @@ private NodeDescription createNodeDescriptionsEntity2(View view, String domainNa entity2Node.setName("Entity2 Node"); entity2Node.setDomainType(domainName + "::Entity2"); entity2Node.setSemanticCandidatesExpression("aql:self.eContents()"); - entity2Node.setInsideLabel(this.createInsideLabelDescription()); + entity2Node.setInsideLabel(this.createInsideLabelDescription(view)); entity2Node.setSynchronizationPolicy(SynchronizationPolicy.SYNCHRONIZED); entity2Node.setStyle(this.createRectangularNodeStyle(view, "color_green", "border_green")); entity2Node.setPalette(defaultToolsFactory.createDefaultNodePalette()); @@ -152,15 +154,23 @@ private void addEdgeDescription(NodeDescription entity1Node, NodeDescription ent viewDiagramDescription.getEdgeDescriptions().add(linkedToEdge); EdgeStyle edgeStyle = DiagramFactory.eINSTANCE.createEdgeStyle(); - edgeStyle.setColor(this.getColorFromPalette(view, "color_dark")); + edgeStyle.setColor(this.getColorFromPalette(view, COLOR_NAME_DARK)); + edgeStyle.setBackground(this.getColorFromPalette(view, COLOR_NAME_TRANSPARENT)); + edgeStyle.setBorderColor(this.getColorFromPalette(view, COLOR_NAME_DARK)); + edgeStyle.setBorderSize(0); linkedToEdge.setStyle(edgeStyle); } - private InsideLabelDescription createInsideLabelDescription() { + private InsideLabelDescription createInsideLabelDescription(View view) { var insideLabel = DiagramFactory.eINSTANCE.createInsideLabelDescription(); insideLabel.setLabelExpression("aql:self.name"); insideLabel.setPosition(InsideLabelPosition.TOP_CENTER); - insideLabel.setStyle(DiagramFactory.eINSTANCE.createInsideLabelStyle()); + var insideLabelStyle = DiagramFactory.eINSTANCE.createInsideLabelStyle(); + insideLabelStyle.setLabelColor(this.getColorFromPalette(view, COLOR_NAME_DARK)); + insideLabelStyle.setBackground(this.getColorFromPalette(view, COLOR_NAME_TRANSPARENT)); + insideLabelStyle.setBorderColor(this.getColorFromPalette(view, COLOR_NAME_DARK)); + insideLabelStyle.setBorderSize(0); + insideLabel.setStyle(insideLabelStyle); return insideLabel; } @@ -198,11 +208,12 @@ private NodeTool createNewInstanceTool(String typeName, String referenceName) { private ColorPalette createColorPalette() { var colorPalette = ViewFactory.eINSTANCE.createColorPalette(); - colorPalette.getColors().add(this.createFixedColor("color_dark", "#002639")); + colorPalette.getColors().add(this.createFixedColor(COLOR_NAME_DARK, "#002639")); colorPalette.getColors().add(this.createFixedColor("color_blue", "#E5F5F8")); colorPalette.getColors().add(this.createFixedColor("color_green", "#B1D8B7")); colorPalette.getColors().add(this.createFixedColor("border_blue", "#33B0C3")); colorPalette.getColors().add(this.createFixedColor("border_green", "#76B947")); + colorPalette.getColors().add(this.createFixedColor(COLOR_NAME_TRANSPARENT, "transparent")); return colorPalette; } diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainDiagramDescriptionProvider.java index 2319627bbe..abdc8fc962 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainDiagramDescriptionProvider.java @@ -29,6 +29,7 @@ import org.eclipse.sirius.components.view.builder.generated.ViewBuilders; import org.eclipse.sirius.components.view.builder.providers.DefaultColorProvider; import org.eclipse.sirius.components.view.builder.providers.IColorProvider; +import org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection; import org.eclipse.sirius.components.view.diagram.DiagramDescription; import org.eclipse.sirius.components.view.emf.diagram.IDiagramIdProvider; import org.eclipse.sirius.emfjson.resource.JsonResource; @@ -160,6 +161,7 @@ private DiagramDescription domainDiagramDescription() { .domainType("domain::Domain") .titleExpression("aql:'Domain'") .palette(palette) + .arrangeLayoutDirection(ArrangeLayoutDirection.DOWN) .build(); } diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/EntityNodeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/EntityNodeDescriptionProvider.java index 93ae7fdbdc..91a64d1c60 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/EntityNodeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/EntityNodeDescriptionProvider.java @@ -98,6 +98,7 @@ private InsideLabelDescription entityNodeLabelDescription() { .showIcon(true) .withHeader(true) .displayHeaderSeparator(true) + .borderSize(0) .build(); var abstractEntityLabelStyle = new DiagramBuilders() @@ -107,6 +108,7 @@ private InsideLabelDescription entityNodeLabelDescription() { .withHeader(true) .displayHeaderSeparator(true) .italic(true) + .borderSize(0) .build(); var conditionalLabelStyle = new DiagramBuilders() @@ -152,6 +154,7 @@ private InsideLabelDescription attributeNodeLabelDescription() { .fontSize(12) .labelColor(this.colorProvider.getColor(DomainDiagramDescriptionProvider.GREY_COLOR)) .showIcon(true) + .borderSize(0) .build(); var requiredAttributeLabelStyle = new DiagramBuilders() @@ -160,6 +163,7 @@ private InsideLabelDescription attributeNodeLabelDescription() { .labelColor(this.colorProvider.getColor(DomainDiagramDescriptionProvider.GREY_COLOR)) .showIcon(true) .bold(true) + .borderSize(0) .build(); var conditionalLabelStyle = new DiagramBuilders() diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/InheritanceEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/InheritanceEdgeDescriptionProvider.java index 416cf96766..5aa6df5ab0 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/InheritanceEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/InheritanceEdgeDescriptionProvider.java @@ -58,6 +58,7 @@ private EdgeStyle inheritanceEdgeStyle() { .newEdgeStyle() .targetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW) .color(this.colorProvider.getColor(DomainDiagramDescriptionProvider.LIGHT_GREY_COLOR)) + .borderSize(0) .build(); } diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/RelationEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/RelationEdgeDescriptionProvider.java index 9827b4e5d6..59f89f4351 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/RelationEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/RelationEdgeDescriptionProvider.java @@ -62,6 +62,7 @@ private EdgeStyle relationEdgeStyle() { .newEdgeStyle() .sourceArrowStyle(ArrowStyle.FILL_DIAMOND) .color(this.colorProvider.getColor(DomainDiagramDescriptionProvider.BLACK_COLOR)) + .borderSize(0) .build(); } diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/configuration/StudioProjectTemplatesInitializer.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/configuration/StudioProjectTemplatesInitializer.java index c8afa9227d..08421cc216 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/configuration/StudioProjectTemplatesInitializer.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/configuration/StudioProjectTemplatesInitializer.java @@ -329,6 +329,7 @@ private InsideLabelDescription createInsideLabel(View view) { insideLabelDescription.setPosition(InsideLabelPosition.TOP_CENTER); InsideLabelStyle insideLabelStyle = DiagramFactory.eINSTANCE.createInsideLabelStyle(); insideLabelStyle.setLabelColor(this.getColorFromPalette(view, "color_dark")); + insideLabelStyle.setBorderSize(0); insideLabelDescription.setStyle(insideLabelStyle); return insideLabelDescription; } diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/PapayaViewBuilder.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/PapayaViewBuilder.java index 64b1ddf0d8..f3494795dc 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/PapayaViewBuilder.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/PapayaViewBuilder.java @@ -76,6 +76,7 @@ public InsideLabelDescription createInsideLabelDescription(String labelExpressio var insideLabelStyle = DiagramFactory.eINSTANCE.createInsideLabelStyle(); insideLabelStyle.setLabelColor(labelColor); + insideLabelStyle.setBorderSize(0); insideLabel.setStyle(insideLabelStyle); return insideLabel; @@ -90,6 +91,7 @@ public InsideLabelDescription createInsideLabelDescriptionWithHeader(String labe insideLabelStyle.setLabelColor(labelColor); insideLabelStyle.setWithHeader(true); insideLabelStyle.setDisplayHeaderSeparator(withSeparator); + insideLabelStyle.setBorderSize(0); insideLabel.setStyle(insideLabelStyle); return insideLabel; @@ -102,6 +104,7 @@ public OutsideLabelDescription createOutsideLabelDescription(String labelExpress var outsideLabelStyle = DiagramFactory.eINSTANCE.createOutsideLabelStyle(); outsideLabelStyle.setLabelColor(labelColor); + outsideLabelStyle.setBorderSize(0); outsideLabel.setStyle(outsideLabelStyle); return outsideLabel; diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsClassEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsClassEdgeDescriptionProvider.java index a4a61dccf9..4fd5dd3e28 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsClassEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsClassEdgeDescriptionProvider.java @@ -47,6 +47,7 @@ public EdgeDescription create() { extendsClassEdgeStyle.setLineStyle(LineStyle.SOLID); extendsClassEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); extendsClassEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_FILL_CLOSED_ARROW); + extendsClassEdgeStyle.setBorderSize(0); var extendsClassEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); extendsClassEdgeDescription.setName(NAME); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsInterfaceEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsInterfaceEdgeDescriptionProvider.java index 883e09a621..c2c4417806 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsInterfaceEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDExtendsInterfaceEdgeDescriptionProvider.java @@ -47,6 +47,7 @@ public EdgeDescription create() { extendsInterfaceEdgeStyle.setLineStyle(LineStyle.SOLID); extendsInterfaceEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); extendsInterfaceEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW); + extendsInterfaceEdgeStyle.setBorderSize(0); var extendsInterfaceEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); extendsInterfaceEdgeDescription.setName(NAME); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDImplementsInterfaceEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDImplementsInterfaceEdgeDescriptionProvider.java index c8f6ae66c1..f85b3e3b1f 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDImplementsInterfaceEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/classdiagram/CDImplementsInterfaceEdgeDescriptionProvider.java @@ -49,6 +49,7 @@ public EdgeDescription create() { implementsInterfaceEdgeStyle.setLineStyle(LineStyle.DASH); implementsInterfaceEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); implementsInterfaceEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW); + implementsInterfaceEdgeStyle.setBorderSize(0); var implementsInterfaceEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); implementsInterfaceEdgeDescription.setName(NAME); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/DependsOnEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/DependsOnEdgeDescriptionProvider.java index ab920beca5..b1f92cbf9b 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/DependsOnEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/DependsOnEdgeDescriptionProvider.java @@ -45,6 +45,7 @@ public EdgeDescription create() { dependsOnEdgeStyle.setEdgeWidth(1); dependsOnEdgeStyle.setSourceArrowStyle(ArrowStyle.OUTPUT_FILL_CLOSED_ARROW); dependsOnEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_FILL_CLOSED_ARROW); + dependsOnEdgeStyle.setBorderSize(0); var builder = new PapayaViewBuilder(); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsClassEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsClassEdgeDescriptionProvider.java index 24e708ffd7..5fd4a0bd0a 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsClassEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsClassEdgeDescriptionProvider.java @@ -45,6 +45,7 @@ public EdgeDescription create() { extendsClassEdgeStyle.setLineStyle(LineStyle.SOLID); extendsClassEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); extendsClassEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_FILL_CLOSED_ARROW); + extendsClassEdgeStyle.setBorderSize(0); var extendsClassEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); extendsClassEdgeDescription.setName("Edge Extends class"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsInterfaceEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsInterfaceEdgeDescriptionProvider.java index dfb1c43aa4..c6ceec883a 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsInterfaceEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ExtendsInterfaceEdgeDescriptionProvider.java @@ -45,6 +45,7 @@ public EdgeDescription create() { extendsInterfaceEdgeStyle.setLineStyle(LineStyle.SOLID); extendsInterfaceEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); extendsInterfaceEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW); + extendsInterfaceEdgeStyle.setBorderSize(0); var extendsInterfaceEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); extendsInterfaceEdgeDescription.setName("Edge Extends interface"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/FulfillsContractEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/FulfillsContractEdgeDescriptionProvider.java index 9e6526c2b5..bcdc43b04c 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/FulfillsContractEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/FulfillsContractEdgeDescriptionProvider.java @@ -46,6 +46,7 @@ public EdgeDescription create() { fulfillsContractEdgeStyle.setLineStyle(LineStyle.DOT); fulfillsContractEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); fulfillsContractEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW); + fulfillsContractEdgeStyle.setBorderSize(0); var fulfillsContractEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); fulfillsContractEdgeDescription.setName("Edge Fulfills contract"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ImplementsInterfaceEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ImplementsInterfaceEdgeDescriptionProvider.java index d061998644..7c21e2dbb5 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ImplementsInterfaceEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ImplementsInterfaceEdgeDescriptionProvider.java @@ -47,6 +47,7 @@ public EdgeDescription create() { implementsInterfaceEdgeStyle.setLineStyle(LineStyle.DASH); implementsInterfaceEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); implementsInterfaceEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW); + implementsInterfaceEdgeStyle.setBorderSize(0); var implementsInterfaceEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); implementsInterfaceEdgeDescription.setName("Edge Implements interface"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/RealizedByEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/RealizedByEdgeDescriptionProvider.java index 96a7855b53..c5d593a6ef 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/RealizedByEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/RealizedByEdgeDescriptionProvider.java @@ -46,6 +46,7 @@ public EdgeDescription create() { realizedByEdgeStyle.setLineStyle(LineStyle.SOLID); realizedByEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); realizedByEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_ARROW); + realizedByEdgeStyle.setBorderSize(0); var realizedByEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); realizedByEdgeDescription.setName("Edge Realized by"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ReferencesClassEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ReferencesClassEdgeDescriptionProvider.java index 3599596b7c..a208de2849 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ReferencesClassEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/ReferencesClassEdgeDescriptionProvider.java @@ -45,6 +45,7 @@ public EdgeDescription create() { extendsClassEdgeStyle.setLineStyle(LineStyle.SOLID); extendsClassEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); extendsClassEdgeStyle.setTargetArrowStyle(ArrowStyle.DIAMOND); + extendsClassEdgeStyle.setBorderSize(0); var extendsClassEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); extendsClassEdgeDescription.setName("Edge References class"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/exchange/CEDComponentExchangeEdgeProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/exchange/CEDComponentExchangeEdgeProvider.java index 9f9498635c..9a7dc8dbfd 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/exchange/CEDComponentExchangeEdgeProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/logicalarchitecture/exchange/CEDComponentExchangeEdgeProvider.java @@ -46,6 +46,7 @@ public EdgeDescription create() { componentExchangeEdgeStyle.setLineStyle(LineStyle.SOLID); componentExchangeEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); componentExchangeEdgeStyle.setTargetArrowStyle(ArrowStyle.NONE); + componentExchangeEdgeStyle.setBorderSize(0); var componentExchangeEdgeDescription = DiagramFactory.eINSTANCE.createEdgeDescription(); componentExchangeEdgeDescription.setName("Edge Component Exchange"); diff --git a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/operationalanalysis/InteractionEdgeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/operationalanalysis/InteractionEdgeDescriptionProvider.java index 753f9340a7..af88787ef2 100644 --- a/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/operationalanalysis/InteractionEdgeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-sample-application/src/main/java/org/eclipse/sirius/web/sample/papaya/view/operationalanalysis/InteractionEdgeDescriptionProvider.java @@ -45,6 +45,7 @@ public EdgeDescription create() { interactionEdgeStyle.setEdgeWidth(1); interactionEdgeStyle.setSourceArrowStyle(ArrowStyle.NONE); interactionEdgeStyle.setTargetArrowStyle(ArrowStyle.INPUT_FILL_CLOSED_ARROW); + interactionEdgeStyle.setBorderSize(0); var builder = new PapayaViewBuilder(); diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/forms/LabelStyleDetailsViewControllerTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/forms/LabelStyleDetailsViewControllerTests.java new file mode 100644 index 0000000000..6c14dce783 --- /dev/null +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/forms/LabelStyleDetailsViewControllerTests.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2024 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 + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.web.application.controllers.forms; + +import java.time.Duration; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.Predicate; + +import org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload; +import org.eclipse.sirius.components.collaborative.forms.dto.PropertiesEventInput; +import org.eclipse.sirius.components.forms.Form; +import org.eclipse.sirius.components.forms.Textfield; +import org.eclipse.sirius.components.forms.tests.assertions.FormAssertions; +import org.eclipse.sirius.components.forms.tests.graphql.PropertiesEventSubscriptionRunner; +import org.eclipse.sirius.components.forms.tests.navigation.FormNavigator; +import org.eclipse.sirius.components.widget.reference.ReferenceWidget; +import org.eclipse.sirius.web.AbstractIntegrationTests; +import org.eclipse.sirius.web.data.StudioIdentifiers; +import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.jdbc.Sql; +import org.springframework.test.context.jdbc.SqlConfig; +import org.springframework.transaction.annotation.Transactional; + +import graphql.execution.DataFetcherResult; +import reactor.test.StepVerifier; + +/** + * Integration tests of the label style details view. + * + * @author frouene + */ + +@Transactional +@SuppressWarnings("checkstyle:MultipleStringLiterals") +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class LabelStyleDetailsViewControllerTests extends AbstractIntegrationTests { + + @Autowired + private IGivenInitialServerState givenInitialServerState; + + @Autowired + private PropertiesEventSubscriptionRunner propertiesEventSubscriptionRunner; + + @BeforeEach + public void beforeEach() { + this.givenInitialServerState.initialize(); + } + + @Test + @DisplayName("Given an InsideLabelStyleDescription, when we subscribe to its properties events, then the form is sent") + @Sql(scripts = { "/scripts/studio.sql" }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) + @Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) + public void givenInsideLabelStyleDescriptionWhenWeSubscribeToItsPropertiesEventsThenTheFormIsSent() { + var input = new PropertiesEventInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString(), List.of(StudioIdentifiers.HUMAN_INSIDE_LABEL_STYLE_OBJECT.toString())); + var flux = this.propertiesEventSubscriptionRunner.run(input); + + Predicate
formPredicate = form -> { + var groupNavigator = new FormNavigator(form).page("").group("Core Properties"); + + var borderSizeTextField = groupNavigator.findWidget("Border Size", Textfield.class); + FormAssertions.assertThat(borderSizeTextField).isNotNull(); + + var backgroundReferenceWidget = groupNavigator.findWidget("Background", ReferenceWidget.class); + FormAssertions.assertThat(backgroundReferenceWidget).isNotNull(); + + var borderColorReferenceWidget = groupNavigator.findWidget("Border Color", ReferenceWidget.class); + FormAssertions.assertThat(borderColorReferenceWidget).isNotNull(); + + return true; + }; + + Predicate formContentMatcher = object -> Optional.of(object) + .filter(DataFetcherResult.class::isInstance) + .map(DataFetcherResult.class::cast) + .map(DataFetcherResult::getData) + .filter(FormRefreshedEventPayload.class::isInstance) + .map(FormRefreshedEventPayload.class::cast) + .map(FormRefreshedEventPayload::form) + .filter(formPredicate) + .isPresent(); + + StepVerifier.create(flux) + .expectNextMatches(formContentMatcher) + .thenCancel() + .verify(Duration.ofSeconds(10)); + } + +} + diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/StudioIdentifiers.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/StudioIdentifiers.java index 079a7558d3..f000b5fdf0 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/StudioIdentifiers.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/StudioIdentifiers.java @@ -49,6 +49,8 @@ public final class StudioIdentifiers { public static final UUID ELLIPSE_NODE_STYLE_DESCRIPTION_OBJECT = UUID.fromString("3b3637a2-c397-4837-b42f-25fee34e5af2"); + public static final UUID HUMAN_INSIDE_LABEL_STYLE_OBJECT = UUID.fromString("c8338087-e98e-43bd-ae1a-879b64308a7d"); + private StudioIdentifiers() { // Prevent instantiation } diff --git a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowViewBuilder.java b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowViewBuilder.java index b9bd00345b..e46ee40079 100644 --- a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowViewBuilder.java +++ b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowViewBuilder.java @@ -138,6 +138,7 @@ public InsideLabelDescription getInsideLabelDescription(IColorProvider colorProv .bold(bold) .withHeader(withHeader) .displayHeaderSeparator(displayHeaderSeparator) + .borderSize(0) .build()) .position(InsideLabelPosition.TOP_CENTER) .build(); @@ -148,6 +149,7 @@ public OutsideLabelDescription getOutsideLabelDescription(IColorProvider colorPr .labelExpression(labelExpression) .style(this.diagramBuilderHelper.newOutsideLabelStyle() .labelColor(colorProvider.getColor("Flow_Black")) + .borderSize(0) .build()) .position(OutsideLabelPosition.BOTTOM_CENTER) .build(); diff --git a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/DataSourceToProcessorEdgeDescriptionProvider.java b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/DataSourceToProcessorEdgeDescriptionProvider.java index 8a0f9e968d..44272300e1 100644 --- a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/DataSourceToProcessorEdgeDescriptionProvider.java +++ b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/DataSourceToProcessorEdgeDescriptionProvider.java @@ -63,6 +63,7 @@ public EdgeDescription create() { .lineStyle(LineStyle.DASH) .color(this.colorProvider.getColor("Flow_Gray")) .targetArrowStyle(ArrowStyle.INPUT_CLOSED_ARROW) + .borderSize(0) .build()) .palette(this.createEdgePalette()) .build(); diff --git a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/ProcessorToProcessorEdgeDescriptionProvider.java b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/ProcessorToProcessorEdgeDescriptionProvider.java index d9d8a9cf20..2bd69a91ac 100644 --- a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/ProcessorToProcessorEdgeDescriptionProvider.java +++ b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/descriptions/ProcessorToProcessorEdgeDescriptionProvider.java @@ -63,6 +63,7 @@ public EdgeDescription create() { .lineStyle(LineStyle.SOLID) .color(this.colorProvider.getColor("Flow_Gray")) .targetArrowStyle(ArrowStyle.INPUT_ARROW) + .borderSize(0) .build()) .palette(this.createEdgePalette()) .build(); diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalEdgeStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalEdgeStyleBuilder.java index 36690832d0..7fbd9836d5 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalEdgeStyleBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalEdgeStyleBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -105,6 +105,46 @@ public ConditionalEdgeStyleBuilder strikeThrough(java.lang.Boolean value) { this.getConditionalEdgeStyle().setStrikeThrough(value); return this; } + /** + * Setter for BorderColor. + * + * @generated + */ + public ConditionalEdgeStyleBuilder borderColor(org.eclipse.sirius.components.view.UserColor value) { + this.getConditionalEdgeStyle().setBorderColor(value); + return this; + } + + /** + * Setter for BorderRadius. + * + * @generated + */ + public ConditionalEdgeStyleBuilder borderRadius(java.lang.Integer value) { + this.getConditionalEdgeStyle().setBorderRadius(value); + return this; + } + + /** + * Setter for BorderSize. + * + * @generated + */ + public ConditionalEdgeStyleBuilder borderSize(java.lang.Integer value) { + this.getConditionalEdgeStyle().setBorderSize(value); + return this; + } + + /** + * Setter for BorderLineStyle. + * + * @generated + */ + public ConditionalEdgeStyleBuilder borderLineStyle(org.eclipse.sirius.components.view.diagram.LineStyle value) { + this.getConditionalEdgeStyle().setBorderLineStyle(value); + return this; + } + /** * Setter for LineStyle. * @@ -161,5 +201,15 @@ public ConditionalEdgeStyleBuilder labelIcon(java.lang.String value) { return this; } + /** + * Setter for Background. + * + * @generated + */ + public ConditionalEdgeStyleBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getConditionalEdgeStyle().setBackground(value); + return this; + } + } diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EdgeStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EdgeStyleBuilder.java index 3de943e97e..ba25164d6d 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EdgeStyleBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EdgeStyleBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -96,6 +96,46 @@ public EdgeStyleBuilder strikeThrough(java.lang.Boolean value) { this.getEdgeStyle().setStrikeThrough(value); return this; } + /** + * Setter for BorderColor. + * + * @generated + */ + public EdgeStyleBuilder borderColor(org.eclipse.sirius.components.view.UserColor value) { + this.getEdgeStyle().setBorderColor(value); + return this; + } + + /** + * Setter for BorderRadius. + * + * @generated + */ + public EdgeStyleBuilder borderRadius(java.lang.Integer value) { + this.getEdgeStyle().setBorderRadius(value); + return this; + } + + /** + * Setter for BorderSize. + * + * @generated + */ + public EdgeStyleBuilder borderSize(java.lang.Integer value) { + this.getEdgeStyle().setBorderSize(value); + return this; + } + + /** + * Setter for BorderLineStyle. + * + * @generated + */ + public EdgeStyleBuilder borderLineStyle(org.eclipse.sirius.components.view.diagram.LineStyle value) { + this.getEdgeStyle().setBorderLineStyle(value); + return this; + } + /** * Setter for LineStyle. * @@ -152,5 +192,15 @@ public EdgeStyleBuilder labelIcon(java.lang.String value) { return this; } + /** + * Setter for Background. + * + * @generated + */ + public EdgeStyleBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getEdgeStyle().setBackground(value); + return this; + } + } diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/InsideLabelStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/InsideLabelStyleBuilder.java index 8182d3ec69..d18288fe49 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/InsideLabelStyleBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/InsideLabelStyleBuilder.java @@ -95,6 +95,46 @@ public InsideLabelStyleBuilder strikeThrough(java.lang.Boolean value) { return this; } + /** + * Setter for BorderColor. + * + * @generated + */ + public InsideLabelStyleBuilder borderColor(org.eclipse.sirius.components.view.UserColor value) { + this.getInsideLabelStyle().setBorderColor(value); + return this; + } + + /** + * Setter for BorderRadius. + * + * @generated + */ + public InsideLabelStyleBuilder borderRadius(java.lang.Integer value) { + this.getInsideLabelStyle().setBorderRadius(value); + return this; + } + + /** + * Setter for BorderSize. + * + * @generated + */ + public InsideLabelStyleBuilder borderSize(java.lang.Integer value) { + this.getInsideLabelStyle().setBorderSize(value); + return this; + } + + /** + * Setter for BorderLineStyle. + * + * @generated + */ + public InsideLabelStyleBuilder borderLineStyle(org.eclipse.sirius.components.view.diagram.LineStyle value) { + this.getInsideLabelStyle().setBorderLineStyle(value); + return this; + } + /** * Setter for LabelColor. * @@ -105,6 +145,16 @@ public InsideLabelStyleBuilder labelColor(org.eclipse.sirius.components.view.Use return this; } + /** + * Setter for Background. + * + * @generated + */ + public InsideLabelStyleBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getInsideLabelStyle().setBackground(value); + return this; + } + /** * Setter for ShowIcon. * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/NodeLabelStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/NodeLabelStyleBuilder.java index 781b61f73e..bd9646ea4a 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/NodeLabelStyleBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/NodeLabelStyleBuilder.java @@ -77,6 +77,46 @@ public NodeLabelStyleBuilder strikeThrough(java.lang.Boolean value) { return this; } + /** + * Setter for BorderColor. + * + * @generated + */ + public NodeLabelStyleBuilder borderColor(org.eclipse.sirius.components.view.UserColor value) { + this.getNodeLabelStyle().setBorderColor(value); + return this; + } + + /** + * Setter for BorderRadius. + * + * @generated + */ + public NodeLabelStyleBuilder borderRadius(java.lang.Integer value) { + this.getNodeLabelStyle().setBorderRadius(value); + return this; + } + + /** + * Setter for BorderSize. + * + * @generated + */ + public NodeLabelStyleBuilder borderSize(java.lang.Integer value) { + this.getNodeLabelStyle().setBorderSize(value); + return this; + } + + /** + * Setter for BorderLineStyle. + * + * @generated + */ + public NodeLabelStyleBuilder borderLineStyle(org.eclipse.sirius.components.view.diagram.LineStyle value) { + this.getNodeLabelStyle().setBorderLineStyle(value); + return this; + } + /** * Setter for LabelColor. * @@ -87,6 +127,16 @@ public NodeLabelStyleBuilder labelColor(org.eclipse.sirius.components.view.UserC return this; } + /** + * Setter for Background. + * + * @generated + */ + public NodeLabelStyleBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getNodeLabelStyle().setBackground(value); + return this; + } + /** * Setter for ShowIcon. * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/OutsideLabelStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/OutsideLabelStyleBuilder.java index 67befc581c..b844626b0f 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/OutsideLabelStyleBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/OutsideLabelStyleBuilder.java @@ -95,6 +95,46 @@ public OutsideLabelStyleBuilder strikeThrough(java.lang.Boolean value) { return this; } + /** + * Setter for BorderColor. + * + * @generated + */ + public OutsideLabelStyleBuilder borderColor(org.eclipse.sirius.components.view.UserColor value) { + this.getOutsideLabelStyle().setBorderColor(value); + return this; + } + + /** + * Setter for BorderRadius. + * + * @generated + */ + public OutsideLabelStyleBuilder borderRadius(java.lang.Integer value) { + this.getOutsideLabelStyle().setBorderRadius(value); + return this; + } + + /** + * Setter for BorderSize. + * + * @generated + */ + public OutsideLabelStyleBuilder borderSize(java.lang.Integer value) { + this.getOutsideLabelStyle().setBorderSize(value); + return this; + } + + /** + * Setter for BorderLineStyle. + * + * @generated + */ + public OutsideLabelStyleBuilder borderLineStyle(org.eclipse.sirius.components.view.diagram.LineStyle value) { + this.getOutsideLabelStyle().setBorderLineStyle(value); + return this; + } + /** * Setter for LabelColor. * @@ -105,6 +145,16 @@ public OutsideLabelStyleBuilder labelColor(org.eclipse.sirius.components.view.Us return this; } + /** + * Setter for Background. + * + * @generated + */ + public OutsideLabelStyleBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getOutsideLabelStyle().setBackground(value); + return this; + } + /** * Setter for ShowIcon. * diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalEdgeStyleItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalEdgeStyleItemProvider.java index c6602a6541..c25f2fe142 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalEdgeStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalEdgeStyleItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -33,6 +33,7 @@ * @generated */ public class ConditionalEdgeStyleItemProvider extends ConditionalItemProvider { + /** * This constructs an instance from a factory and a notifier. * @@ -58,12 +59,17 @@ public List getPropertyDescriptors(Object object) { this.addBoldPropertyDescriptor(object); this.addUnderlinePropertyDescriptor(object); this.addStrikeThroughPropertyDescriptor(object); + this.addBorderColorPropertyDescriptor(object); + this.addBorderRadiusPropertyDescriptor(object); + this.addBorderSizePropertyDescriptor(object); + this.addBorderLineStylePropertyDescriptor(object); this.addLineStylePropertyDescriptor(object); this.addSourceArrowStylePropertyDescriptor(object); this.addTargetArrowStylePropertyDescriptor(object); this.addEdgeWidthPropertyDescriptor(object); this.addShowIconPropertyDescriptor(object); this.addLabelIconPropertyDescriptor(object); + this.addBackgroundPropertyDescriptor(object); } return this.itemPropertyDescriptors; } @@ -134,6 +140,50 @@ protected void addStrikeThroughPropertyDescriptor(Object object) { ViewPackage.Literals.LABEL_STYLE__STRIKE_THROUGH, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } + /** + * This adds a property descriptor for the Border Color feature. + * + * @generated + */ + protected void addBorderColorPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderColor_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderColor_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_COLOR, true, false, false, null, null, null)); + } + + /** + * This adds a property descriptor for the Border Radius feature. + * + * @generated + */ + protected void addBorderRadiusPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderRadius_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderRadius_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_RADIUS, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Size feature. + * + * @generated + */ + protected void addBorderSizePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderSize_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderSize_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_SIZE, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Line Style feature. + * + * @generated + */ + protected void addBorderLineStylePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderLineStyle_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderLineStyle_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_LINE_STYLE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + /** * This adds a property descriptor for the Line Style feature. * @@ -200,6 +250,17 @@ protected void addLabelIconPropertyDescriptor(Object object) { DiagramPackage.Literals.EDGE_STYLE__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } + /** + * This adds a property descriptor for the Background feature. + * + * @generated + */ + protected void addBackgroundPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_EdgeStyle_background_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_EdgeStyle_background_feature", "_UI_EdgeStyle_type"), + DiagramPackage.Literals.EDGE_STYLE__BACKGROUND, true, false, true, null, null, null)); + } + /** * This returns ConditionalEdgeStyle.gif. * @@ -249,6 +310,10 @@ public void notifyChanged(Notification notification) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__BOLD: case DiagramPackage.CONDITIONAL_EDGE_STYLE__UNDERLINE: case DiagramPackage.CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH: + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR: + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS: + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE: + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE: case DiagramPackage.CONDITIONAL_EDGE_STYLE__LINE_STYLE: case DiagramPackage.CONDITIONAL_EDGE_STYLE__SOURCE_ARROW_STYLE: case DiagramPackage.CONDITIONAL_EDGE_STYLE__TARGET_ARROW_STYLE: diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/EdgeStyleItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/EdgeStyleItemProvider.java index 8e6b2f7f27..98b3de3426 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/EdgeStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/EdgeStyleItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -32,6 +32,7 @@ * @generated */ public class EdgeStyleItemProvider extends StyleItemProvider { + /** * This constructs an instance from a factory and a notifier. * @@ -56,12 +57,17 @@ public List getPropertyDescriptors(Object object) { this.addBoldPropertyDescriptor(object); this.addUnderlinePropertyDescriptor(object); this.addStrikeThroughPropertyDescriptor(object); + this.addBorderColorPropertyDescriptor(object); + this.addBorderRadiusPropertyDescriptor(object); + this.addBorderSizePropertyDescriptor(object); + this.addBorderLineStylePropertyDescriptor(object); this.addLineStylePropertyDescriptor(object); this.addSourceArrowStylePropertyDescriptor(object); this.addTargetArrowStylePropertyDescriptor(object); this.addEdgeWidthPropertyDescriptor(object); this.addShowIconPropertyDescriptor(object); this.addLabelIconPropertyDescriptor(object); + this.addBackgroundPropertyDescriptor(object); } return this.itemPropertyDescriptors; } @@ -121,6 +127,50 @@ protected void addStrikeThroughPropertyDescriptor(Object object) { ViewPackage.Literals.LABEL_STYLE__STRIKE_THROUGH, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } + /** + * This adds a property descriptor for the Border Color feature. + * + * @generated + */ + protected void addBorderColorPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderColor_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderColor_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_COLOR, true, false, false, null, null, null)); + } + + /** + * This adds a property descriptor for the Border Radius feature. + * + * @generated + */ + protected void addBorderRadiusPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderRadius_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderRadius_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_RADIUS, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Size feature. + * + * @generated + */ + protected void addBorderSizePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderSize_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderSize_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_SIZE, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Line Style feature. + * + * @generated + */ + protected void addBorderLineStylePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderLineStyle_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderLineStyle_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_LINE_STYLE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + /** * This adds a property descriptor for the Line Style feature. * @@ -187,6 +237,17 @@ protected void addLabelIconPropertyDescriptor(Object object) { DiagramPackage.Literals.EDGE_STYLE__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } + /** + * This adds a property descriptor for the Background feature. + * + * @generated + */ + protected void addBackgroundPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_EdgeStyle_background_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_EdgeStyle_background_feature", "_UI_EdgeStyle_type"), + DiagramPackage.Literals.EDGE_STYLE__BACKGROUND, true, false, true, null, null, null)); + } + /** * This returns EdgeStyle.gif. * @@ -235,6 +296,10 @@ public void notifyChanged(Notification notification) { case DiagramPackage.EDGE_STYLE__BOLD: case DiagramPackage.EDGE_STYLE__UNDERLINE: case DiagramPackage.EDGE_STYLE__STRIKE_THROUGH: + case DiagramPackage.EDGE_STYLE__BORDER_COLOR: + case DiagramPackage.EDGE_STYLE__BORDER_RADIUS: + case DiagramPackage.EDGE_STYLE__BORDER_SIZE: + case DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE: case DiagramPackage.EDGE_STYLE__LINE_STYLE: case DiagramPackage.EDGE_STYLE__SOURCE_ARROW_STYLE: case DiagramPackage.EDGE_STYLE__TARGET_ARROW_STYLE: diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/InsideLabelStyleItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/InsideLabelStyleItemProvider.java index f2f97ded79..a4a4741f82 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/InsideLabelStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/InsideLabelStyleItemProvider.java @@ -52,7 +52,12 @@ public List getPropertyDescriptors(Object object) { if (this.itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + this.addBorderColorPropertyDescriptor(object); + this.addBorderRadiusPropertyDescriptor(object); + this.addBorderSizePropertyDescriptor(object); + this.addBorderLineStylePropertyDescriptor(object); this.addLabelColorPropertyDescriptor(object); + this.addBackgroundPropertyDescriptor(object); this.addShowIconPropertyDescriptor(object); this.addLabelIconPropertyDescriptor(object); this.addWithHeaderPropertyDescriptor(object); @@ -61,6 +66,50 @@ public List getPropertyDescriptors(Object object) { return this.itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Border Color feature. + * + * @generated + */ + protected void addBorderColorPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderColor_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderColor_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_COLOR, true, false, false, null, null, null)); + } + + /** + * This adds a property descriptor for the Border Radius feature. + * + * @generated + */ + protected void addBorderRadiusPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderRadius_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderRadius_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_RADIUS, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Size feature. + * + * @generated + */ + protected void addBorderSizePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderSize_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderSize_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_SIZE, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Line Style feature. + * + * @generated + */ + protected void addBorderLineStylePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderLineStyle_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderLineStyle_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_LINE_STYLE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + /** * This adds a property descriptor for the Label Color feature. * @@ -94,6 +143,17 @@ protected void addLabelIconPropertyDescriptor(Object object) { DiagramPackage.Literals.NODE_LABEL_STYLE__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } + /** + * This adds a property descriptor for the Background feature. + * + * @generated + */ + protected void addBackgroundPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_NodeLabelStyle_background_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_NodeLabelStyle_background_feature", "_UI_NodeLabelStyle_type"), + DiagramPackage.Literals.NODE_LABEL_STYLE__BACKGROUND, true, false, true, null, null, null)); + } + /** * This adds a property descriptor for the With Header feature. * @@ -161,6 +221,10 @@ public void notifyChanged(Notification notification) { this.updateChildren(notification); switch (notification.getFeatureID(InsideLabelStyle.class)) { + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR: + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS: + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE: + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE: case DiagramPackage.INSIDE_LABEL_STYLE__SHOW_ICON: case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_ICON: case DiagramPackage.INSIDE_LABEL_STYLE__WITH_HEADER: diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/OutsideLabelStyleItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/OutsideLabelStyleItemProvider.java index 32209f13a8..80da2a2894 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/OutsideLabelStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/OutsideLabelStyleItemProvider.java @@ -52,13 +52,62 @@ public List getPropertyDescriptors(Object object) { if (this.itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + this.addBorderColorPropertyDescriptor(object); + this.addBorderRadiusPropertyDescriptor(object); + this.addBorderSizePropertyDescriptor(object); + this.addBorderLineStylePropertyDescriptor(object); this.addLabelColorPropertyDescriptor(object); + this.addBackgroundPropertyDescriptor(object); this.addShowIconPropertyDescriptor(object); this.addLabelIconPropertyDescriptor(object); } return this.itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Border Color feature. + * + * @generated + */ + protected void addBorderColorPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderColor_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderColor_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_COLOR, true, false, false, null, null, null)); + } + + /** + * This adds a property descriptor for the Border Radius feature. + * + * @generated + */ + protected void addBorderRadiusPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderRadius_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderRadius_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_RADIUS, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Size feature. + * + * @generated + */ + protected void addBorderSizePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderSize_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderSize_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_SIZE, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Border Line Style feature. + * + * @generated + */ + protected void addBorderLineStylePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_BorderStyle_borderLineStyle_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_BorderStyle_borderLineStyle_feature", "_UI_BorderStyle_type"), + DiagramPackage.Literals.BORDER_STYLE__BORDER_LINE_STYLE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + /** * This adds a property descriptor for the Label Color feature. * @@ -92,6 +141,17 @@ protected void addLabelIconPropertyDescriptor(Object object) { DiagramPackage.Literals.NODE_LABEL_STYLE__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } + /** + * This adds a property descriptor for the Background feature. + * + * @generated + */ + protected void addBackgroundPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_NodeLabelStyle_background_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_NodeLabelStyle_background_feature", "_UI_NodeLabelStyle_type"), + DiagramPackage.Literals.NODE_LABEL_STYLE__BACKGROUND, true, false, true, null, null, null)); + } + /** * This returns OutsideLabelStyle.gif. * @@ -135,6 +195,10 @@ public void notifyChanged(Notification notification) { this.updateChildren(notification); switch (notification.getFeatureID(OutsideLabelStyle.class)) { + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR: + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS: + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE: + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE: case DiagramPackage.OUTSIDE_LABEL_STYLE__SHOW_ICON: case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_ICON: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/resources/plugin.properties b/packages/view/backend/sirius-components-view-diagram-edit/src/main/resources/plugin.properties index da3f69e91f..6c4c332a7f 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/resources/plugin.properties +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/resources/plugin.properties @@ -125,8 +125,10 @@ _UI_BorderStyle_borderLineStyle_feature=Border Line Style _UI_InsideLabelStyle_withHeader_feature=With Header _UI_InsideLabelStyle_displayHeaderSeparator_feature=Display Header Separator _UI_NodeLabelStyle_labelColor_feature=Label Color +_UI_NodeLabelStyle_background_feature=Background _UI_NodeLabelStyle_showIcon_feature=Show Icon _UI_NodeLabelStyle_labelIcon_feature=Label Icon +_UI_NodeLabelStyle_background_feature=Background _UI_ConditionalNodeStyle_style_feature=Style _UI_ConditionalInsideLabelStyle_style_feature=Style _UI_ConditionalOutsideLabelStyle_style_feature=Style @@ -140,6 +142,7 @@ _UI_EdgeStyle_targetArrowStyle_feature=Target Arrow Style _UI_EdgeStyle_edgeWidth_feature=Edge Width _UI_EdgeStyle_showIcon_feature=Show Icon _UI_EdgeStyle_labelIcon_feature=Label Icon +_UI_EdgeStyle_background_feature=Background _UI_DiagramPalette_dropTool_feature=Drop Tool _UI_DiagramPalette_dropNodeTool_feature=Drop Node Tool _UI_DiagramPalette_nodeTools_feature=Node Tools diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramPackage.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramPackage.java index a497502b24..7b0f3f8377 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramPackage.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramPackage.java @@ -1111,13 +1111,54 @@ public interface DiagramPackage extends EPackage { */ int NODE_LABEL_STYLE__STRIKE_THROUGH = ViewPackage.LABEL_STYLE__STRIKE_THROUGH; + /** + * The feature id for the 'Border Color' reference. + * + * @generated + * @ordered + */ + int NODE_LABEL_STYLE__BORDER_COLOR = ViewPackage.LABEL_STYLE_FEATURE_COUNT; + + /** + * The feature id for the 'Border Radius' attribute. + * + * @generated + * @ordered + */ + int NODE_LABEL_STYLE__BORDER_RADIUS = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Border Size' attribute. + * + * @generated + * @ordered + */ + int NODE_LABEL_STYLE__BORDER_SIZE = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Border Line Style' attribute. + * + * @generated + * @ordered + */ + int NODE_LABEL_STYLE__BORDER_LINE_STYLE = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 3; + /** * The feature id for the 'Label Color' reference. * * @generated * @ordered */ - int NODE_LABEL_STYLE__LABEL_COLOR = ViewPackage.LABEL_STYLE_FEATURE_COUNT; + int NODE_LABEL_STYLE__LABEL_COLOR = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Background' reference. + * + * @generated + * @ordered + */ + int NODE_LABEL_STYLE__BACKGROUND = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 5; /** * The feature id for the 'Show Icon' attribute. @@ -1125,7 +1166,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int NODE_LABEL_STYLE__SHOW_ICON = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 1; + int NODE_LABEL_STYLE__SHOW_ICON = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 6; /** * The feature id for the 'Label Icon' attribute. @@ -1133,7 +1174,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int NODE_LABEL_STYLE__LABEL_ICON = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 2; + int NODE_LABEL_STYLE__LABEL_ICON = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 7; /** * The number of structural features of the 'Node Label Style' class. @@ -1202,6 +1243,39 @@ public interface DiagramPackage extends EPackage { */ int INSIDE_LABEL_STYLE__STRIKE_THROUGH = NODE_LABEL_STYLE__STRIKE_THROUGH; + /** + * The feature id for the 'Border Color' reference. + * + * @generated + * @ordered + */ + int INSIDE_LABEL_STYLE__BORDER_COLOR = NODE_LABEL_STYLE__BORDER_COLOR; + + /** + * The feature id for the 'Border Radius' attribute. + * + * @generated + * @ordered + */ + int INSIDE_LABEL_STYLE__BORDER_RADIUS = NODE_LABEL_STYLE__BORDER_RADIUS; + + /** + * The feature id for the 'Border Size' attribute. + * + * @generated + * @ordered + */ + int INSIDE_LABEL_STYLE__BORDER_SIZE = NODE_LABEL_STYLE__BORDER_SIZE; + + /** + * The feature id for the 'Border Line Style' attribute. + * + * @generated + * @ordered + */ + int INSIDE_LABEL_STYLE__BORDER_LINE_STYLE = NODE_LABEL_STYLE__BORDER_LINE_STYLE; + /** * The feature id for the 'Label Color' reference. * @@ -1210,6 +1284,14 @@ public interface DiagramPackage extends EPackage { */ int INSIDE_LABEL_STYLE__LABEL_COLOR = NODE_LABEL_STYLE__LABEL_COLOR; + /** + * The feature id for the 'Background' reference. + * + * @generated + * @ordered + */ + int INSIDE_LABEL_STYLE__BACKGROUND = NODE_LABEL_STYLE__BACKGROUND; + /** * The feature id for the 'Show Icon' attribute. * @@ -1311,6 +1393,39 @@ public interface DiagramPackage extends EPackage { */ int OUTSIDE_LABEL_STYLE__STRIKE_THROUGH = NODE_LABEL_STYLE__STRIKE_THROUGH; + /** + * The feature id for the 'Border Color' reference. + * + * @generated + * @ordered + */ + int OUTSIDE_LABEL_STYLE__BORDER_COLOR = NODE_LABEL_STYLE__BORDER_COLOR; + + /** + * The feature id for the 'Border Radius' attribute. + * + * @generated + * @ordered + */ + int OUTSIDE_LABEL_STYLE__BORDER_RADIUS = NODE_LABEL_STYLE__BORDER_RADIUS; + + /** + * The feature id for the 'Border Size' attribute. + * + * @generated + * @ordered + */ + int OUTSIDE_LABEL_STYLE__BORDER_SIZE = NODE_LABEL_STYLE__BORDER_SIZE; + + /** + * The feature id for the 'Border Line Style' attribute. + * + * @generated + * @ordered + */ + int OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE = NODE_LABEL_STYLE__BORDER_LINE_STYLE; + /** * The feature id for the 'Label Color' reference. * @@ -1319,6 +1434,14 @@ public interface DiagramPackage extends EPackage { */ int OUTSIDE_LABEL_STYLE__LABEL_COLOR = NODE_LABEL_STYLE__LABEL_COLOR; + /** + * The feature id for the 'Background' reference. + * + * @generated + * @ordered + */ + int OUTSIDE_LABEL_STYLE__BACKGROUND = NODE_LABEL_STYLE__BACKGROUND; + /** * The feature id for the 'Show Icon' attribute. * @@ -1784,13 +1907,46 @@ public interface DiagramPackage extends EPackage { */ int EDGE_STYLE__STRIKE_THROUGH = STYLE_FEATURE_COUNT + 4; + /** + * The feature id for the 'Border Color' reference. + * + * @generated + * @ordered + */ + int EDGE_STYLE__BORDER_COLOR = STYLE_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Border Radius' attribute. + * + * @generated + * @ordered + */ + int EDGE_STYLE__BORDER_RADIUS = STYLE_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Border Size' attribute. + * + * @generated + * @ordered + */ + int EDGE_STYLE__BORDER_SIZE = STYLE_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Border Line Style' attribute. + * + * @generated + * @ordered + */ + int EDGE_STYLE__BORDER_LINE_STYLE = STYLE_FEATURE_COUNT + 8; + /** * The feature id for the 'Line Style' attribute. * * @generated * @ordered */ - int EDGE_STYLE__LINE_STYLE = STYLE_FEATURE_COUNT + 5; + int EDGE_STYLE__LINE_STYLE = STYLE_FEATURE_COUNT + 9; /** * The feature id for the 'Source Arrow Style' attribute. @@ -1816,7 +1972,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_STYLE__EDGE_WIDTH = STYLE_FEATURE_COUNT + 8; + int EDGE_STYLE__EDGE_WIDTH = STYLE_FEATURE_COUNT + 12; /** * The feature id for the 'Show Icon' attribute. @@ -1824,7 +1980,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_STYLE__SHOW_ICON = STYLE_FEATURE_COUNT + 9; + int EDGE_STYLE__SHOW_ICON = STYLE_FEATURE_COUNT + 13; /** * The feature id for the 'Label Icon' attribute. @@ -1832,7 +1988,15 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_STYLE__LABEL_ICON = STYLE_FEATURE_COUNT + 10; + int EDGE_STYLE__LABEL_ICON = STYLE_FEATURE_COUNT + 14; + + /** + * The feature id for the 'Background' reference. + * + * @generated + * @ordered + */ + int EDGE_STYLE__BACKGROUND = STYLE_FEATURE_COUNT + 15; /** * The number of structural features of the 'Edge Style' class. @@ -1917,13 +2081,46 @@ public interface DiagramPackage extends EPackage { */ int CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH = ViewPackage.CONDITIONAL_FEATURE_COUNT + 5; + /** + * The feature id for the 'Border Color' reference. + * + * @generated + * @ordered + */ + int CONDITIONAL_EDGE_STYLE__BORDER_COLOR = ViewPackage.CONDITIONAL_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Border Radius' attribute. + * + * @generated + * @ordered + */ + int CONDITIONAL_EDGE_STYLE__BORDER_RADIUS = ViewPackage.CONDITIONAL_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Border Size' attribute. + * + * @generated + * @ordered + */ + int CONDITIONAL_EDGE_STYLE__BORDER_SIZE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Border Line Style' attribute. + * + * @generated + * @ordered + */ + int CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 9; + /** * The feature id for the 'Line Style' attribute. * * @generated * @ordered */ - int CONDITIONAL_EDGE_STYLE__LINE_STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 6; + int CONDITIONAL_EDGE_STYLE__LINE_STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 10; /** * The feature id for the 'Source Arrow Style' attribute. @@ -1949,7 +2146,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_EDGE_STYLE__EDGE_WIDTH = ViewPackage.CONDITIONAL_FEATURE_COUNT + 9; + int CONDITIONAL_EDGE_STYLE__EDGE_WIDTH = ViewPackage.CONDITIONAL_FEATURE_COUNT + 13; /** * The feature id for the 'Show Icon' attribute. @@ -1957,7 +2154,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_EDGE_STYLE__SHOW_ICON = ViewPackage.CONDITIONAL_FEATURE_COUNT + 10; + int CONDITIONAL_EDGE_STYLE__SHOW_ICON = ViewPackage.CONDITIONAL_FEATURE_COUNT + 14; /** * The feature id for the 'Label Icon' attribute. @@ -1965,7 +2162,15 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_EDGE_STYLE__LABEL_ICON = ViewPackage.CONDITIONAL_FEATURE_COUNT + 11; + int CONDITIONAL_EDGE_STYLE__LABEL_ICON = ViewPackage.CONDITIONAL_FEATURE_COUNT + 15; + + /** + * The feature id for the 'Background' reference. + * + * @generated + * @ordered + */ + int CONDITIONAL_EDGE_STYLE__BACKGROUND = ViewPackage.CONDITIONAL_FEATURE_COUNT + 16; /** * The number of structural features of the 'Conditional Edge Style' class. + * + * @generated + */ + DiagramPackage eINSTANCE = org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl.init(); /** * The number of structural features of the 'Drop Node Tool' class. @@ -3209,12 +3420,6 @@ public interface DiagramPackage extends EPackage { * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelTextAlign() */ int LABEL_TEXT_ALIGN = 53; - /** - * The singleton instance of the package. - * - * @generated - */ - DiagramPackage eINSTANCE = org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl.init(); /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.DiagramDescription @@ -4087,6 +4292,18 @@ public interface DiagramPackage extends EPackage { */ EReference getNodeLabelStyle_LabelColor(); + /** + * Returns the meta object for the reference + * '{@link org.eclipse.sirius.components.view.diagram.NodeLabelStyle#getBackground Background}'. + * + * @return the meta object for the reference 'Background'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle#getBackground() + * @see #getNodeLabelStyle() + */ + EReference getNodeLabelStyle_Background(); + /** * Returns the meta object for the attribute * '{@link org.eclipse.sirius.components.view.diagram.NodeLabelStyle#isShowIcon Show Icon}'. + * + * @return the meta object for the reference 'Background'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeStyle#getBackground() + * @see #getEdgeStyle() + */ + EReference getEdgeStyle_Background(); + /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle * Conditional Edge Style}'. @@ -5785,6 +6014,14 @@ interface Literals { */ EReference NODE_LABEL_STYLE__LABEL_COLOR = eINSTANCE.getNodeLabelStyle_LabelColor(); + /** + * The meta object literal for the 'Background' reference feature. + * + * @generated + */ + EReference NODE_LABEL_STYLE__BACKGROUND = eINSTANCE.getNodeLabelStyle_Background(); + /** * The meta object literal for the 'Show Icon' attribute feature. @@ -5991,6 +6228,14 @@ interface Literals { */ EAttribute EDGE_STYLE__LABEL_ICON = eINSTANCE.getEdgeStyle_LabelIcon(); + /** + * The meta object literal for the 'Background' reference feature. + * + * @generated + */ + EReference EDGE_STYLE__BACKGROUND = eINSTANCE.getEdgeStyle_Background(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl Conditional Edge diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/EdgeStyle.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/EdgeStyle.java index e92f76f0c4..7b2ce9c346 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/EdgeStyle.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/EdgeStyle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.components.view.diagram; import org.eclipse.sirius.components.view.LabelStyle; +import org.eclipse.sirius.components.view.UserColor; /** * A representation of the model object 'Edge Style'. @@ -27,24 +28,26 @@ *
  • {@link org.eclipse.sirius.components.view.diagram.EdgeStyle#getEdgeWidth Edge Width}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.EdgeStyle#isShowIcon Show Icon}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.EdgeStyle#getLabelIcon Label Icon}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.EdgeStyle#getBackground Background}
  • * * - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle() * @model * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle() */ -public interface EdgeStyle extends Style, LabelStyle { +public interface EdgeStyle extends Style, LabelStyle, BorderStyle { + /** * Returns the value of the 'Line Style' attribute. The default value is "Solid". The * literals are from the enumeration {@link org.eclipse.sirius.components.view.diagram.LineStyle}. * * @return the value of the 'Line Style' attribute. + * @model default="Solid" required="true" + * @generated * @see org.eclipse.sirius.components.view.diagram.LineStyle * @see #setLineStyle(LineStyle) * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_LineStyle() - * @model default="Solid" required="true" - * @generated */ LineStyle getLineStyle(); @@ -53,10 +56,10 @@ public interface EdgeStyle extends Style, LabelStyle { * Style
    }' attribute. * * @param value - * the new value of the 'Line Style' attribute. + * the new value of the 'Line Style' attribute. + * @generated * @see org.eclipse.sirius.components.view.diagram.LineStyle * @see #getLineStyle() - * @generated */ void setLineStyle(LineStyle value); @@ -66,11 +69,11 @@ public interface EdgeStyle extends Style, LabelStyle { * {@link org.eclipse.sirius.components.view.diagram.ArrowStyle}. * * @return the value of the 'Source Arrow Style' attribute. + * @model default="None" required="true" + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @see #setSourceArrowStyle(ArrowStyle) * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_SourceArrowStyle() - * @model default="None" required="true" - * @generated */ ArrowStyle getSourceArrowStyle(); @@ -79,10 +82,10 @@ public interface EdgeStyle extends Style, LabelStyle { * Arrow Style}' attribute. * * @param value - * the new value of the 'Source Arrow Style' attribute. + * the new value of the 'Source Arrow Style' attribute. + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @see #getSourceArrowStyle() - * @generated */ void setSourceArrowStyle(ArrowStyle value); @@ -92,11 +95,11 @@ public interface EdgeStyle extends Style, LabelStyle { * {@link org.eclipse.sirius.components.view.diagram.ArrowStyle}. * * @return the value of the 'Target Arrow Style' attribute. + * @model default="InputArrow" required="true" + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @see #setTargetArrowStyle(ArrowStyle) * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_TargetArrowStyle() - * @model default="InputArrow" required="true" - * @generated */ ArrowStyle getTargetArrowStyle(); @@ -105,10 +108,10 @@ public interface EdgeStyle extends Style, LabelStyle { * Arrow Style}' attribute. * * @param value - * the new value of the 'Target Arrow Style' attribute. + * the new value of the 'Target Arrow Style' attribute. + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @see #getTargetArrowStyle() - * @generated */ void setTargetArrowStyle(ArrowStyle value); @@ -117,10 +120,10 @@ public interface EdgeStyle extends Style, LabelStyle { * begin-user-doc --> * * @return the value of the 'Edge Width' attribute. - * @see #setEdgeWidth(int) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_EdgeWidth() * @model default="1" dataType="org.eclipse.sirius.components.view.Length" required="true" * @generated + * @see #setEdgeWidth(int) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_EdgeWidth() */ int getEdgeWidth(); @@ -129,9 +132,9 @@ public interface EdgeStyle extends Style, LabelStyle { * Width}' attribute. * * @param value - * the new value of the 'Edge Width' attribute. - * @see #getEdgeWidth() + * the new value of the 'Edge Width' attribute. * @generated + * @see #getEdgeWidth() */ void setEdgeWidth(int value); @@ -140,10 +143,10 @@ public interface EdgeStyle extends Style, LabelStyle { * begin-user-doc --> * * @return the value of the 'Show Icon' attribute. - * @see #setShowIcon(boolean) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_ShowIcon() * @model default="false" * @generated + * @see #setShowIcon(boolean) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_ShowIcon() */ boolean isShowIcon(); @@ -152,9 +155,9 @@ public interface EdgeStyle extends Style, LabelStyle { * Icon}' attribute. * * @param value - * the new value of the 'Show Icon' attribute. - * @see #isShowIcon() + * the new value of the 'Show Icon' attribute. * @generated + * @see #isShowIcon() */ void setShowIcon(boolean value); @@ -162,10 +165,10 @@ public interface EdgeStyle extends Style, LabelStyle { * Returns the value of the 'Label Icon' attribute. * * @return the value of the 'Label Icon' attribute. - * @see #setLabelIcon(String) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_LabelIcon() * @model * @generated + * @see #setLabelIcon(String) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_LabelIcon() */ String getLabelIcon(); @@ -174,10 +177,32 @@ public interface EdgeStyle extends Style, LabelStyle { * Icon}' attribute. * * @param value - * the new value of the 'Label Icon' attribute. - * @see #getLabelIcon() + * the new value of the 'Label Icon' attribute. * @generated + * @see #getLabelIcon() */ void setLabelIcon(String value); + /** + * Returns the value of the 'Background' reference. + * + * @return the value of the 'Background' reference. + * @model + * @generated + * @see #setBackground(UserColor) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getEdgeStyle_Background() + */ + UserColor getBackground(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.diagram.EdgeStyle#getBackground + * Background}' reference. + * + * @param value + * the new value of the 'Background' reference. + * @generated + * @see #getBackground() + */ + void setBackground(UserColor value); + } // EdgeStyle diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/LabelOverflowStrategy.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/LabelOverflowStrategy.java index 6a96505c05..f959ca0fa4 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/LabelOverflowStrategy.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/LabelOverflowStrategy.java @@ -99,18 +99,21 @@ public enum LabelOverflowStrategy implements Enumerator { * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + /** * * * @generated */ private final int value; + /** * * * @generated */ private final String name; + /** * * diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/NodeLabelStyle.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/NodeLabelStyle.java index 9ee280b8fc..4b2e7564d9 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/NodeLabelStyle.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/NodeLabelStyle.java @@ -30,16 +30,16 @@ * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getNodeLabelStyle() */ -public interface NodeLabelStyle extends LabelStyle { +public interface NodeLabelStyle extends LabelStyle, BorderStyle { /** * Returns the value of the 'Label Color' reference. * * @return the value of the 'Label Color' reference. - * @see #setLabelColor(UserColor) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getNodeLabelStyle_LabelColor() * @model required="true" * @generated + * @see #setLabelColor(UserColor) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getNodeLabelStyle_LabelColor() */ UserColor getLabelColor(); @@ -48,9 +48,9 @@ public interface NodeLabelStyle extends LabelStyle { * Color}' reference. * * @param value - * the new value of the 'Label Color' reference. - * @see #getLabelColor() + * the new value of the 'Label Color' reference. * @generated + * @see #getLabelColor() */ void setLabelColor(UserColor value); @@ -71,9 +71,9 @@ public interface NodeLabelStyle extends LabelStyle { * Icon}' attribute. * * @param value - * the new value of the 'Show Icon' attribute. - * @see #isShowIcon() + * the new value of the 'Show Icon' attribute. * @generated + * @see #isShowIcon() */ void setShowIcon(boolean value); @@ -81,10 +81,10 @@ public interface NodeLabelStyle extends LabelStyle { * Returns the value of the 'Label Icon' attribute. * * @return the value of the 'Label Icon' attribute. - * @see #setLabelIcon(String) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getNodeLabelStyle_LabelIcon() * @model * @generated + * @see #setLabelIcon(String) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getNodeLabelStyle_LabelIcon() */ String getLabelIcon(); @@ -93,10 +93,32 @@ public interface NodeLabelStyle extends LabelStyle { * Icon}' attribute. * * @param value - * the new value of the 'Label Icon' attribute. - * @see #getLabelIcon() + * the new value of the 'Label Icon' attribute. * @generated + * @see #getLabelIcon() */ void setLabelIcon(String value); + /** + * Returns the value of the 'Background' reference. + * + * @return the value of the 'Background' reference. + * @model + * @generated + * @see #setBackground(UserColor) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getNodeLabelStyle_Background() + */ + UserColor getBackground(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.diagram.NodeLabelStyle#getBackground + * Background}' reference. + * + * @param value + * the new value of the 'Background' reference. + * @generated + * @see #getBackground() + */ + void setBackground(UserColor value); + } // NodeLabelStyle diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/adapters/DiagramColorAdapter.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/adapters/DiagramColorAdapter.java index b840d01d23..88be73d0df 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/adapters/DiagramColorAdapter.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/adapters/DiagramColorAdapter.java @@ -21,8 +21,12 @@ import org.eclipse.sirius.components.view.diagram.EdgeDescription; import org.eclipse.sirius.components.view.diagram.EdgeStyle; import org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription; +import org.eclipse.sirius.components.view.diagram.InsideLabelDescription; +import org.eclipse.sirius.components.view.diagram.InsideLabelStyle; import org.eclipse.sirius.components.view.diagram.NodeDescription; import org.eclipse.sirius.components.view.diagram.NodeStyleDescription; +import org.eclipse.sirius.components.view.diagram.OutsideLabelDescription; +import org.eclipse.sirius.components.view.diagram.OutsideLabelStyle; import org.eclipse.sirius.components.view.diagram.RectangularNodeStyleDescription; import org.eclipse.sirius.components.view.util.services.ColorPaletteService; @@ -33,6 +37,10 @@ */ public class DiagramColorAdapter extends EContentAdapter { + public static final String BLACK_COLOR_NAME = "black"; + + public static final String TRANSPARENT_COLOR_NAME = "transparent"; + private final ColorPaletteService colorPaletteService; public DiagramColorAdapter(View colorPalettesView) { @@ -60,12 +68,64 @@ public void notifyChanged(Notification notification) { && DiagramPackage.DIAGRAM_DESCRIPTION__EDGE_DESCRIPTIONS == notification.getFeatureID(DiagramDescription.class)) { EdgeStyle style = edgeDescription.getStyle(); if (style.getColor() == null) { - style.setColor(this.colorPaletteService.getColorFromPalette(edgeDescription, "black")); + style.setColor(this.colorPaletteService.getColorFromPalette(edgeDescription, BLACK_COLOR_NAME)); + } + if (style.getBorderColor() == null) { + style.setBackground(this.colorPaletteService.getColorFromPalette(edgeDescription, TRANSPARENT_COLOR_NAME)); + } + if (style.getBorderColor() == null) { + style.setBorderColor(this.colorPaletteService.getColorFromPalette(edgeDescription, BLACK_COLOR_NAME)); + style.setBorderSize(0); } } else if (Notification.ADD == notification.getEventType() && notification.getNotifier() instanceof EdgeDescription condition && notification.getNewValue() instanceof EdgeStyle style && DiagramPackage.EDGE_DESCRIPTION__CONDITIONAL_STYLES == notification.getFeatureID(EdgeDescription.class)) { if (style.getColor() == null) { - style.setColor(this.colorPaletteService.getColorFromPalette(condition, "black")); + style.setColor(this.colorPaletteService.getColorFromPalette(condition, BLACK_COLOR_NAME)); + } + if (style.getBackground() == null) { + style.setBackground(this.colorPaletteService.getColorFromPalette(condition, TRANSPARENT_COLOR_NAME)); + } + if (style.getBorderColor() == null) { + style.setBorderColor(this.colorPaletteService.getColorFromPalette(condition, BLACK_COLOR_NAME)); + style.setBorderSize(0); + } + } else if (Notification.SET == notification.getEventType() && notification.getNotifier() instanceof OutsideLabelDescription description + && notification.getNewValue() instanceof OutsideLabelStyle outsideLabelStyle && DiagramPackage.OUTSIDE_LABEL_DESCRIPTION__STYLE == notification.getFeatureID(OutsideLabelDescription.class)) { + if (outsideLabelStyle.getBackground() == null) { + outsideLabelStyle.setBackground(this.colorPaletteService.getColorFromPalette(description, TRANSPARENT_COLOR_NAME)); + } + if (outsideLabelStyle.getBorderColor() == null) { + outsideLabelStyle.setBorderColor(this.colorPaletteService.getColorFromPalette(description, BLACK_COLOR_NAME)); + outsideLabelStyle.setBorderSize(0); + } + } else if (Notification.SET == notification.getEventType() && notification.getNotifier() instanceof InsideLabelDescription description + && notification.getNewValue() instanceof InsideLabelStyle insideLabelStyle && DiagramPackage.OUTSIDE_LABEL_DESCRIPTION__STYLE == notification.getFeatureID(InsideLabelDescription.class)) { + if (insideLabelStyle.getBackground() == null) { + insideLabelStyle.setBackground(this.colorPaletteService.getColorFromPalette(description, TRANSPARENT_COLOR_NAME)); + } + if (insideLabelStyle.getBorderColor() == null) { + insideLabelStyle.setBorderColor(this.colorPaletteService.getColorFromPalette(description, BLACK_COLOR_NAME)); + insideLabelStyle.setBorderSize(0); + } + } else if (Notification.ADD == notification.getEventType() && notification.getNotifier() instanceof NodeDescription description + && notification.getNewValue() instanceof OutsideLabelDescription outsideLabelDescription && DiagramPackage.NODE_DESCRIPTION__OUTSIDE_LABELS == notification.getFeatureID(NodeDescription.class)) { + OutsideLabelStyle style = outsideLabelDescription.getStyle(); + if (style.getBackground() == null) { + style.setBackground(this.colorPaletteService.getColorFromPalette(description, TRANSPARENT_COLOR_NAME)); + } + if (style.getBorderColor() == null) { + style.setBorderColor(this.colorPaletteService.getColorFromPalette(description, BLACK_COLOR_NAME)); + style.setBorderSize(0); + } + } else if (Notification.SET == notification.getEventType() && notification.getNotifier() instanceof NodeDescription description + && notification.getNewValue() instanceof InsideLabelDescription insideLabelDescription && DiagramPackage.NODE_DESCRIPTION__INSIDE_LABEL == notification.getFeatureID(NodeDescription.class)) { + InsideLabelStyle style = insideLabelDescription.getStyle(); + if (style.getBackground() == null) { + style.setBackground(this.colorPaletteService.getColorFromPalette(description, TRANSPARENT_COLOR_NAME)); + } + if (style.getBorderColor() == null) { + style.setBorderColor(this.colorPaletteService.getColorFromPalette(description, BLACK_COLOR_NAME)); + style.setBorderSize(0); } } } @@ -78,7 +138,7 @@ private void setNodeColors(NodeStyleDescription style, Object object) { iconLabelNodeStyleDescription.setBackground(this.colorPaletteService.getColorFromPalette(object, "white")); } if (style != null && style.getBorderColor() == null) { - style.setBorderColor(this.colorPaletteService.getColorFromPalette(object, "black")); + style.setBorderColor(this.colorPaletteService.getColorFromPalette(object, BLACK_COLOR_NAME)); } } } diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalEdgeStyleImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalEdgeStyleImpl.java index 0c443c728f..d21829c6a7 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalEdgeStyleImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalEdgeStyleImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -12,6 +12,8 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.diagram.impl; +import java.util.Objects; + import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; @@ -20,6 +22,7 @@ import org.eclipse.sirius.components.view.UserColor; import org.eclipse.sirius.components.view.ViewPackage; import org.eclipse.sirius.components.view.diagram.ArrowStyle; +import org.eclipse.sirius.components.view.diagram.BorderStyle; import org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.EdgeStyle; @@ -43,6 +46,14 @@ * Underline} *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#isStrikeThrough Strike * Through}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getBorderColor Border + * Color}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getBorderRadius Border + * Radius}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getBorderSize Border + * Size}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getBorderLineStyle Border + * Line Style}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getLineStyle Line * Style}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getSourceArrowStyle Source @@ -55,240 +66,294 @@ * Icon}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getLabelIcon Label * Icon}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl#getBackground + * Background}
  • * * * @generated */ public class ConditionalEdgeStyleImpl extends ConditionalImpl implements ConditionalEdgeStyle { + /** - * The cached value of the '{@link #getColor() Color}' reference. + * The default value of the '{@link #getFontSize() Font Size}' attribute. * - * @see #getColor() * @generated * @ordered + * @see #getFontSize() */ - protected UserColor color; - + protected static final int FONT_SIZE_EDEFAULT = 14; /** - * The default value of the '{@link #getFontSize() Font Size}' attribute. * - * @see #getFontSize() * @generated * @ordered + * @see #isItalic() */ - protected static final int FONT_SIZE_EDEFAULT = 14; - + protected static final boolean ITALIC_EDEFAULT = false; /** - * The cached value of the '{@link #getFontSize() Font Size}' attribute. + * + * @generated + * @ordered + * @see #isBold() + */ + protected static final boolean BOLD_EDEFAULT = false; + /** + * The default value of the '{@link #isUnderline() Underline}' attribute. * - * @see #getFontSize() * @generated * @ordered + * @see #isUnderline() */ - protected int fontSize = FONT_SIZE_EDEFAULT; - + protected static final boolean UNDERLINE_EDEFAULT = false; /** - * The default value of the '{@link #isItalic() Italic}' attribute. + * + * + * @generated + * @ordered + * @see #isStrikeThrough() + */ + protected static final boolean STRIKE_THROUGH_EDEFAULT = false; + /** + * The default value of the '{@link #getBorderRadius() Border Radius}' attribute. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected static final int BORDER_RADIUS_EDEFAULT = 3; + /** + * The default value of the '{@link #getBorderSize() Border Size}' attribute. * - * @see #isItalic() * @generated * @ordered + * @see #getBorderSize() */ - protected static final boolean ITALIC_EDEFAULT = false; - + protected static final int BORDER_SIZE_EDEFAULT = 1; /** - * The cached value of the '{@link #isItalic() Italic}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected static final LineStyle BORDER_LINE_STYLE_EDEFAULT = LineStyle.SOLID; + /** + * The default value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #isItalic() * @generated * @ordered + * @see #getLineStyle() */ - protected boolean italic = ITALIC_EDEFAULT; - + protected static final LineStyle LINE_STYLE_EDEFAULT = LineStyle.SOLID; /** - * The default value of the '{@link #isBold() Bold}' attribute. + * The default value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. * - * @see #isBold() * @generated * @ordered + * @see #getSourceArrowStyle() */ - protected static final boolean BOLD_EDEFAULT = false; - + protected static final ArrowStyle SOURCE_ARROW_STYLE_EDEFAULT = ArrowStyle.NONE; /** - * The cached value of the '{@link #isBold() Bold}' attribute. + * The default value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. * - * @see #isBold() * @generated * @ordered + * @see #getTargetArrowStyle() */ - protected boolean bold = BOLD_EDEFAULT; - + protected static final ArrowStyle TARGET_ARROW_STYLE_EDEFAULT = ArrowStyle.INPUT_ARROW; /** - * The default value of the '{@link #isUnderline() Underline}' attribute. * - * @see #isUnderline() * @generated * @ordered + * @see #getEdgeWidth() */ - protected static final boolean UNDERLINE_EDEFAULT = false; - + protected static final int EDGE_WIDTH_EDEFAULT = 1; /** - * The cached value of the '{@link #isUnderline() Underline}' attribute. * - * @see #isUnderline() * @generated * @ordered + * @see #isShowIcon() */ - protected boolean underline = UNDERLINE_EDEFAULT; - + protected static final boolean SHOW_ICON_EDEFAULT = false; /** - * The default value of the '{@link #isStrikeThrough() Strike Through}' attribute. - * + * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #isStrikeThrough() * @generated * @ordered + * @see #getLabelIcon() */ - protected static final boolean STRIKE_THROUGH_EDEFAULT = false; - + protected static final String LABEL_ICON_EDEFAULT = null; /** - * The cached value of the '{@link #isStrikeThrough() Strike Through}' attribute. - * + * The cached value of the '{@link #getColor() Color}' reference. * - * @see #isStrikeThrough() * @generated * @ordered + * @see #getColor() */ - protected boolean strikeThrough = STRIKE_THROUGH_EDEFAULT; - + protected UserColor color; /** - * The default value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #getLineStyle() * @generated * @ordered + * @see #getFontSize() */ - protected static final LineStyle LINE_STYLE_EDEFAULT = LineStyle.SOLID; - + protected int fontSize = FONT_SIZE_EDEFAULT; /** - * The cached value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #getLineStyle() * @generated * @ordered + * @see #isItalic() */ - protected LineStyle lineStyle = LINE_STYLE_EDEFAULT; - + protected boolean italic = ITALIC_EDEFAULT; /** - * The default value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. + * The cached value of the '{@link #isBold() Bold}' attribute. * - * @see #getSourceArrowStyle() * @generated * @ordered + * @see #isBold() */ - protected static final ArrowStyle SOURCE_ARROW_STYLE_EDEFAULT = ArrowStyle.NONE; - + protected boolean bold = BOLD_EDEFAULT; /** - * The cached value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. + * The cached value of the '{@link #isUnderline() Underline}' attribute. * - * @see #getSourceArrowStyle() * @generated * @ordered + * @see #isUnderline() */ - protected ArrowStyle sourceArrowStyle = SOURCE_ARROW_STYLE_EDEFAULT; - + protected boolean underline = UNDERLINE_EDEFAULT; /** - * The default value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. + * The cached value of the '{@link #isStrikeThrough() Strike Through}' attribute. + * * - * @see #getTargetArrowStyle() * @generated * @ordered + * @see #isStrikeThrough() */ - protected static final ArrowStyle TARGET_ARROW_STYLE_EDEFAULT = ArrowStyle.INPUT_ARROW; - + protected boolean strikeThrough = STRIKE_THROUGH_EDEFAULT; /** - * The cached value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. + * The cached value of the '{@link #getBorderColor() Border Color}' reference. * - * @see #getTargetArrowStyle() * @generated * @ordered + * @see #getBorderColor() */ - protected ArrowStyle targetArrowStyle = TARGET_ARROW_STYLE_EDEFAULT; - + protected UserColor borderColor; /** - * The default value of the '{@link #getEdgeWidth() Edge Width}' attribute. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected int borderRadius = BORDER_RADIUS_EDEFAULT; + /** + * The cached value of the '{@link #getBorderSize() Border Size}' attribute. * - * @see #getEdgeWidth() * @generated * @ordered + * @see #getBorderSize() */ - protected static final int EDGE_WIDTH_EDEFAULT = 1; - + protected int borderSize = BORDER_SIZE_EDEFAULT; /** - * The cached value of the '{@link #getEdgeWidth() Edge Width}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected LineStyle borderLineStyle = BORDER_LINE_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #getEdgeWidth() * @generated * @ordered + * @see #getLineStyle() + */ + protected LineStyle lineStyle = LINE_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. + * + * @generated + * @ordered + * @see #getSourceArrowStyle() */ - protected int edgeWidth = EDGE_WIDTH_EDEFAULT; - + protected ArrowStyle sourceArrowStyle = SOURCE_ARROW_STYLE_EDEFAULT; /** - * The default value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @generated + * @ordered + * @see #getTargetArrowStyle() + */ + protected ArrowStyle targetArrowStyle = TARGET_ARROW_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getEdgeWidth() Edge Width}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #getEdgeWidth() */ - protected static final boolean SHOW_ICON_EDEFAULT = false; - + protected int edgeWidth = EDGE_WIDTH_EDEFAULT; /** * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #isShowIcon() */ protected boolean showIcon = SHOW_ICON_EDEFAULT; - /** - * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getLabelIcon() */ - protected static final String LABEL_ICON_EDEFAULT = null; + protected String labelIcon = LABEL_ICON_EDEFAULT; /** - * The cached value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getBackground() */ - protected String labelIcon = LABEL_ICON_EDEFAULT; + protected UserColor background; /** * @@ -332,8 +397,12 @@ public UserColor getColor() { * * @generated */ - public UserColor basicGetColor() { - return this.color; + @Override + public void setColor(UserColor newColor) { + UserColor oldColor = this.color; + this.color = newColor; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__COLOR, oldColor, this.color)); } /** @@ -341,12 +410,8 @@ public UserColor basicGetColor() { * * @generated */ - @Override - public void setColor(UserColor newColor) { - UserColor oldColor = this.color; - this.color = newColor; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__COLOR, oldColor, this.color)); + public UserColor basicGetColor() { + return this.color; } /** @@ -464,6 +529,115 @@ public void setStrikeThrough(boolean newStrikeThrough) { this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH, oldStrikeThrough, this.strikeThrough)); } + /** + * + * + * @generated + */ + @Override + public UserColor getBorderColor() { + if (this.borderColor != null && this.borderColor.eIsProxy()) { + InternalEObject oldBorderColor = (InternalEObject) this.borderColor; + this.borderColor = (UserColor) this.eResolveProxy(oldBorderColor); + if (this.borderColor != oldBorderColor) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + } + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderColor(UserColor newBorderColor) { + UserColor oldBorderColor = this.borderColor; + this.borderColor = newBorderColor; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBorderColor() { + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public int getBorderRadius() { + return this.borderRadius; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderRadius(int newBorderRadius) { + int oldBorderRadius = this.borderRadius; + this.borderRadius = newBorderRadius; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS, oldBorderRadius, this.borderRadius)); + } + + /** + * + * + * @generated + */ + @Override + public int getBorderSize() { + return this.borderSize; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderSize(int newBorderSize) { + int oldBorderSize = this.borderSize; + this.borderSize = newBorderSize; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE, oldBorderSize, this.borderSize)); + } + + /** + * + * + * @generated + */ + @Override + public LineStyle getBorderLineStyle() { + return this.borderLineStyle; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderLineStyle(LineStyle newBorderLineStyle) { + LineStyle oldBorderLineStyle = this.borderLineStyle; + this.borderLineStyle = newBorderLineStyle == null ? BORDER_LINE_STYLE_EDEFAULT : newBorderLineStyle; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE, oldBorderLineStyle, this.borderLineStyle)); + } + /** * * @@ -602,6 +776,46 @@ public void setLabelIcon(String newLabelIcon) { this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON, oldLabelIcon, this.labelIcon)); } + /** + * + * + * @generated + */ + @Override + public UserColor getBackground() { + if (this.background != null && this.background.eIsProxy()) { + InternalEObject oldBackground = (InternalEObject) this.background; + this.background = (UserColor) this.eResolveProxy(oldBackground); + if (this.background != oldBackground) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND, oldBackground, this.background)); + } + } + return this.background; + } + + /** + * + * + * @generated + */ + @Override + public void setBackground(UserColor newBackground) { + UserColor oldBackground = this.background; + this.background = newBackground; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND, oldBackground, this.background)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBackground() { + return this.background; + } + /** * * @@ -624,6 +838,16 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.isUnderline(); case DiagramPackage.CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH: return this.isStrikeThrough(); + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR: + if (resolve) + return this.getBorderColor(); + return this.basicGetBorderColor(); + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS: + return this.getBorderRadius(); + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE: + return this.getBorderSize(); + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE: + return this.getBorderLineStyle(); case DiagramPackage.CONDITIONAL_EDGE_STYLE__LINE_STYLE: return this.getLineStyle(); case DiagramPackage.CONDITIONAL_EDGE_STYLE__SOURCE_ARROW_STYLE: @@ -636,6 +860,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.isShowIcon(); case DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON: return this.getLabelIcon(); + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND: + if (resolve) + return this.getBackground(); + return this.basicGetBackground(); } return super.eGet(featureID, resolve, coreType); } @@ -666,6 +894,18 @@ public void eSet(int featureID, Object newValue) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH: this.setStrikeThrough((Boolean) newValue); return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR: + this.setBorderColor((UserColor) newValue); + return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS: + this.setBorderRadius((Integer) newValue); + return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE: + this.setBorderSize((Integer) newValue); + return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle((LineStyle) newValue); + return; case DiagramPackage.CONDITIONAL_EDGE_STYLE__LINE_STYLE: this.setLineStyle((LineStyle) newValue); return; @@ -684,6 +924,9 @@ public void eSet(int featureID, Object newValue) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON: this.setLabelIcon((String) newValue); return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND: + this.setBackground((UserColor) newValue); + return; } super.eSet(featureID, newValue); } @@ -697,7 +940,7 @@ public void eSet(int featureID, Object newValue) { public void eUnset(int featureID) { switch (featureID) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__COLOR: - this.setColor((UserColor) null); + this.setColor(null); return; case DiagramPackage.CONDITIONAL_EDGE_STYLE__FONT_SIZE: this.setFontSize(FONT_SIZE_EDEFAULT); @@ -714,6 +957,18 @@ public void eUnset(int featureID) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH: this.setStrikeThrough(STRIKE_THROUGH_EDEFAULT); return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR: + this.setBorderColor(null); + return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS: + this.setBorderRadius(BORDER_RADIUS_EDEFAULT); + return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE: + this.setBorderSize(BORDER_SIZE_EDEFAULT); + return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle(BORDER_LINE_STYLE_EDEFAULT); + return; case DiagramPackage.CONDITIONAL_EDGE_STYLE__LINE_STYLE: this.setLineStyle(LINE_STYLE_EDEFAULT); return; @@ -732,6 +987,9 @@ public void eUnset(int featureID) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON: this.setLabelIcon(LABEL_ICON_EDEFAULT); return; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND: + this.setBackground(null); + return; } super.eUnset(featureID); } @@ -756,6 +1014,14 @@ public boolean eIsSet(int featureID) { return this.underline != UNDERLINE_EDEFAULT; case DiagramPackage.CONDITIONAL_EDGE_STYLE__STRIKE_THROUGH: return this.strikeThrough != STRIKE_THROUGH_EDEFAULT; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR: + return this.borderColor != null; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS: + return this.borderRadius != BORDER_RADIUS_EDEFAULT; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE: + return this.borderSize != BORDER_SIZE_EDEFAULT; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE: + return this.borderLineStyle != BORDER_LINE_STYLE_EDEFAULT; case DiagramPackage.CONDITIONAL_EDGE_STYLE__LINE_STYLE: return this.lineStyle != LINE_STYLE_EDEFAULT; case DiagramPackage.CONDITIONAL_EDGE_STYLE__SOURCE_ARROW_STYLE: @@ -767,7 +1033,9 @@ public boolean eIsSet(int featureID) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__SHOW_ICON: return this.showIcon != SHOW_ICON_EDEFAULT; case DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON: - return LABEL_ICON_EDEFAULT == null ? this.labelIcon != null : !LABEL_ICON_EDEFAULT.equals(this.labelIcon); + return !Objects.equals(LABEL_ICON_EDEFAULT, this.labelIcon); + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND: + return this.background != null; } return super.eIsSet(featureID); } @@ -803,6 +1071,20 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == BorderStyle.class) { + switch (derivedFeatureID) { + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR: + return DiagramPackage.BORDER_STYLE__BORDER_COLOR; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS: + return DiagramPackage.BORDER_STYLE__BORDER_RADIUS; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE: + return DiagramPackage.BORDER_STYLE__BORDER_SIZE; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } if (baseClass == EdgeStyle.class) { switch (derivedFeatureID) { case DiagramPackage.CONDITIONAL_EDGE_STYLE__LINE_STYLE: @@ -817,6 +1099,8 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return DiagramPackage.EDGE_STYLE__SHOW_ICON; case DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON: return DiagramPackage.EDGE_STYLE__LABEL_ICON; + case DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND: + return DiagramPackage.EDGE_STYLE__BACKGROUND; default: return -1; } @@ -855,6 +1139,20 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == BorderStyle.class) { + switch (baseFeatureID) { + case DiagramPackage.BORDER_STYLE__BORDER_COLOR: + return DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_COLOR; + case DiagramPackage.BORDER_STYLE__BORDER_RADIUS: + return DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_RADIUS; + case DiagramPackage.BORDER_STYLE__BORDER_SIZE: + return DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_SIZE; + case DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.CONDITIONAL_EDGE_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } if (baseClass == EdgeStyle.class) { switch (baseFeatureID) { case DiagramPackage.EDGE_STYLE__LINE_STYLE: @@ -869,6 +1167,8 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return DiagramPackage.CONDITIONAL_EDGE_STYLE__SHOW_ICON; case DiagramPackage.EDGE_STYLE__LABEL_ICON: return DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON; + case DiagramPackage.EDGE_STYLE__BACKGROUND: + return DiagramPackage.CONDITIONAL_EDGE_STYLE__BACKGROUND; default: return -1; } @@ -886,31 +1186,36 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (fontSize: "); - result.append(this.fontSize); - result.append(", italic: "); - result.append(this.italic); - result.append(", bold: "); - result.append(this.bold); - result.append(", underline: "); - result.append(this.underline); - result.append(", strikeThrough: "); - result.append(this.strikeThrough); - result.append(", lineStyle: "); - result.append(this.lineStyle); - result.append(", sourceArrowStyle: "); - result.append(this.sourceArrowStyle); - result.append(", targetArrowStyle: "); - result.append(this.targetArrowStyle); - result.append(", edgeWidth: "); - result.append(this.edgeWidth); - result.append(", showIcon: "); - result.append(this.showIcon); - result.append(", labelIcon: "); - result.append(this.labelIcon); - result.append(')'); - return result.toString(); + String result = super.toString() + " (fontSize: " + + this.fontSize + + ", italic: " + + this.italic + + ", bold: " + + this.bold + + ", underline: " + + this.underline + + ", strikeThrough: " + + this.strikeThrough + + ", borderRadius: " + + this.borderRadius + + ", borderSize: " + + this.borderSize + + ", borderLineStyle: " + + this.borderLineStyle + + ", lineStyle: " + + this.lineStyle + + ", sourceArrowStyle: " + + this.sourceArrowStyle + + ", targetArrowStyle: " + + this.targetArrowStyle + + ", edgeWidth: " + + this.edgeWidth + + ", showIcon: " + + this.showIcon + + ", labelIcon: " + + this.labelIcon + + ')'; + return result; } } // ConditionalEdgeStyleImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramPackageImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramPackageImpl.java index 0391cad7a7..9d20d776b8 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramPackageImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramPackageImpl.java @@ -1296,7 +1296,7 @@ public EReference getNodeLabelStyle_LabelColor() { */ @Override public EAttribute getNodeLabelStyle_ShowIcon() { - return (EAttribute) this.nodeLabelStyleEClass.getEStructuralFeatures().get(1); + return (EAttribute) this.nodeLabelStyleEClass.getEStructuralFeatures().get(2); } /** @@ -1306,7 +1306,17 @@ public EAttribute getNodeLabelStyle_ShowIcon() { */ @Override public EAttribute getNodeLabelStyle_LabelIcon() { - return (EAttribute) this.nodeLabelStyleEClass.getEStructuralFeatures().get(2); + return (EAttribute) this.nodeLabelStyleEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getNodeLabelStyle_Background() { + return (EReference) this.nodeLabelStyleEClass.getEStructuralFeatures().get(1); } /** @@ -1519,6 +1529,16 @@ public EAttribute getEdgeStyle_LabelIcon() { return (EAttribute) this.edgeStyleEClass.getEStructuralFeatures().get(5); } + /** + * + * + * @generated + */ + @Override + public EReference getEdgeStyle_Background() { + return (EReference) this.edgeStyleEClass.getEStructuralFeatures().get(6); + } + /** * * @@ -2330,6 +2350,7 @@ public void createPackageContents() { this.nodeLabelStyleEClass = this.createEClass(NODE_LABEL_STYLE); this.createEReference(this.nodeLabelStyleEClass, NODE_LABEL_STYLE__LABEL_COLOR); + this.createEReference(this.nodeLabelStyleEClass, NODE_LABEL_STYLE__BACKGROUND); this.createEAttribute(this.nodeLabelStyleEClass, NODE_LABEL_STYLE__SHOW_ICON); this.createEAttribute(this.nodeLabelStyleEClass, NODE_LABEL_STYLE__LABEL_ICON); @@ -2361,6 +2382,7 @@ public void createPackageContents() { this.createEAttribute(this.edgeStyleEClass, EDGE_STYLE__EDGE_WIDTH); this.createEAttribute(this.edgeStyleEClass, EDGE_STYLE__SHOW_ICON); this.createEAttribute(this.edgeStyleEClass, EDGE_STYLE__LABEL_ICON); + this.createEReference(this.edgeStyleEClass, EDGE_STYLE__BACKGROUND); this.conditionalEdgeStyleEClass = this.createEClass(CONDITIONAL_EDGE_STYLE); @@ -2490,6 +2512,7 @@ public void initializePackageContents() { this.insideLabelStyleEClass.getESuperTypes().add(this.getNodeLabelStyle()); this.outsideLabelStyleEClass.getESuperTypes().add(this.getNodeLabelStyle()); this.nodeLabelStyleEClass.getESuperTypes().add(theViewPackage.getLabelStyle()); + this.nodeLabelStyleEClass.getESuperTypes().add(this.getBorderStyle()); this.nodeStyleDescriptionEClass.getESuperTypes().add(this.getBorderStyle()); this.conditionalNodeStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); this.conditionalInsideLabelStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); @@ -2499,6 +2522,7 @@ public void initializePackageContents() { this.iconLabelNodeStyleDescriptionEClass.getESuperTypes().add(this.getNodeStyleDescription()); this.edgeStyleEClass.getESuperTypes().add(this.getStyle()); this.edgeStyleEClass.getESuperTypes().add(theViewPackage.getLabelStyle()); + this.edgeStyleEClass.getESuperTypes().add(this.getBorderStyle()); this.conditionalEdgeStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); this.conditionalEdgeStyleEClass.getESuperTypes().add(this.getEdgeStyle()); this.deleteToolEClass.getESuperTypes().add(this.getTool()); @@ -2667,6 +2691,8 @@ public void initializePackageContents() { this.initEClass(this.nodeLabelStyleEClass, NodeLabelStyle.class, "NodeLabelStyle", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEReference(this.getNodeLabelStyle_LabelColor(), theViewPackage.getUserColor(), null, "labelColor", null, 1, 1, NodeLabelStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEReference(this.getNodeLabelStyle_Background(), theViewPackage.getUserColor(), null, "background", null, 0, 1, NodeLabelStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getNodeLabelStyle_ShowIcon(), this.ecorePackage.getEBoolean(), "showIcon", "false", 0, 1, NodeLabelStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getNodeLabelStyle_LabelIcon(), this.ecorePackage.getEString(), "labelIcon", null, 0, 1, NodeLabelStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, @@ -2713,6 +2739,8 @@ public void initializePackageContents() { !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getEdgeStyle_LabelIcon(), this.ecorePackage.getEString(), "labelIcon", null, 0, 1, EdgeStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEReference(this.getEdgeStyle_Background(), theViewPackage.getUserColor(), null, "background", null, 0, 1, EdgeStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.conditionalEdgeStyleEClass, ConditionalEdgeStyle.class, "ConditionalEdgeStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/EdgeStyleImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/EdgeStyleImpl.java index 1511227c01..586cb6d80d 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/EdgeStyleImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/EdgeStyleImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 Obeo. + * Copyright (c) 2023, 2024 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 @@ -12,12 +12,17 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.diagram.impl; +import java.util.Objects; + import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.sirius.components.view.LabelStyle; +import org.eclipse.sirius.components.view.UserColor; import org.eclipse.sirius.components.view.ViewPackage; import org.eclipse.sirius.components.view.diagram.ArrowStyle; +import org.eclipse.sirius.components.view.diagram.BorderStyle; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.EdgeStyle; import org.eclipse.sirius.components.view.diagram.LineStyle; @@ -34,6 +39,11 @@ *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#isUnderline Underline}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#isStrikeThrough Strike * Through}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getBorderColor Border Color}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getBorderRadius Border Radius}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getBorderSize Border Size}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getBorderLineStyle Border Line + * Style}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getLineStyle Line Style}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getSourceArrowStyle Source Arrow * Style}
  • @@ -42,230 +52,284 @@ *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getEdgeWidth Edge Width}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#isShowIcon Show Icon}
  • *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getLabelIcon Label Icon}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl#getBackground Background}
  • * * * @generated */ public class EdgeStyleImpl extends StyleImpl implements EdgeStyle { + /** * The default value of the '{@link #getFontSize() Font Size}' attribute. * - * @see #getFontSize() * @generated * @ordered + * @see #getFontSize() */ protected static final int FONT_SIZE_EDEFAULT = 14; - /** - * The cached value of the '{@link #getFontSize() Font Size}' attribute. * - * @see #getFontSize() * @generated * @ordered + * @see #isItalic() */ - protected int fontSize = FONT_SIZE_EDEFAULT; - + protected static final boolean ITALIC_EDEFAULT = false; /** - * The default value of the '{@link #isItalic() Italic}' attribute. + * The default value of the '{@link #isBold() Bold}' attribute. * - * @see #isItalic() * @generated * @ordered + * @see #isBold() */ - protected static final boolean ITALIC_EDEFAULT = false; - + protected static final boolean BOLD_EDEFAULT = false; /** - * The cached value of the '{@link #isItalic() Italic}' attribute. * - * @see #isItalic() * @generated * @ordered + * @see #isUnderline() */ - protected boolean italic = ITALIC_EDEFAULT; - + protected static final boolean UNDERLINE_EDEFAULT = false; /** - * The default value of the '{@link #isBold() Bold}' attribute. + * The default value of the '{@link #isStrikeThrough() Strike Through}' attribute. + * * - * @see #isBold() * @generated * @ordered + * @see #isStrikeThrough() */ - protected static final boolean BOLD_EDEFAULT = false; - + protected static final boolean STRIKE_THROUGH_EDEFAULT = false; /** - * The cached value of the '{@link #isBold() Bold}' attribute. + * The default value of the '{@link #getBorderRadius() Border Radius}' attribute. + * * - * @see #isBold() * @generated * @ordered + * @see #getBorderRadius() */ - protected boolean bold = BOLD_EDEFAULT; - + protected static final int BORDER_RADIUS_EDEFAULT = 3; /** - * The default value of the '{@link #isUnderline() Underline}' attribute. * - * @see #isUnderline() * @generated * @ordered + * @see #getBorderSize() */ - protected static final boolean UNDERLINE_EDEFAULT = false; - + protected static final int BORDER_SIZE_EDEFAULT = 1; /** - * The cached value of the '{@link #isUnderline() Underline}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected static final LineStyle BORDER_LINE_STYLE_EDEFAULT = LineStyle.SOLID; + /** + * The default value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #isUnderline() * @generated * @ordered + * @see #getLineStyle() */ - protected boolean underline = UNDERLINE_EDEFAULT; - + protected static final LineStyle LINE_STYLE_EDEFAULT = LineStyle.SOLID; /** - * The default value of the '{@link #isStrikeThrough() Strike Through}' attribute. - * + * The default value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. * - * @see #isStrikeThrough() * @generated * @ordered + * @see #getSourceArrowStyle() */ - protected static final boolean STRIKE_THROUGH_EDEFAULT = false; - + protected static final ArrowStyle SOURCE_ARROW_STYLE_EDEFAULT = ArrowStyle.NONE; /** - * The cached value of the '{@link #isStrikeThrough() Strike Through}' attribute. - * + * The default value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. * - * @see #isStrikeThrough() * @generated * @ordered + * @see #getTargetArrowStyle() */ - protected boolean strikeThrough = STRIKE_THROUGH_EDEFAULT; - + protected static final ArrowStyle TARGET_ARROW_STYLE_EDEFAULT = ArrowStyle.INPUT_ARROW; /** - * The default value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #getLineStyle() * @generated * @ordered + * @see #getEdgeWidth() */ - protected static final LineStyle LINE_STYLE_EDEFAULT = LineStyle.SOLID; - + protected static final int EDGE_WIDTH_EDEFAULT = 1; /** - * The cached value of the '{@link #getLineStyle() Line Style}' attribute. * - * @see #getLineStyle() * @generated * @ordered + * @see #isShowIcon() */ - protected LineStyle lineStyle = LINE_STYLE_EDEFAULT; - + protected static final boolean SHOW_ICON_EDEFAULT = false; /** - * The default value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. + * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getSourceArrowStyle() * @generated * @ordered + * @see #getLabelIcon() */ - protected static final ArrowStyle SOURCE_ARROW_STYLE_EDEFAULT = ArrowStyle.NONE; - + protected static final String LABEL_ICON_EDEFAULT = null; /** - * The cached value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. + * The cached value of the '{@link #getFontSize() Font Size}' attribute. * - * @see #getSourceArrowStyle() * @generated * @ordered + * @see #getFontSize() */ - protected ArrowStyle sourceArrowStyle = SOURCE_ARROW_STYLE_EDEFAULT; - + protected int fontSize = FONT_SIZE_EDEFAULT; /** - * The default value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. + * The cached value of the '{@link #isItalic() Italic}' attribute. * - * @see #getTargetArrowStyle() * @generated * @ordered + * @see #isItalic() */ - protected static final ArrowStyle TARGET_ARROW_STYLE_EDEFAULT = ArrowStyle.INPUT_ARROW; - + protected boolean italic = ITALIC_EDEFAULT; /** - * The cached value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. + * The cached value of the '{@link #isBold() Bold}' attribute. * - * @see #getTargetArrowStyle() * @generated * @ordered + * @see #isBold() */ - protected ArrowStyle targetArrowStyle = TARGET_ARROW_STYLE_EDEFAULT; - + protected boolean bold = BOLD_EDEFAULT; /** - * The default value of the '{@link #getEdgeWidth() Edge Width}' attribute. * - * @see #getEdgeWidth() * @generated * @ordered + * @see #isUnderline() */ - protected static final int EDGE_WIDTH_EDEFAULT = 1; - + protected boolean underline = UNDERLINE_EDEFAULT; /** - * The cached value of the '{@link #getEdgeWidth() Edge Width}' attribute. + * + * + * @generated + * @ordered + * @see #isStrikeThrough() + */ + protected boolean strikeThrough = STRIKE_THROUGH_EDEFAULT; + /** + * The cached value of the '{@link #getBorderColor() Border Color}' reference. * - * @see #getEdgeWidth() * @generated * @ordered + * @see #getBorderColor() */ - protected int edgeWidth = EDGE_WIDTH_EDEFAULT; - + protected UserColor borderColor; /** - * The default value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected int borderRadius = BORDER_RADIUS_EDEFAULT; + /** + * The cached value of the '{@link #getBorderSize() Border Size}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #getBorderSize() */ - protected static final boolean SHOW_ICON_EDEFAULT = false; - + protected int borderSize = BORDER_SIZE_EDEFAULT; + /** + * The cached value of the '{@link #getBorderLineStyle() Border Line Style}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected LineStyle borderLineStyle = BORDER_LINE_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getLineStyle() Line Style}' attribute. + * + * @generated + * @ordered + * @see #getLineStyle() + */ + protected LineStyle lineStyle = LINE_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getSourceArrowStyle() Source Arrow Style}' attribute. + * + * @generated + * @ordered + * @see #getSourceArrowStyle() + */ + protected ArrowStyle sourceArrowStyle = SOURCE_ARROW_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getTargetArrowStyle() Target Arrow Style}' attribute. + * + * @generated + * @ordered + * @see #getTargetArrowStyle() + */ + protected ArrowStyle targetArrowStyle = TARGET_ARROW_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getEdgeWidth() Edge Width}' attribute. + * + * @generated + * @ordered + * @see #getEdgeWidth() + */ + protected int edgeWidth = EDGE_WIDTH_EDEFAULT; /** * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #isShowIcon() */ protected boolean showIcon = SHOW_ICON_EDEFAULT; - /** - * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getLabelIcon() */ - protected static final String LABEL_ICON_EDEFAULT = null; + protected String labelIcon = LABEL_ICON_EDEFAULT; /** - * The cached value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getBackground() */ - protected String labelIcon = LABEL_ICON_EDEFAULT; + protected UserColor background; /** * @@ -401,6 +465,115 @@ public void setStrikeThrough(boolean newStrikeThrough) { this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__STRIKE_THROUGH, oldStrikeThrough, this.strikeThrough)); } + /** + * + * + * @generated + */ + @Override + public UserColor getBorderColor() { + if (this.borderColor != null && this.borderColor.eIsProxy()) { + InternalEObject oldBorderColor = (InternalEObject) this.borderColor; + this.borderColor = (UserColor) this.eResolveProxy(oldBorderColor); + if (this.borderColor != oldBorderColor) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.EDGE_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + } + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderColor(UserColor newBorderColor) { + UserColor oldBorderColor = this.borderColor; + this.borderColor = newBorderColor; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBorderColor() { + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public int getBorderRadius() { + return this.borderRadius; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderRadius(int newBorderRadius) { + int oldBorderRadius = this.borderRadius; + this.borderRadius = newBorderRadius; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__BORDER_RADIUS, oldBorderRadius, this.borderRadius)); + } + + /** + * + * + * @generated + */ + @Override + public int getBorderSize() { + return this.borderSize; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderSize(int newBorderSize) { + int oldBorderSize = this.borderSize; + this.borderSize = newBorderSize; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__BORDER_SIZE, oldBorderSize, this.borderSize)); + } + + /** + * + * + * @generated + */ + @Override + public LineStyle getBorderLineStyle() { + return this.borderLineStyle; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderLineStyle(LineStyle newBorderLineStyle) { + LineStyle oldBorderLineStyle = this.borderLineStyle; + this.borderLineStyle = newBorderLineStyle == null ? BORDER_LINE_STYLE_EDEFAULT : newBorderLineStyle; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE, oldBorderLineStyle, this.borderLineStyle)); + } + /** * * @@ -539,6 +712,46 @@ public void setLabelIcon(String newLabelIcon) { this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__LABEL_ICON, oldLabelIcon, this.labelIcon)); } + /** + * + * + * @generated + */ + @Override + public UserColor getBackground() { + if (this.background != null && this.background.eIsProxy()) { + InternalEObject oldBackground = (InternalEObject) this.background; + this.background = (UserColor) this.eResolveProxy(oldBackground); + if (this.background != oldBackground) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.EDGE_STYLE__BACKGROUND, oldBackground, this.background)); + } + } + return this.background; + } + + /** + * + * + * @generated + */ + @Override + public void setBackground(UserColor newBackground) { + UserColor oldBackground = this.background; + this.background = newBackground; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.EDGE_STYLE__BACKGROUND, oldBackground, this.background)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBackground() { + return this.background; + } + /** * * @@ -557,6 +770,16 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.isUnderline(); case DiagramPackage.EDGE_STYLE__STRIKE_THROUGH: return this.isStrikeThrough(); + case DiagramPackage.EDGE_STYLE__BORDER_COLOR: + if (resolve) + return this.getBorderColor(); + return this.basicGetBorderColor(); + case DiagramPackage.EDGE_STYLE__BORDER_RADIUS: + return this.getBorderRadius(); + case DiagramPackage.EDGE_STYLE__BORDER_SIZE: + return this.getBorderSize(); + case DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE: + return this.getBorderLineStyle(); case DiagramPackage.EDGE_STYLE__LINE_STYLE: return this.getLineStyle(); case DiagramPackage.EDGE_STYLE__SOURCE_ARROW_STYLE: @@ -569,6 +792,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.isShowIcon(); case DiagramPackage.EDGE_STYLE__LABEL_ICON: return this.getLabelIcon(); + case DiagramPackage.EDGE_STYLE__BACKGROUND: + if (resolve) + return this.getBackground(); + return this.basicGetBackground(); } return super.eGet(featureID, resolve, coreType); } @@ -596,6 +823,18 @@ public void eSet(int featureID, Object newValue) { case DiagramPackage.EDGE_STYLE__STRIKE_THROUGH: this.setStrikeThrough((Boolean) newValue); return; + case DiagramPackage.EDGE_STYLE__BORDER_COLOR: + this.setBorderColor((UserColor) newValue); + return; + case DiagramPackage.EDGE_STYLE__BORDER_RADIUS: + this.setBorderRadius((Integer) newValue); + return; + case DiagramPackage.EDGE_STYLE__BORDER_SIZE: + this.setBorderSize((Integer) newValue); + return; + case DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle((LineStyle) newValue); + return; case DiagramPackage.EDGE_STYLE__LINE_STYLE: this.setLineStyle((LineStyle) newValue); return; @@ -614,6 +853,9 @@ public void eSet(int featureID, Object newValue) { case DiagramPackage.EDGE_STYLE__LABEL_ICON: this.setLabelIcon((String) newValue); return; + case DiagramPackage.EDGE_STYLE__BACKGROUND: + this.setBackground((UserColor) newValue); + return; } super.eSet(featureID, newValue); } @@ -641,6 +883,18 @@ public void eUnset(int featureID) { case DiagramPackage.EDGE_STYLE__STRIKE_THROUGH: this.setStrikeThrough(STRIKE_THROUGH_EDEFAULT); return; + case DiagramPackage.EDGE_STYLE__BORDER_COLOR: + this.setBorderColor(null); + return; + case DiagramPackage.EDGE_STYLE__BORDER_RADIUS: + this.setBorderRadius(BORDER_RADIUS_EDEFAULT); + return; + case DiagramPackage.EDGE_STYLE__BORDER_SIZE: + this.setBorderSize(BORDER_SIZE_EDEFAULT); + return; + case DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle(BORDER_LINE_STYLE_EDEFAULT); + return; case DiagramPackage.EDGE_STYLE__LINE_STYLE: this.setLineStyle(LINE_STYLE_EDEFAULT); return; @@ -659,6 +913,9 @@ public void eUnset(int featureID) { case DiagramPackage.EDGE_STYLE__LABEL_ICON: this.setLabelIcon(LABEL_ICON_EDEFAULT); return; + case DiagramPackage.EDGE_STYLE__BACKGROUND: + this.setBackground(null); + return; } super.eUnset(featureID); } @@ -681,6 +938,14 @@ public boolean eIsSet(int featureID) { return this.underline != UNDERLINE_EDEFAULT; case DiagramPackage.EDGE_STYLE__STRIKE_THROUGH: return this.strikeThrough != STRIKE_THROUGH_EDEFAULT; + case DiagramPackage.EDGE_STYLE__BORDER_COLOR: + return this.borderColor != null; + case DiagramPackage.EDGE_STYLE__BORDER_RADIUS: + return this.borderRadius != BORDER_RADIUS_EDEFAULT; + case DiagramPackage.EDGE_STYLE__BORDER_SIZE: + return this.borderSize != BORDER_SIZE_EDEFAULT; + case DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE: + return this.borderLineStyle != BORDER_LINE_STYLE_EDEFAULT; case DiagramPackage.EDGE_STYLE__LINE_STYLE: return this.lineStyle != LINE_STYLE_EDEFAULT; case DiagramPackage.EDGE_STYLE__SOURCE_ARROW_STYLE: @@ -692,7 +957,9 @@ public boolean eIsSet(int featureID) { case DiagramPackage.EDGE_STYLE__SHOW_ICON: return this.showIcon != SHOW_ICON_EDEFAULT; case DiagramPackage.EDGE_STYLE__LABEL_ICON: - return LABEL_ICON_EDEFAULT == null ? this.labelIcon != null : !LABEL_ICON_EDEFAULT.equals(this.labelIcon); + return !Objects.equals(LABEL_ICON_EDEFAULT, this.labelIcon); + case DiagramPackage.EDGE_STYLE__BACKGROUND: + return this.background != null; } return super.eIsSet(featureID); } @@ -720,6 +987,20 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == BorderStyle.class) { + switch (derivedFeatureID) { + case DiagramPackage.EDGE_STYLE__BORDER_COLOR: + return DiagramPackage.BORDER_STYLE__BORDER_COLOR; + case DiagramPackage.EDGE_STYLE__BORDER_RADIUS: + return DiagramPackage.BORDER_STYLE__BORDER_RADIUS; + case DiagramPackage.EDGE_STYLE__BORDER_SIZE: + return DiagramPackage.BORDER_STYLE__BORDER_SIZE; + case DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } @@ -746,6 +1027,20 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == BorderStyle.class) { + switch (baseFeatureID) { + case DiagramPackage.BORDER_STYLE__BORDER_COLOR: + return DiagramPackage.EDGE_STYLE__BORDER_COLOR; + case DiagramPackage.BORDER_STYLE__BORDER_RADIUS: + return DiagramPackage.EDGE_STYLE__BORDER_RADIUS; + case DiagramPackage.BORDER_STYLE__BORDER_SIZE: + return DiagramPackage.EDGE_STYLE__BORDER_SIZE; + case DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.EDGE_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } @@ -759,31 +1054,36 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (fontSize: "); - result.append(this.fontSize); - result.append(", italic: "); - result.append(this.italic); - result.append(", bold: "); - result.append(this.bold); - result.append(", underline: "); - result.append(this.underline); - result.append(", strikeThrough: "); - result.append(this.strikeThrough); - result.append(", lineStyle: "); - result.append(this.lineStyle); - result.append(", sourceArrowStyle: "); - result.append(this.sourceArrowStyle); - result.append(", targetArrowStyle: "); - result.append(this.targetArrowStyle); - result.append(", edgeWidth: "); - result.append(this.edgeWidth); - result.append(", showIcon: "); - result.append(this.showIcon); - result.append(", labelIcon: "); - result.append(this.labelIcon); - result.append(')'); - return result.toString(); + String result = super.toString() + " (fontSize: " + + this.fontSize + + ", italic: " + + this.italic + + ", bold: " + + this.bold + + ", underline: " + + this.underline + + ", strikeThrough: " + + this.strikeThrough + + ", borderRadius: " + + this.borderRadius + + ", borderSize: " + + this.borderSize + + ", borderLineStyle: " + + this.borderLineStyle + + ", lineStyle: " + + this.lineStyle + + ", sourceArrowStyle: " + + this.sourceArrowStyle + + ", targetArrowStyle: " + + this.targetArrowStyle + + ", edgeWidth: " + + this.edgeWidth + + ", showIcon: " + + this.showIcon + + ", labelIcon: " + + this.labelIcon + + ')'; + return result; } } // EdgeStyleImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/InsideLabelStyleImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/InsideLabelStyleImpl.java index 4c8e15aca8..d037ae200f 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/InsideLabelStyleImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/InsideLabelStyleImpl.java @@ -12,13 +12,17 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.diagram.impl; +import java.util.Objects; + import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.sirius.components.view.UserColor; +import org.eclipse.sirius.components.view.diagram.BorderStyle; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.InsideLabelStyle; +import org.eclipse.sirius.components.view.diagram.LineStyle; import org.eclipse.sirius.components.view.impl.LabelStyleImpl; /** @@ -41,85 +45,149 @@ public class InsideLabelStyleImpl extends LabelStyleImpl implements InsideLabelStyle { /** - * The cached value of the '{@link #getLabelColor() Label Color}' reference. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected static final int BORDER_RADIUS_EDEFAULT = 3; + /** + * The default value of the '{@link #getBorderSize() Border Size}' attribute. * - * @see #getLabelColor() * @generated * @ordered + * @see #getBorderSize() */ - protected UserColor labelColor; - + protected static final int BORDER_SIZE_EDEFAULT = 1; + /** + * The default value of the '{@link #getBorderLineStyle() Border Line Style}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected static final LineStyle BORDER_LINE_STYLE_EDEFAULT = LineStyle.SOLID; /** * The default value of the '{@link #isShowIcon() Show Icon}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #isShowIcon() */ protected static final boolean SHOW_ICON_EDEFAULT = false; - /** - * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #getLabelIcon() */ - protected boolean showIcon = SHOW_ICON_EDEFAULT; - + protected static final String LABEL_ICON_EDEFAULT = null; /** - * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #isWithHeader() + */ + protected static final boolean WITH_HEADER_EDEFAULT = false; + /** + * The default value of the '{@link #isDisplayHeaderSeparator() Display Header Separator}' attribute. + * + * @generated + * @ordered + * @see #isDisplayHeaderSeparator() */ - protected static final String LABEL_ICON_EDEFAULT = null; - + protected static final boolean DISPLAY_HEADER_SEPARATOR_EDEFAULT = false; /** - * The cached value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getBorderColor() */ - protected String labelIcon = LABEL_ICON_EDEFAULT; - + protected UserColor borderColor; /** - * The default value of the '{@link #isWithHeader() With Header}' attribute. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected int borderRadius = BORDER_RADIUS_EDEFAULT; + /** + * The cached value of the '{@link #getBorderSize() Border Size}' attribute. * - * @see #isWithHeader() * @generated * @ordered + * @see #getBorderSize() */ - protected static final boolean WITH_HEADER_EDEFAULT = false; - + protected int borderSize = BORDER_SIZE_EDEFAULT; /** - * The cached value of the '{@link #isWithHeader() With Header}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected LineStyle borderLineStyle = BORDER_LINE_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getLabelColor() Label Color}' reference. * - * @see #isWithHeader() * @generated * @ordered + * @see #getLabelColor() */ - protected boolean withHeader = WITH_HEADER_EDEFAULT; - + protected UserColor labelColor; /** - * The default value of the '{@link #isDisplayHeaderSeparator() Display Header Separator}' attribute. + * The cached value of the '{@link #getBackground() Background}' reference. * * @generated * @ordered - * @see #isDisplayHeaderSeparator() + * @see #getBackground() */ - protected static final boolean DISPLAY_HEADER_SEPARATOR_EDEFAULT = false; - + protected UserColor background; + /** + * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @generated + * @ordered + * @see #isShowIcon() + */ + protected boolean showIcon = SHOW_ICON_EDEFAULT; + /** + * The cached value of the '{@link #getLabelIcon() Label Icon}' attribute. + * + * @generated + * @ordered + * @see #getLabelIcon() + */ + protected String labelIcon = LABEL_ICON_EDEFAULT; + /** + * The cached value of the '{@link #isWithHeader() With Header}' attribute. + * + * @generated + * @ordered + * @see #isWithHeader() + */ + protected boolean withHeader = WITH_HEADER_EDEFAULT; /** * The cached value of the '{@link #isDisplayHeaderSeparator() Display Header Separator}' attribute. @@ -149,6 +217,115 @@ protected EClass eStaticClass() { return DiagramPackage.Literals.INSIDE_LABEL_STYLE; } + /** + * + * + * @generated + */ + @Override + public UserColor getBorderColor() { + if (this.borderColor != null && this.borderColor.eIsProxy()) { + InternalEObject oldBorderColor = (InternalEObject) this.borderColor; + this.borderColor = (UserColor) this.eResolveProxy(oldBorderColor); + if (this.borderColor != oldBorderColor) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + } + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderColor(UserColor newBorderColor) { + UserColor oldBorderColor = this.borderColor; + this.borderColor = newBorderColor; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBorderColor() { + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public int getBorderRadius() { + return this.borderRadius; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderRadius(int newBorderRadius) { + int oldBorderRadius = this.borderRadius; + this.borderRadius = newBorderRadius; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS, oldBorderRadius, this.borderRadius)); + } + + /** + * + * + * @generated + */ + @Override + public int getBorderSize() { + return this.borderSize; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderSize(int newBorderSize) { + int oldBorderSize = this.borderSize; + this.borderSize = newBorderSize; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE, oldBorderSize, this.borderSize)); + } + + /** + * + * + * @generated + */ + @Override + public LineStyle getBorderLineStyle() { + return this.borderLineStyle; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderLineStyle(LineStyle newBorderLineStyle) { + LineStyle oldBorderLineStyle = this.borderLineStyle; + this.borderLineStyle = newBorderLineStyle == null ? BORDER_LINE_STYLE_EDEFAULT : newBorderLineStyle; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE, oldBorderLineStyle, this.borderLineStyle)); + } + /** * * @@ -235,6 +412,46 @@ public void setLabelIcon(String newLabelIcon) { this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.INSIDE_LABEL_STYLE__LABEL_ICON, oldLabelIcon, this.labelIcon)); } + /** + * + * + * @generated + */ + @Override + public UserColor getBackground() { + if (this.background != null && this.background.eIsProxy()) { + InternalEObject oldBackground = (InternalEObject) this.background; + this.background = (UserColor) this.eResolveProxy(oldBackground); + if (this.background != oldBackground) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.INSIDE_LABEL_STYLE__BACKGROUND, oldBackground, this.background)); + } + } + return this.background; + } + + /** + * + * + * @generated + */ + @Override + public void setBackground(UserColor newBackground) { + UserColor oldBackground = this.background; + this.background = newBackground; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.INSIDE_LABEL_STYLE__BACKGROUND, oldBackground, this.background)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBackground() { + return this.background; + } + /** * * @@ -289,10 +506,24 @@ public void setDisplayHeaderSeparator(boolean newDisplayHeaderSeparator) { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR: + if (resolve) + return this.getBorderColor(); + return this.basicGetBorderColor(); + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS: + return this.getBorderRadius(); + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE: + return this.getBorderSize(); + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + return this.getBorderLineStyle(); case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_COLOR: if (resolve) return this.getLabelColor(); return this.basicGetLabelColor(); + case DiagramPackage.INSIDE_LABEL_STYLE__BACKGROUND: + if (resolve) + return this.getBackground(); + return this.basicGetBackground(); case DiagramPackage.INSIDE_LABEL_STYLE__SHOW_ICON: return this.isShowIcon(); case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_ICON: @@ -313,9 +544,24 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR: + this.setBorderColor((UserColor) newValue); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS: + this.setBorderRadius((Integer) newValue); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE: + this.setBorderSize((Integer) newValue); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle((LineStyle) newValue); + return; case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_COLOR: this.setLabelColor((UserColor) newValue); return; + case DiagramPackage.INSIDE_LABEL_STYLE__BACKGROUND: + this.setBackground((UserColor) newValue); + return; case DiagramPackage.INSIDE_LABEL_STYLE__SHOW_ICON: this.setShowIcon((Boolean) newValue); return; @@ -340,8 +586,23 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR: + this.setBorderColor(null); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS: + this.setBorderRadius(BORDER_RADIUS_EDEFAULT); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE: + this.setBorderSize(BORDER_SIZE_EDEFAULT); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle(BORDER_LINE_STYLE_EDEFAULT); + return; case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_COLOR: - this.setLabelColor((UserColor) null); + this.setLabelColor(null); + return; + case DiagramPackage.INSIDE_LABEL_STYLE__BACKGROUND: + this.setBackground(null); return; case DiagramPackage.INSIDE_LABEL_STYLE__SHOW_ICON: this.setShowIcon(SHOW_ICON_EDEFAULT); @@ -367,12 +628,22 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR: + return this.borderColor != null; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS: + return this.borderRadius != BORDER_RADIUS_EDEFAULT; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE: + return this.borderSize != BORDER_SIZE_EDEFAULT; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + return this.borderLineStyle != BORDER_LINE_STYLE_EDEFAULT; case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_COLOR: return this.labelColor != null; + case DiagramPackage.INSIDE_LABEL_STYLE__BACKGROUND: + return this.background != null; case DiagramPackage.INSIDE_LABEL_STYLE__SHOW_ICON: return this.showIcon != SHOW_ICON_EDEFAULT; case DiagramPackage.INSIDE_LABEL_STYLE__LABEL_ICON: - return LABEL_ICON_EDEFAULT == null ? this.labelIcon != null : !LABEL_ICON_EDEFAULT.equals(this.labelIcon); + return !Objects.equals(LABEL_ICON_EDEFAULT, this.labelIcon); case DiagramPackage.INSIDE_LABEL_STYLE__WITH_HEADER: return this.withHeader != WITH_HEADER_EDEFAULT; case DiagramPackage.INSIDE_LABEL_STYLE__DISPLAY_HEADER_SEPARATOR: @@ -381,6 +652,54 @@ public boolean eIsSet(int featureID) { return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == BorderStyle.class) { + switch (derivedFeatureID) { + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR: + return DiagramPackage.BORDER_STYLE__BORDER_COLOR; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS: + return DiagramPackage.BORDER_STYLE__BORDER_RADIUS; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE: + return DiagramPackage.BORDER_STYLE__BORDER_SIZE; + case DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == BorderStyle.class) { + switch (baseFeatureID) { + case DiagramPackage.BORDER_STYLE__BORDER_COLOR: + return DiagramPackage.INSIDE_LABEL_STYLE__BORDER_COLOR; + case DiagramPackage.BORDER_STYLE__BORDER_RADIUS: + return DiagramPackage.INSIDE_LABEL_STYLE__BORDER_RADIUS; + case DiagramPackage.BORDER_STYLE__BORDER_SIZE: + return DiagramPackage.INSIDE_LABEL_STYLE__BORDER_SIZE; + case DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.INSIDE_LABEL_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + /** * * @@ -391,17 +710,22 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (showIcon: "); - result.append(this.showIcon); - result.append(", labelIcon: "); - result.append(this.labelIcon); - result.append(", withHeader: "); - result.append(this.withHeader); - result.append(", displayHeaderSeparator: "); - result.append(this.displayHeaderSeparator); - result.append(')'); - return result.toString(); + String result = super.toString() + " (borderRadius: " + + this.borderRadius + + ", borderSize: " + + this.borderSize + + ", borderLineStyle: " + + this.borderLineStyle + + ", showIcon: " + + this.showIcon + + ", labelIcon: " + + this.labelIcon + + ", withHeader: " + + this.withHeader + + ", displayHeaderSeparator: " + + this.displayHeaderSeparator + + ')'; + return result; } } // InsideLabelStyleImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/NodeLabelStyleImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/NodeLabelStyleImpl.java deleted file mode 100644 index 691fa1f6d1..0000000000 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/NodeLabelStyleImpl.java +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2024 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 - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ -package org.eclipse.sirius.components.view.diagram.impl; - -import java.util.Objects; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.sirius.components.view.UserColor; -import org.eclipse.sirius.components.view.diagram.DiagramPackage; -import org.eclipse.sirius.components.view.diagram.NodeLabelStyle; -import org.eclipse.sirius.components.view.impl.LabelStyleImpl; - -/** - * An implementation of the model object 'Node Label Style'. - *

    - * The following features are implemented: - *

    - *
      - *
    • {@link org.eclipse.sirius.components.view.diagram.impl.NodeLabelStyleImpl#getLabelColor Label - * Color}
    • - *
    - * - * @generated - */ -public class NodeLabelStyleImpl extends LabelStyleImpl implements NodeLabelStyle { - - /** - * The default value of the '{@link #isShowIcon() Show Icon}' attribute. - * - * @generated - * @ordered - * @see #isShowIcon() - */ - protected static final boolean SHOW_ICON_EDEFAULT = false; - /** - * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. - * - * @generated - * @ordered - * @see #getLabelIcon() - */ - protected static final String LABEL_ICON_EDEFAULT = null; - /** - * The cached value of the '{@link #getLabelColor() Label Color}' reference. - * - * @generated - * @ordered - * @see #getLabelColor() - */ - protected UserColor labelColor; - /** - * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. - * - * @generated - * @ordered - * @see #isShowIcon() - */ - protected boolean showIcon = SHOW_ICON_EDEFAULT; - /** - * The cached value of the '{@link #getLabelIcon() Label Icon}' attribute. - * - * @generated - * @ordered - * @see #getLabelIcon() - */ - protected String labelIcon = LABEL_ICON_EDEFAULT; - - /** - * - * - * @generated - */ - protected NodeLabelStyleImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return DiagramPackage.Literals.NODE_LABEL_STYLE; - } - - /** - * - * - * @generated - */ - @Override - public UserColor getLabelColor() { - if (this.labelColor != null && this.labelColor.eIsProxy()) { - InternalEObject oldLabelColor = (InternalEObject) this.labelColor; - this.labelColor = (UserColor) this.eResolveProxy(oldLabelColor); - if (this.labelColor != oldLabelColor) { - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.NODE_LABEL_STYLE__LABEL_COLOR, oldLabelColor, this.labelColor)); - } - } - return this.labelColor; - } - - /** - * - * - * @generated - */ - @Override - public void setLabelColor(UserColor newLabelColor) { - UserColor oldLabelColor = this.labelColor; - this.labelColor = newLabelColor; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.NODE_LABEL_STYLE__LABEL_COLOR, oldLabelColor, this.labelColor)); - } - - /** - * - * - * @generated - */ - @Override - public boolean isShowIcon() { - return this.showIcon; - } - - /** - * - * - * @generated - */ - @Override - public void setShowIcon(boolean newShowIcon) { - boolean oldShowIcon = this.showIcon; - this.showIcon = newShowIcon; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.NODE_LABEL_STYLE__SHOW_ICON, oldShowIcon, this.showIcon)); - } - - /** - * - * - * @generated - */ - @Override - public String getLabelIcon() { - return this.labelIcon; - } - - /** - * - * - * @generated - */ - @Override - public void setLabelIcon(String newLabelIcon) { - String oldLabelIcon = this.labelIcon; - this.labelIcon = newLabelIcon; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.NODE_LABEL_STYLE__LABEL_ICON, oldLabelIcon, this.labelIcon)); - } - - /** - * - * - * @generated - */ - public UserColor basicGetLabelColor() { - return this.labelColor; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case DiagramPackage.NODE_LABEL_STYLE__LABEL_COLOR: - if (resolve) - return this.getLabelColor(); - return this.basicGetLabelColor(); - case DiagramPackage.NODE_LABEL_STYLE__SHOW_ICON: - return this.isShowIcon(); - case DiagramPackage.NODE_LABEL_STYLE__LABEL_ICON: - return this.getLabelIcon(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case DiagramPackage.NODE_LABEL_STYLE__LABEL_COLOR: - this.setLabelColor((UserColor) newValue); - return; - case DiagramPackage.NODE_LABEL_STYLE__SHOW_ICON: - this.setShowIcon((Boolean) newValue); - return; - case DiagramPackage.NODE_LABEL_STYLE__LABEL_ICON: - this.setLabelIcon((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case DiagramPackage.NODE_LABEL_STYLE__LABEL_COLOR: - this.setLabelColor(null); - return; - case DiagramPackage.NODE_LABEL_STYLE__SHOW_ICON: - this.setShowIcon(SHOW_ICON_EDEFAULT); - return; - case DiagramPackage.NODE_LABEL_STYLE__LABEL_ICON: - this.setLabelIcon(LABEL_ICON_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case DiagramPackage.NODE_LABEL_STYLE__LABEL_COLOR: - return this.labelColor != null; - case DiagramPackage.NODE_LABEL_STYLE__SHOW_ICON: - return this.showIcon != SHOW_ICON_EDEFAULT; - case DiagramPackage.NODE_LABEL_STYLE__LABEL_ICON: - return !Objects.equals(LABEL_ICON_EDEFAULT, this.labelIcon); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (this.eIsProxy()) - return super.toString(); - - String result = super.toString() + " (showIcon: " + - this.showIcon + - ", labelIcon: " + - this.labelIcon + - ')'; - return result; - } - -} // NodeLabelStyleImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/OutsideLabelStyleImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/OutsideLabelStyleImpl.java index 80122bf703..382458eb96 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/OutsideLabelStyleImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/OutsideLabelStyleImpl.java @@ -12,12 +12,16 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.diagram.impl; +import java.util.Objects; + import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.sirius.components.view.UserColor; +import org.eclipse.sirius.components.view.diagram.BorderStyle; import org.eclipse.sirius.components.view.diagram.DiagramPackage; +import org.eclipse.sirius.components.view.diagram.LineStyle; import org.eclipse.sirius.components.view.diagram.OutsideLabelStyle; import org.eclipse.sirius.components.view.impl.LabelStyleImpl; @@ -28,8 +32,18 @@ * The following features are implemented: *

    *
      + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getBorderColor Border + * Color}
    • + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getBorderRadius Border + * Radius}
    • + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getBorderSize Border + * Size}
    • + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getBorderLineStyle Border Line + * Style}
    • *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getLabelColor Label * Color}
    • + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getBackground + * Background}
    • *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#isShowIcon Show Icon}
    • *
    • {@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl#getLabelIcon Label * Icon}
    • @@ -40,52 +54,120 @@ public class OutsideLabelStyleImpl extends LabelStyleImpl implements OutsideLabelStyle { /** - * The cached value of the '{@link #getLabelColor() Label Color}' reference. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected static final int BORDER_RADIUS_EDEFAULT = 3; + /** + * The default value of the '{@link #getBorderSize() Border Size}' attribute. * - * @see #getLabelColor() * @generated * @ordered + * @see #getBorderSize() */ - protected UserColor labelColor; - + protected static final int BORDER_SIZE_EDEFAULT = 1; + /** + * The default value of the '{@link #getBorderLineStyle() Border Line Style}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected static final LineStyle BORDER_LINE_STYLE_EDEFAULT = LineStyle.SOLID; /** * The default value of the '{@link #isShowIcon() Show Icon}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #isShowIcon() */ protected static final boolean SHOW_ICON_EDEFAULT = false; - /** - * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. * - * @see #isShowIcon() * @generated * @ordered + * @see #getLabelIcon() */ - protected boolean showIcon = SHOW_ICON_EDEFAULT; - + protected static final String LABEL_ICON_EDEFAULT = null; /** - * The default value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getBorderColor() */ - protected static final String LABEL_ICON_EDEFAULT = null; - + protected UserColor borderColor; + /** + * The cached value of the '{@link #getBorderRadius() Border Radius}' attribute. + * + * + * @generated + * @ordered + * @see #getBorderRadius() + */ + protected int borderRadius = BORDER_RADIUS_EDEFAULT; + /** + * The cached value of the '{@link #getBorderSize() Border Size}' attribute. + * + * @generated + * @ordered + * @see #getBorderSize() + */ + protected int borderSize = BORDER_SIZE_EDEFAULT; + /** + * The cached value of the '{@link #getBorderLineStyle() Border Line Style}' attribute. + * + * @generated + * @ordered + * @see #getBorderLineStyle() + */ + protected LineStyle borderLineStyle = BORDER_LINE_STYLE_EDEFAULT; + /** + * The cached value of the '{@link #getLabelColor() Label Color}' reference. + * + * @generated + * @ordered + * @see #getLabelColor() + */ + protected UserColor labelColor; + /** + * The cached value of the '{@link #getBackground() Background}' reference. + * + * @generated + * @ordered + * @see #getBackground() + */ + protected UserColor background; + /** + * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @generated + * @ordered + * @see #isShowIcon() + */ + protected boolean showIcon = SHOW_ICON_EDEFAULT; /** * The cached value of the '{@link #getLabelIcon() Label Icon}' attribute. * - * @see #getLabelIcon() * @generated * @ordered + * @see #getLabelIcon() */ protected String labelIcon = LABEL_ICON_EDEFAULT; @@ -108,6 +190,115 @@ protected EClass eStaticClass() { return DiagramPackage.Literals.OUTSIDE_LABEL_STYLE; } + /** + * + * + * @generated + */ + @Override + public UserColor getBorderColor() { + if (this.borderColor != null && this.borderColor.eIsProxy()) { + InternalEObject oldBorderColor = (InternalEObject) this.borderColor; + this.borderColor = (UserColor) this.eResolveProxy(oldBorderColor); + if (this.borderColor != oldBorderColor) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + } + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderColor(UserColor newBorderColor) { + UserColor oldBorderColor = this.borderColor; + this.borderColor = newBorderColor; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR, oldBorderColor, this.borderColor)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBorderColor() { + return this.borderColor; + } + + /** + * + * + * @generated + */ + @Override + public int getBorderRadius() { + return this.borderRadius; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderRadius(int newBorderRadius) { + int oldBorderRadius = this.borderRadius; + this.borderRadius = newBorderRadius; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS, oldBorderRadius, this.borderRadius)); + } + + /** + * + * + * @generated + */ + @Override + public int getBorderSize() { + return this.borderSize; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderSize(int newBorderSize) { + int oldBorderSize = this.borderSize; + this.borderSize = newBorderSize; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE, oldBorderSize, this.borderSize)); + } + + /** + * + * + * @generated + */ + @Override + public LineStyle getBorderLineStyle() { + return this.borderLineStyle; + } + + /** + * + * + * @generated + */ + @Override + public void setBorderLineStyle(LineStyle newBorderLineStyle) { + LineStyle oldBorderLineStyle = this.borderLineStyle; + this.borderLineStyle = newBorderLineStyle == null ? BORDER_LINE_STYLE_EDEFAULT : newBorderLineStyle; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE, oldBorderLineStyle, this.borderLineStyle)); + } + /** * * @@ -194,6 +385,46 @@ public void setLabelIcon(String newLabelIcon) { this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_ICON, oldLabelIcon, this.labelIcon)); } + /** + * + * + * @generated + */ + @Override + public UserColor getBackground() { + if (this.background != null && this.background.eIsProxy()) { + InternalEObject oldBackground = (InternalEObject) this.background; + this.background = (UserColor) this.eResolveProxy(oldBackground); + if (this.background != oldBackground) { + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.OUTSIDE_LABEL_STYLE__BACKGROUND, oldBackground, this.background)); + } + } + return this.background; + } + + /** + * + * + * @generated + */ + @Override + public void setBackground(UserColor newBackground) { + UserColor oldBackground = this.background; + this.background = newBackground; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.OUTSIDE_LABEL_STYLE__BACKGROUND, oldBackground, this.background)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBackground() { + return this.background; + } + /** * * @@ -202,10 +433,24 @@ public void setLabelIcon(String newLabelIcon) { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR: + if (resolve) + return this.getBorderColor(); + return this.basicGetBorderColor(); + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS: + return this.getBorderRadius(); + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE: + return this.getBorderSize(); + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + return this.getBorderLineStyle(); case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_COLOR: if (resolve) return this.getLabelColor(); return this.basicGetLabelColor(); + case DiagramPackage.OUTSIDE_LABEL_STYLE__BACKGROUND: + if (resolve) + return this.getBackground(); + return this.basicGetBackground(); case DiagramPackage.OUTSIDE_LABEL_STYLE__SHOW_ICON: return this.isShowIcon(); case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_ICON: @@ -222,9 +467,24 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR: + this.setBorderColor((UserColor) newValue); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS: + this.setBorderRadius((Integer) newValue); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE: + this.setBorderSize((Integer) newValue); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle((LineStyle) newValue); + return; case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_COLOR: this.setLabelColor((UserColor) newValue); return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BACKGROUND: + this.setBackground((UserColor) newValue); + return; case DiagramPackage.OUTSIDE_LABEL_STYLE__SHOW_ICON: this.setShowIcon((Boolean) newValue); return; @@ -243,8 +503,23 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR: + this.setBorderColor(null); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS: + this.setBorderRadius(BORDER_RADIUS_EDEFAULT); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE: + this.setBorderSize(BORDER_SIZE_EDEFAULT); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + this.setBorderLineStyle(BORDER_LINE_STYLE_EDEFAULT); + return; case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_COLOR: - this.setLabelColor((UserColor) null); + this.setLabelColor(null); + return; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BACKGROUND: + this.setBackground(null); return; case DiagramPackage.OUTSIDE_LABEL_STYLE__SHOW_ICON: this.setShowIcon(SHOW_ICON_EDEFAULT); @@ -264,16 +539,74 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR: + return this.borderColor != null; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS: + return this.borderRadius != BORDER_RADIUS_EDEFAULT; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE: + return this.borderSize != BORDER_SIZE_EDEFAULT; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + return this.borderLineStyle != BORDER_LINE_STYLE_EDEFAULT; case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_COLOR: return this.labelColor != null; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BACKGROUND: + return this.background != null; case DiagramPackage.OUTSIDE_LABEL_STYLE__SHOW_ICON: return this.showIcon != SHOW_ICON_EDEFAULT; case DiagramPackage.OUTSIDE_LABEL_STYLE__LABEL_ICON: - return LABEL_ICON_EDEFAULT == null ? this.labelIcon != null : !LABEL_ICON_EDEFAULT.equals(this.labelIcon); + return !Objects.equals(LABEL_ICON_EDEFAULT, this.labelIcon); } return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == BorderStyle.class) { + switch (derivedFeatureID) { + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR: + return DiagramPackage.BORDER_STYLE__BORDER_COLOR; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS: + return DiagramPackage.BORDER_STYLE__BORDER_RADIUS; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE: + return DiagramPackage.BORDER_STYLE__BORDER_SIZE; + case DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == BorderStyle.class) { + switch (baseFeatureID) { + case DiagramPackage.BORDER_STYLE__BORDER_COLOR: + return DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_COLOR; + case DiagramPackage.BORDER_STYLE__BORDER_RADIUS: + return DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_RADIUS; + case DiagramPackage.BORDER_STYLE__BORDER_SIZE: + return DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_SIZE; + case DiagramPackage.BORDER_STYLE__BORDER_LINE_STYLE: + return DiagramPackage.OUTSIDE_LABEL_STYLE__BORDER_LINE_STYLE; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + /** * * @@ -284,13 +617,18 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (showIcon: "); - result.append(this.showIcon); - result.append(", labelIcon: "); - result.append(this.labelIcon); - result.append(')'); - return result.toString(); + String result = super.toString() + " (borderRadius: " + + this.borderRadius + + ", borderSize: " + + this.borderSize + + ", borderLineStyle: " + + this.borderLineStyle + + ", showIcon: " + + this.showIcon + + ", labelIcon: " + + this.labelIcon + + ')'; + return result; } } // OutsideLabelStyleImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramSwitch.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramSwitch.java index 577a54993f..3d42764c90 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramSwitch.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramSwitch.java @@ -71,8 +71,8 @@ * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is * returned, which is the result of the switch. * - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage */ public class DiagramSwitch extends Switch { @@ -98,7 +98,7 @@ public DiagramSwitch() { * Checks whether this is a switch for the given package. * * @param ePackage - * the package in question. + * the package in question. * @return whether this is a switch for the given package. * @generated */ @@ -222,6 +222,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.caseNodeLabelStyle(insideLabelStyle); if (result == null) result = this.caseLabelStyle(insideLabelStyle); + if (result == null) + result = this.caseBorderStyle(insideLabelStyle); if (result == null) result = this.defaultCase(theEObject); return result; @@ -233,6 +235,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.caseNodeLabelStyle(outsideLabelStyle); if (result == null) result = this.caseLabelStyle(outsideLabelStyle); + if (result == null) + result = this.caseBorderStyle(outsideLabelStyle); if (result == null) result = this.defaultCase(theEObject); return result; @@ -242,6 +246,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { T result = this.caseNodeLabelStyle(nodeLabelStyle); if (result == null) result = this.caseLabelStyle(nodeLabelStyle); + if (result == null) + result = this.caseBorderStyle(nodeLabelStyle); if (result == null) result = this.defaultCase(theEObject); return result; @@ -322,6 +328,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.caseStyle(edgeStyle); if (result == null) result = this.caseLabelStyle(edgeStyle); + if (result == null) + result = this.caseBorderStyle(edgeStyle); if (result == null) result = this.defaultCase(theEObject); return result; @@ -337,6 +345,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.caseStyle(conditionalEdgeStyle); if (result == null) result = this.caseLabelStyle(conditionalEdgeStyle); + if (result == null) + result = this.caseBorderStyle(conditionalEdgeStyle); if (result == null) result = this.defaultCase(theEObject); return result; @@ -523,10 +533,10 @@ protected T doSwitch(int classifierID, EObject theEObject) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDiagramDescription(DiagramDescription object) { return null; @@ -538,7 +548,7 @@ public T caseDiagramDescription(DiagramDescription object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Element Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -553,7 +563,7 @@ public T caseDiagramElementDescription(DiagramElementDescription object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Node Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -568,7 +578,7 @@ public T caseNodeDescription(NodeDescription object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Edge Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -583,7 +593,7 @@ public T caseEdgeDescription(EdgeDescription object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Layout Strategy Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -598,7 +608,7 @@ public T caseLayoutStrategyDescription(LayoutStrategyDescription object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'List Layout Strategy Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -613,10 +623,10 @@ public T caseListLayoutStrategyDescription(ListLayoutStrategyDescription object) * * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Free Form Layout Strategy Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseFreeFormLayoutStrategyDescription(FreeFormLayoutStrategyDescription object) { return null; @@ -628,7 +638,7 @@ public T caseFreeFormLayoutStrategyDescription(FreeFormLayoutStrategyDescription * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Label Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -643,7 +653,7 @@ public T caseLabelDescription(LabelDescription object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Inside Label Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -658,7 +668,7 @@ public T caseInsideLabelDescription(InsideLabelDescription object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Outside Label Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -672,10 +682,10 @@ public T caseOutsideLabelDescription(OutsideLabelDescription object) { * implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Style'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseStyle(Style object) { return null; @@ -686,10 +696,10 @@ public T caseStyle(Style object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Border Style'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseBorderStyle(BorderStyle object) { return null; @@ -701,7 +711,7 @@ public T caseBorderStyle(BorderStyle object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Inside Label Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -716,7 +726,7 @@ public T caseInsideLabelStyle(InsideLabelStyle object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Outside Label Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -731,7 +741,7 @@ public T caseOutsideLabelStyle(OutsideLabelStyle object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Node Label Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -746,7 +756,7 @@ public T caseNodeLabelStyle(NodeLabelStyle object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Node Style Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -761,7 +771,7 @@ public T caseNodeStyleDescription(NodeStyleDescription object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Conditional Node Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -776,7 +786,7 @@ public T caseConditionalNodeStyle(ConditionalNodeStyle object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Conditional Inside Label Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -791,7 +801,7 @@ public T caseConditionalInsideLabelStyle(ConditionalInsideLabelStyle object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Conditional Outside Label Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -806,10 +816,10 @@ public T caseConditionalOutsideLabelStyle(ConditionalOutsideLabelStyle object) { * * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Rectangular Node Style Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseRectangularNodeStyleDescription(RectangularNodeStyleDescription object) { return null; @@ -821,7 +831,7 @@ public T caseRectangularNodeStyleDescription(RectangularNodeStyleDescription obj * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Image Node Style Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -836,10 +846,10 @@ public T caseImageNodeStyleDescription(ImageNodeStyleDescription object) { * * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Icon Label Node Style Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseIconLabelNodeStyleDescription(IconLabelNodeStyleDescription object) { return null; @@ -850,10 +860,10 @@ public T caseIconLabelNodeStyleDescription(IconLabelNodeStyleDescription object) * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Edge Style'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseEdgeStyle(EdgeStyle object) { return null; @@ -865,7 +875,7 @@ public T caseEdgeStyle(EdgeStyle object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Conditional Edge Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -879,10 +889,10 @@ public T caseConditionalEdgeStyle(ConditionalEdgeStyle object) { * implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Palette'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDiagramPalette(DiagramPalette object) { return null; @@ -893,10 +903,10 @@ public T caseDiagramPalette(DiagramPalette object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Node Palette'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseNodePalette(NodePalette object) { return null; @@ -907,10 +917,10 @@ public T caseNodePalette(NodePalette object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Edge Palette'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseEdgePalette(EdgePalette object) { return null; @@ -921,10 +931,10 @@ public T caseEdgePalette(EdgePalette object) { * implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseTool(Tool object) { return null; @@ -935,10 +945,10 @@ public T caseTool(Tool object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Delete Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDeleteTool(DeleteTool object) { return null; @@ -949,10 +959,10 @@ public T caseDeleteTool(DeleteTool object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Drop Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDropTool(DropTool object) { return null; @@ -963,10 +973,10 @@ public T caseDropTool(DropTool object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Edge Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseEdgeTool(EdgeTool object) { return null; @@ -978,7 +988,7 @@ public T caseEdgeTool(EdgeTool object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Edge Reconnection Tool'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -993,7 +1003,7 @@ public T caseEdgeReconnectionTool(EdgeReconnectionTool object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Label Edit Tool'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -1007,10 +1017,10 @@ public T caseLabelEditTool(LabelEditTool object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Node Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseNodeTool(NodeTool object) { return null; @@ -1022,10 +1032,10 @@ public T caseNodeTool(NodeTool object) { * * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Source Edge End Reconnection Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseSourceEdgeEndReconnectionTool(SourceEdgeEndReconnectionTool object) { return null; @@ -1037,10 +1047,10 @@ public T caseSourceEdgeEndReconnectionTool(SourceEdgeEndReconnectionTool object) * * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Target Edge End Reconnection Tool'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseTargetEdgeEndReconnectionTool(TargetEdgeEndReconnectionTool object) { return null; @@ -1051,10 +1061,10 @@ public T caseTargetEdgeEndReconnectionTool(TargetEdgeEndReconnectionTool object) * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Create View'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseCreateView(CreateView object) { return null; @@ -1065,10 +1075,10 @@ public T caseCreateView(CreateView object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Delete View'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDeleteView(DeleteView object) { return null; @@ -1080,7 +1090,7 @@ public T caseDeleteView(DeleteView object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Selection Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -1094,10 +1104,10 @@ public T caseSelectionDescription(SelectionDescription object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Tool Section'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseToolSection(ToolSection object) { return null; @@ -1108,10 +1118,10 @@ public T caseToolSection(ToolSection object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Tool Section'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDiagramToolSection(DiagramToolSection object) { return null; @@ -1123,7 +1133,7 @@ public T caseDiagramToolSection(DiagramToolSection object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Node Tool Section'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -1138,7 +1148,7 @@ public T caseNodeToolSection(NodeToolSection object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Edge Tool Section'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -1153,7 +1163,7 @@ public T caseEdgeToolSection(EdgeToolSection object) { * --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Drop Node Tool'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -1168,7 +1178,7 @@ public T caseDropNodeTool(DropNodeTool object) { * end-user-doc --> * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Representation Description'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -1182,10 +1192,10 @@ public T caseRepresentationDescription(RepresentationDescription object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Label Style'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseLabelStyle(LabelStyle object) { return null; @@ -1196,10 +1206,10 @@ public T caseLabelStyle(LabelStyle object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Conditional'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseConditional(Conditional object) { return null; @@ -1210,10 +1220,10 @@ public T caseConditional(Conditional object) { * This implementation returns null; returning a non-null result will terminate the switch. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Operation'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseOperation(Operation object) { return null; @@ -1225,10 +1235,10 @@ public T caseOperation(Operation object) { * anyway. * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) */ @Override public T defaultCase(EObject object) { diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.ecore b/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.ecore index d8f4b38786..42a2f7f647 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.ecore +++ b/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.ecore @@ -212,9 +212,10 @@ + eSuperTypes="../../../../../sirius-components-view/src/main/resources/model/view.ecore#//LabelStyle #//BorderStyle"> + @@ -244,7 +245,7 @@ - + + diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.genmodel b/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.genmodel index 5d8a99cd44..df5246756c 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.genmodel +++ b/packages/view/backend/sirius-components-view-diagram/src/main/resources/model/diagram.genmodel @@ -167,6 +167,7 @@ + @@ -197,6 +198,7 @@ + diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/DiagramOperationInterpreterViewSwitch.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/DiagramOperationInterpreterViewSwitch.java index 1b5af3d35a..41da89ef65 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/DiagramOperationInterpreterViewSwitch.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/DiagramOperationInterpreterViewSwitch.java @@ -175,6 +175,10 @@ private Node createView(Optional optionalParentNode, NodeDescription nodeD .color("") .fontSize(14) .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); var insideLabel = InsideLabel.newLabel("") diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/EdgeStylePropertiesConfigurer.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/EdgeStylePropertiesConfigurer.java index 375aa66faa..04d056d98b 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/EdgeStylePropertiesConfigurer.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/EdgeStylePropertiesConfigurer.java @@ -46,6 +46,7 @@ import org.eclipse.sirius.components.view.View; import org.eclipse.sirius.components.view.ViewPackage; import org.eclipse.sirius.components.view.diagram.ArrowStyle; +import org.eclipse.sirius.components.view.diagram.BorderStyle; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.EdgeStyle; import org.eclipse.sirius.components.view.diagram.LineStyle; @@ -150,6 +151,37 @@ private List getGeneralControlDescription() { var userColor = this.propertiesWidgetCreationService.createReferenceWidget("edgestyle.Color", "Color", DiagramPackage.Literals.STYLE__COLOR, colorOptionsProvider); controls.add(userColor); + var background = this.propertiesWidgetCreationService.createReferenceWidget("edgestyle.Background", "Background", DiagramPackage.Literals.EDGE_STYLE__BACKGROUND, colorOptionsProvider); + controls.add(background); + + var borderColor = this.propertiesWidgetCreationService.createReferenceWidget("edgestyle.BorderColor", "Border Color", DiagramPackage.Literals.BORDER_STYLE__BORDER_COLOR, colorOptionsProvider); + controls.add(borderColor); + + var borderSize = this.propertiesWidgetCreationService.createTextField("edgestyle.BorderSize", "Border Size", + style -> String.valueOf(((BorderStyle) style).getBorderSize()), + (style, newValue) -> { + try { + ((BorderStyle) style).setBorderSize(Integer.parseInt(newValue)); + } catch (NumberFormatException nfe) { + // Ignore. + } + }, + DiagramPackage.Literals.BORDER_STYLE__BORDER_SIZE); + controls.add(borderSize); + + var borderRadius = this.propertiesWidgetCreationService.createTextField("edgestyle.BorderRadius", "Border Radius", + style -> String.valueOf(((BorderStyle) style).getBorderRadius()), + (style, newValue) -> { + try { + ((BorderStyle) style).setBorderRadius(Integer.parseInt(newValue)); + } catch (NumberFormatException nfe) { + // Ignore. + } + }, + DiagramPackage.Literals.BORDER_STYLE__BORDER_RADIUS); + controls.add(borderRadius); + controls.add(this.createBorderLineStyleSelectionField()); + return controls; } @@ -339,4 +371,45 @@ private BiFunction getIconLabelValueHandler() }; } + private SelectDescription createBorderLineStyleSelectionField() { + return SelectDescription.newSelectDescription("edgestyle.borderLineStyleSelector") + .idProvider(variableManager -> "edgestyle.borderLineStyleSelector") + .targetObjectIdProvider(this.propertiesConfigurerService.getSemanticTargetIdProvider()) + .labelProvider(variableManager -> "Border Line Syle") + .styleProvider(vm -> SelectStyle.newSelectStyle().showIcon(true).build()) + .valueProvider(variableManager -> variableManager.get(VariableManager.SELF, EdgeStyle.class).map(EdgeStyle::getBorderLineStyle) + .map(LineStyle::getValue) + .map(String::valueOf) + .orElse(EMPTY)) + .optionsProvider(variableManager -> LineStyle.VALUES) + .optionIdProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, LineStyle.class) + .map(LineStyle::getValue) + .map(String::valueOf) + .orElse(EMPTY)) + .optionLabelProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, LineStyle.class) + .map(Enumerator::getName) + .orElse(EMPTY)) + .optionIconURLProvider(variableManager -> List.of()) + .newValueHandler(this.getBorderLineStyleValueHandler()) + .diagnosticsProvider(this.propertiesConfigurerService.getDiagnosticsProvider(DiagramPackage.Literals.BORDER_STYLE__BORDER_LINE_STYLE)) + .kindProvider(this.propertiesConfigurerService.getKindProvider()) + .messageProvider(this.propertiesConfigurerService.getMessageProvider()) + .build(); + } + + private BiFunction getBorderLineStyleValueHandler() { + return (variableManager, newValue) -> { + var optionalEdgeStyle = variableManager.get(VariableManager.SELF, EdgeStyle.class); + if (optionalEdgeStyle.isPresent() && newValue != null && newValue.matches(INT_PATTERN)) { + int newLineStyle = Integer.parseInt(newValue); + LineStyle lineStyle = LineStyle.get(newLineStyle); + if (lineStyle != null) { + optionalEdgeStyle.get().setBorderLineStyle(lineStyle); + return new Success(); + } + } + return new Failure(""); + }; + } + } diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/StylesFactory.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/StylesFactory.java index 6ef0395755..5969415cfb 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/StylesFactory.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/StylesFactory.java @@ -27,6 +27,7 @@ import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription; import org.eclipse.sirius.components.representations.VariableManager; import org.eclipse.sirius.components.view.FixedColor; +import org.eclipse.sirius.components.view.UserColor; import org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription; import org.eclipse.sirius.components.view.diagram.InsideLabelStyle; import org.eclipse.sirius.components.view.diagram.NodeStyleDescription; @@ -44,6 +45,8 @@ public final class StylesFactory { private static final String DEFAULT_COLOR = "black"; + private static final String DEFAULT_TRANSPARENT_COLOR = "transparent"; + private final List iNodeStyleProviders; private final IObjectService objectService; @@ -55,11 +58,7 @@ public StylesFactory(List iNodeStyleProviders, IObjectServic public LabelStyleDescription createEdgeLabelStyleDescription(org.eclipse.sirius.components.view.diagram.EdgeStyle edgeStyle) { return LabelStyleDescription.newLabelStyleDescription() - .colorProvider(variableManager -> Optional.ofNullable(edgeStyle.getColor()) - .filter(FixedColor.class::isInstance) - .map(FixedColor.class::cast) - .map(FixedColor::getValue) - .orElse(DEFAULT_COLOR)) + .colorProvider(variableManager -> this.getFixedColorValue(edgeStyle.getColor(), DEFAULT_COLOR)) .fontSizeProvider(variableManager -> edgeStyle.getFontSize()) .boldProvider(variableManager -> edgeStyle.isBold()) .italicProvider(variableManager -> edgeStyle.isItalic()) @@ -75,16 +74,17 @@ public LabelStyleDescription createEdgeLabelStyleDescription(org.eclipse.sirius. } return iconURL; }) + .backgroundProvider(variableManager -> this.getFixedColorValue(edgeStyle.getBackground(), DEFAULT_TRANSPARENT_COLOR)) + .borderColorProvider(variableManager -> this.getFixedColorValue(edgeStyle.getBorderColor(), DEFAULT_COLOR)) + .borderSizeProvider(variableManager -> edgeStyle.getBorderSize()) + .borderRadiusProvider(variableManager -> edgeStyle.getBorderRadius()) + .borderStyleProvider(variableManager -> LineStyle.valueOf(edgeStyle.getBorderLineStyle().getLiteral())) .build(); } public EdgeStyle createEdgeStyle(org.eclipse.sirius.components.view.diagram.EdgeStyle edgeStyle) { return EdgeStyle.newEdgeStyle() - .color(Optional.ofNullable(edgeStyle.getColor()) - .filter(FixedColor.class::isInstance) - .map(FixedColor.class::cast) - .map(FixedColor::getValue) - .orElse(DEFAULT_COLOR)) + .color(this.getFixedColorValue(edgeStyle.getColor(), DEFAULT_COLOR)) .lineStyle(LineStyle.valueOf(edgeStyle.getLineStyle().getLiteral())) .size(edgeStyle.getEdgeWidth()) .sourceArrow(ArrowStyle.valueOf(edgeStyle.getSourceArrowStyle().getLiteral())) @@ -118,16 +118,8 @@ public INodeStyle createNodeStyle(NodeStyleDescription nodeStyle, Optional Optional.ofNullable(labelStyle.getLabelColor()) - .filter(FixedColor.class::isInstance) - .map(FixedColor.class::cast) - .map(FixedColor::getValue) - .orElse(DEFAULT_COLOR)) + .colorProvider(variableManager -> this.getFixedColorValue(labelStyle.getLabelColor(), DEFAULT_COLOR)) .fontSizeProvider(variableManager -> labelStyle.getFontSize()) .boldProvider(variableManager -> labelStyle.isBold()) .italicProvider(variableManager -> labelStyle.isItalic()) @@ -185,16 +165,17 @@ public LabelStyleDescription createInsideLabelStyle(InsideLabelStyle labelStyle) } return iconURL; }) + .backgroundProvider(variableManager -> this.getFixedColorValue(labelStyle.getBackground(), DEFAULT_TRANSPARENT_COLOR)) + .borderColorProvider(variableManager -> this.getFixedColorValue(labelStyle.getBorderColor(), DEFAULT_COLOR)) + .borderSizeProvider(variableManager -> labelStyle.getBorderSize()) + .borderRadiusProvider(variableManager -> labelStyle.getBorderRadius()) + .borderStyleProvider(variableManager -> LineStyle.valueOf(labelStyle.getBorderLineStyle().getLiteral())) .build(); } public LabelStyleDescription createOutsideLabelStyle(OutsideLabelStyle labelStyle) { return LabelStyleDescription.newLabelStyleDescription() - .colorProvider(variableManager -> Optional.ofNullable(labelStyle.getLabelColor()) - .filter(FixedColor.class::isInstance) - .map(FixedColor.class::cast) - .map(FixedColor::getValue) - .orElse(DEFAULT_COLOR)) + .colorProvider(variableManager -> this.getFixedColorValue(labelStyle.getLabelColor(), DEFAULT_COLOR)) .fontSizeProvider(variableManager -> labelStyle.getFontSize()) .boldProvider(variableManager -> labelStyle.isBold()) .italicProvider(variableManager -> labelStyle.isItalic()) @@ -210,6 +191,19 @@ public LabelStyleDescription createOutsideLabelStyle(OutsideLabelStyle labelStyl } return iconURL; }) + .backgroundProvider(variableManager -> this.getFixedColorValue(labelStyle.getBackground(), DEFAULT_TRANSPARENT_COLOR)) + .borderColorProvider(variableManager -> this.getFixedColorValue(labelStyle.getBorderColor(), DEFAULT_COLOR)) + .borderSizeProvider(variableManager -> labelStyle.getBorderSize()) + .borderRadiusProvider(variableManager -> labelStyle.getBorderRadius()) + .borderStyleProvider(variableManager -> LineStyle.valueOf(labelStyle.getBorderLineStyle().getLiteral())) .build(); } + + private String getFixedColorValue(UserColor color, String defaultValue) { + return Optional.ofNullable(color) + .filter(FixedColor.class::isInstance) + .map(FixedColor.class::cast) + .map(FixedColor::getValue) + .orElse(defaultValue); + } } diff --git a/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/TestDiagramBuilder.java b/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/TestDiagramBuilder.java index ef71cd0734..2b948495f3 100644 --- a/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/TestDiagramBuilder.java +++ b/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/TestDiagramBuilder.java @@ -102,6 +102,10 @@ public Node getNode(String id, boolean withLabel) { .color("#000000") .fontSize(16) .iconURL(List.of()) + .background("transparent") + .borderColor("black") + .borderSize(0) + .borderStyle(LineStyle.Solid) .build(); InsideLabel insideLabel = InsideLabel.newLabel(UUID.randomUUID().toString()) .text("text") diff --git a/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/ViewPaletteProviderTests.java b/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/ViewPaletteProviderTests.java index 45a9bbbdf6..a016b61665 100644 --- a/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/ViewPaletteProviderTests.java +++ b/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/diagram/ViewPaletteProviderTests.java @@ -30,6 +30,7 @@ import org.eclipse.sirius.components.diagrams.InsideLabelLocation; import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy; import org.eclipse.sirius.components.diagrams.LabelTextAlign; +import org.eclipse.sirius.components.diagrams.LineStyle; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.diagrams.description.DiagramDescription; import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription; @@ -242,6 +243,11 @@ private NodeDescription createNodeDescription() { .underlineProvider(variableManager -> false) .strikeThroughProvider(variableManager -> false) .iconURLProvider(variableManager -> List.of()) + .backgroundProvider(variableManager -> "transparent") + .borderColorProvider(variableManager -> "black") + .borderRadiusProvider(variableManager -> 0) + .borderSizeProvider(variableManager -> 0) + .borderStyleProvider(variableManager -> LineStyle.Solid) .build(); InsideLabelDescription insideLabelDescription = InsideLabelDescription.newInsideLabelDescription("nodeId")