From b109d3c9d874d8de4353a9e76a9da6170a8ee557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20ROU=C3=8BN=C3=89?= Date: Wed, 19 Jun 2024 14:35:04 +0200 Subject: [PATCH] [3647] Add support for diagram style with background customization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: https://github.com/eclipse-sirius/sirius-web/issues/3647 Signed-off-by: Florian ROUËNÉ --- CHANGELOG.adoc | 9 +- .../diagrams/TestDiagramBuilder.java | 2 + .../CreateViewOperationHandlerTests.java | 3 + .../DeleteViewOperationHandlerTests.java | 3 + .../diagrams/DiagramDescriptionConverter.java | 6 +- .../diagrams/DiagramServices.java | 9 + .../diagrams/api/IDiagramServices.java | 2 + .../main/resources/schema/diagram.graphqls | 5 + .../diagrams/DiagramEventProcessorTests.java | 2 + .../CreateDiagramEventHandlerTests.java | 2 + .../GetConnectorToolsEventHandlerTests.java | 3 + .../GetNodeDescriptionsEventHandlerTests.java | 3 + .../RenameDiagramEventHandlerTests.java | 5 +- .../diagrams/handlers/TestDiagramBuilder.java | 6 + .../TestDiagramDescriptionBuilder.java | 2 + .../sirius/components/diagrams/Diagram.java | 21 +- .../components/diagrams/DiagramStyle.java | 63 + .../diagrams/components/DiagramComponent.java | 7 +- .../description/DiagramDescription.java | 16 + .../elements/DiagramElementProps.java | 21 +- .../renderer/DiagramElementFactory.java | 1 + .../DiagramElementChangeVisibilityTests.java | 2 + .../renderer/DiagramRendererEdgeTests.java | 2 + .../renderer/DiagramRendererNodeTests.java | 2 + .../renderer/UnsynchronizedDiagramTests.java | 58 +- .../src/converter/convertDiagram.ts | 3 + .../graphql/subscription/diagramFragment.ts | 3 + .../subscription/diagramFragment.types.ts | 5 + .../src/renderer/DiagramRenderer.tsx | 9 +- .../src/renderer/DiagramRenderer.types.ts | 1 + .../renderer/dropNode/useDropDiagramStyle.tsx | 22 +- .../dropNode/useDropDiagramStyle.types.ts | 3 +- ...yleDescriptionAddMigrationParticipant.java | 44 + .../services/DefaultViewResourceProvider.java | 1 + .../DomainDiagramDescriptionProvider.java | 3 + .../ClassDiagramDescriptionProvider.java | 13 + .../ComponentDiagramDescriptionProvider.java | 12 + .../services/PapayaColorPaletteProvider.java | 8 + .../PapayaProjectTemplateInitializer.java | 7 +- .../diagrams/DiagramStyleControllerTests.java | 163 ++ .../sirius/web/data/MigrationIdentifiers.java | 2 + .../sirius/web/data/StudioIdentifiers.java | 2 + ...CustomNodesDiagramDescriptionProvider.java | 3 + .../DropNodeDiagramDescriptionProvider.java | 1 + .../EdgeDiagramDescriptionProvider.java | 1 + ...itableLabelDiagramDescriptionProvider.java | 3 + ...andCollapseDiagramDescriptionProvider.java | 3 + ...elOperationDiagramDescriptionProvider.java | 2 + ...ynchronizedDiagramDescriptionProvider.java | 3 + .../VisibilityDiagramDescriptionProvider.java | 3 + ...scriptionAddMigrationParticipantTests.java | 212 +++ .../src/test/resources/scripts/studio.sql | 38 +- ...ronizedViewDiagramDescriptionProvider.java | 4 +- ...ographyViewDiagramDescriptionProvider.java | 4 +- ...oLayoutViewDiagramDescriptionProvider.java | 4 +- .../ConditionalDiagramStyleBuilder.java | 65 + .../DiagramStyleDescriptionBuilder.java | 56 + .../ConditionalDiagramStyleBuilder.java | 65 + .../generated/diagram/DiagramBuilders.java | 33 +- .../diagram/DiagramDescriptionBuilder.java | 23 + .../DiagramStyleDescriptionBuilder.java | 56 + .../ConditionalDiagramStyleItemProvider.java | 152 ++ .../DiagramDescriptionItemProvider.java | 11 + .../diagram/provider/DiagramEditPlugin.java | 15 +- .../DiagramItemProviderAdapterFactory.java | 53 + .../DiagramStyleDescriptionItemProvider.java | 141 ++ .../src/main/resources/plugin.properties | 20 +- .../view/diagram/ConditionalDiagramStyle.java | 57 + .../view/diagram/DiagramDescription.java | 68 +- .../view/diagram/DiagramFactory.java | 18 +- .../view/diagram/DiagramPackage.java | 1322 +++++++++-------- .../view/diagram/DiagramStyleDescription.java | 57 + .../impl/ConditionalDiagramStyleImpl.java | 188 +++ .../diagram/impl/DiagramDescriptionImpl.java | 152 +- .../view/diagram/impl/DiagramFactoryImpl.java | 28 + .../view/diagram/impl/DiagramPackageImpl.java | 97 ++ .../impl/DiagramStyleDescriptionImpl.java | 168 +++ .../diagram/util/DiagramAdapterFactory.java | 108 +- .../view/diagram/util/DiagramSwitch.java | 214 +-- .../src/main/resources/model/diagram.ecore | 11 + .../src/main/resources/model/diagram.genmodel | 8 + .../view/emf/diagram/StylesFactory.java | 16 +- .../ViewDiagramDescriptionConverter.java | 24 +- .../view/emf/diagram/TestDiagramBuilder.java | 2 + .../emf/diagram/ViewPaletteProviderTests.java | 2 + .../view/emf/view/DynamicDiagramsTests.java | 9 + 86 files changed, 3211 insertions(+), 865 deletions(-) create mode 100644 packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/DiagramStyle.java create mode 100644 packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/editingcontext/migration/participants/DiagramStyleDescriptionAddMigrationParticipant.java create mode 100644 packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/diagrams/DiagramStyleControllerTests.java create mode 100644 packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/migration/DiagramStyleDescriptionAddMigrationParticipantTests.java create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalDiagramStyleBuilder.java create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DiagramStyleDescriptionBuilder.java create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/ConditionalDiagramStyleBuilder.java create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramStyleDescriptionBuilder.java create mode 100644 packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalDiagramStyleItemProvider.java create mode 100644 packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramStyleDescriptionItemProvider.java create mode 100644 packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/ConditionalDiagramStyle.java create mode 100644 packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramStyleDescription.java create mode 100644 packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalDiagramStyleImpl.java create mode 100644 packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramStyleDescriptionImpl.java diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index e180ef710f..6797b8f1c8 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -53,7 +53,7 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a * The `String` attribute `org.eclipse.sirius.components.collaborative.diagrams.dto.InvokeSingleClickOnDiagramElementToolInput#selectedObjectId` has been replaced by the attribute `variables` of type `List` - https://github.com/eclipse-sirius/sirius-web/issues/3437[#3437] [core] Migrate frontend to MUI 5, if you contributed React componenent that use MUI, you should upgrade them to use MUI 5. -- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core] Added `getStyledLabel` in `IDefaultLabelService` and `IObjectService`, you must implement this method if you have custom implementation of these interface. +- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core] Add `getStyledLabel` in `IDefaultLabelService` and `IObjectService`, you must implement this method if you have custom implementation of these interface. - https://github.com/eclipse-sirius/sirius-web/issues/3815[#3815] [core] Make child creation descriptions locale independent === Dependency update @@ -88,9 +88,11 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a - https://github.com/eclipse-sirius/sirius-web/issues/3821[#3821] [sirius-web] Allow to filter resources in `RewriteProxiesEventHandler`. Introduce new `IRewriteProxiesResourceFilter` interface, to register resource filter for `RewriteProxiesEventHandler`. - https://github.com/eclipse-sirius/sirius-web/issues/3570[#3570] [diagram] Add max width expression in the View DSL for labels -- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core] Added `getStyledLabel` in `IDefaultLabelService` and `IObjectService` that can be used to display styled string in the explorer for example. +- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core] Add `getStyledLabel` in `IDefaultLabelService` and `IObjectService` that can be used to display styled string in the explorer for example. + image:doc/screenshots/treeItemLabelStyled.jpg[StyledString, 70%] +- https://github.com/eclipse-sirius/sirius-web/issues/3647[#3647] [diagram] Add support for diagram style with background customization + === Improvements @@ -191,8 +193,7 @@ More existing APIs will be migrated to this new common pattern. - https://github.com/eclipse-sirius/sirius-web/issues/3616[#3616] [diagram] Fix potential exceptions due to duplicate keys in diagram event processing - https://github.com/eclipse-sirius/sirius-web/issues/3624[#3624] [diagram] Fix an issue where the header separator does not fill the entire width of the node - https://github.com/eclipse-sirius/sirius-web/issues/3531[#3531] [diagram] Fix unnecessary edges label re render -- https://github.com/eclipse-sirius/sirius-web/issues/3650[#3650] [diagram] Fix potential NPE in DiagramNavigator and Node toString method -- https://github.com/eclipse-sirius/sirius-web/issues/3649[#3649] [sirius-web] Restore support for Related elements view icons +- https://github.com/eclipse-sirius/sirius-web/issues/3650[#3650] [diagram] Fix potential NPE in DiagramNavigator and Node toString method- https://github.com/eclipse-sirius/sirius-web/issues/3649[#3649] [sirius-web] Restore support for Related elements view icons - https://github.com/eclipse-sirius/sirius-web/issues/3630[#3630] [sirius-web] Restore support for the deletion of dangling representations - https://github.com/eclipse-sirius/sirius-web/issues/3666[#3666] [core] Enable EMF's intrinsicIDToEObjectMap for JSON resources to support languages which use modeled identifiers (e.g. SysMLv2). - https://github.com/eclipse-sirius/sirius-web/issues/3664[#3664] [core] The Default.svg image is no longer displayed with the new architecture. 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 e2432e42e0..b68efba780 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 @@ -19,6 +19,7 @@ import org.eclipse.sirius.components.diagrams.ArrowStyle; import org.eclipse.sirius.components.diagrams.CollapsingState; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Edge; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; @@ -59,6 +60,7 @@ public Diagram getDiagram(String id) { .size(Size.UNDEFINED) .nodes(List.of()) .edges(List.of()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); } 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 592824de0e..ae4defe27f 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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.components.compatibility.emf.modeloperations.CreateViewOperationHandler; import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.INodeStyle; import org.eclipse.sirius.components.diagrams.InsideLabelLocation; @@ -88,6 +89,7 @@ public void initialize() { .nodeDescriptions(List.of(this.getNodeDescription(UUID.randomUUID().toString()))) .edgeDescriptions(List.of()) .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); Diagram diagram = Diagram.newDiagram(UUID.randomUUID().toString()) @@ -98,6 +100,7 @@ public void initialize() { .size(Size.of(100, 100)) .nodes(new ArrayList<>()) .edges(List.of()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); IDiagramContext diagramContext = new IDiagramContext.NoOp() { 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 e3aca9abc4..67592a774d 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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.diagrams.CollapsingState; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.INodeStyle; import org.eclipse.sirius.components.diagrams.ImageNodeStyle; @@ -91,6 +92,7 @@ public void initialize() { .nodeDescriptions(List.of(this.getNodeDescription(UUID.randomUUID().toString()))) .edgeDescriptions(List.of()) .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); Node node = Node.newNode(UUID.randomUUID().toString()) @@ -135,6 +137,7 @@ public void initialize() { .size(Size.of(100, 100)) .nodes(List.of(node)) .edges(List.of()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); IDiagramContext diagramContext = new IDiagramContext.NoOp() { diff --git a/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/services/diagrams/DiagramDescriptionConverter.java b/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/services/diagrams/DiagramDescriptionConverter.java index f7d071b5eb..d1ea01d85e 100644 --- a/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/services/diagrams/DiagramDescriptionConverter.java +++ b/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/services/diagrams/DiagramDescriptionConverter.java @@ -24,6 +24,7 @@ import org.eclipse.sirius.components.compatibility.diagrams.DiagramLabelProvider; import org.eclipse.sirius.components.compatibility.services.diagrams.api.IDiagramDescriptionConverter; import org.eclipse.sirius.components.diagrams.ArrangeLayoutDirection; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.description.DiagramDescription; import org.eclipse.sirius.components.diagrams.description.DiagramDescription.Builder; import org.eclipse.sirius.components.interpreter.AQLInterpreter; @@ -41,6 +42,8 @@ public class DiagramDescriptionConverter implements IDiagramDescriptionConverter private static final String FORCE_AUTO_LAYOUT = "FORCE_AUTO_LAYOUT"; + private static final String DEFAULT_BACKGROUND_COLOR = "transparent"; + private final List diagramDescriptionPopulators; private final IAQLInterpreterFactory interpreterFactory; @@ -67,7 +70,8 @@ public DiagramDescription convert(org.eclipse.sirius.diagram.description.Diagram .canCreatePredicate(canCreatePredicate) .labelProvider(labelProvider) .autoLayout(this.isAutoLayoutMode(siriusDiagramDescription)) - .arrangeLayoutDirection(ArrangeLayoutDirection.UNDEFINED); + .arrangeLayoutDirection(ArrangeLayoutDirection.UNDEFINED) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().background(DEFAULT_BACKGROUND_COLOR).build()); for (IDiagramDescriptionPopulator diagramDescriptionPopulator : this.diagramDescriptionPopulators) { diagramDescriptionPopulator.populate(builder, siriusDiagramDescription, interpreter); diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramServices.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramServices.java index fa3d931e79..ca07161b25 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramServices.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramServices.java @@ -109,4 +109,13 @@ public boolean isFaded(IDiagramElement diagramElement) { } return isFaded; } + + @Override + public boolean isDiagramEmpty(IDiagramService diagramService) { + if (diagramService.getDiagramContext() != null) { + return diagramService.getDiagramContext().getDiagram().getNodes().isEmpty() && diagramService.getDiagramContext().getViewCreationRequests().isEmpty() || + diagramService.getDiagramContext().getDiagram().getNodes().size() == 1 && !diagramService.getDiagramContext().getViewDeletionRequests().isEmpty(); + } + return false; + } } diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/api/IDiagramServices.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/api/IDiagramServices.java index 77f15b9e73..d207b9450c 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/api/IDiagramServices.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/api/IDiagramServices.java @@ -41,4 +41,6 @@ public interface IDiagramServices { boolean isHidden(IDiagramElement diagramElement); boolean isFaded(IDiagramElement diagramElement); + + boolean isDiagramEmpty(IDiagramService diagramService); } 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 24935334bf..e2e3b9cf1d 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 @@ -35,9 +35,14 @@ type Diagram implements Representation { position: Position! nodes: [Node!]! edges: [Edge!]! + style: DiagramStyle! layoutData: DiagramLayoutData! } +type DiagramStyle { + background: String +} + type DiagramLayoutData { nodeLayoutData: [NodeLayoutData!]! } diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramEventProcessorTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramEventProcessorTests.java index bcd321d3b4..3904cb4bef 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramEventProcessorTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/DiagramEventProcessorTests.java @@ -31,6 +31,7 @@ import org.eclipse.sirius.components.core.api.IPayload; import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Position; import org.eclipse.sirius.components.diagrams.Size; import org.junit.jupiter.api.Test; @@ -56,6 +57,7 @@ public class DiagramEventProcessorTests { .size(Size.UNDEFINED) .nodes(List.of()) .edges(List.of()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); private final IDiagramCreationService diagramCreationService = new MockDiagramCreationService(INITIAL_TEST_DIAGRAM); diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/CreateDiagramEventHandlerTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/CreateDiagramEventHandlerTests.java index 4689ab3e47..65fc9ecb3b 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/CreateDiagramEventHandlerTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/CreateDiagramEventHandlerTests.java @@ -32,6 +32,7 @@ import org.eclipse.sirius.components.core.api.IPayload; import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.description.DiagramDescription; import org.eclipse.sirius.components.representations.Failure; import org.eclipse.sirius.components.representations.IRepresentationDescription; @@ -64,6 +65,7 @@ public Optional findById(IEditingContext editingCont .nodeDescriptions(new ArrayList<>()) .targetObjectIdProvider(variableManager -> "targetObjectId") .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); // @formatter:on 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 22c3206720..f55f6e68ff 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 @@ -32,6 +32,7 @@ import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService; import org.eclipse.sirius.components.diagrams.CollapsingState; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.InsideLabel; import org.eclipse.sirius.components.diagrams.InsideLabelLocation; @@ -171,6 +172,7 @@ public void testGetConnectorTools() { .edgeDescriptions(new ArrayList<>()) .palettes(List.of(palette)) .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); Node sourceNode = this.getNode(SOURCE_NODE_ID, SOURCE_NODE_TARGET_ID); @@ -237,6 +239,7 @@ private Diagram getDiagram(String id, List nodes) { .size(Size.UNDEFINED) .nodes(nodes) .edges(List.of()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); } } diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetNodeDescriptionsEventHandlerTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetNodeDescriptionsEventHandlerTests.java index e9f211a1ba..790d64e287 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetNodeDescriptionsEventHandlerTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetNodeDescriptionsEventHandlerTests.java @@ -29,6 +29,7 @@ import org.eclipse.sirius.components.core.api.IPayload; import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Position; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.diagrams.description.NodeDescription; @@ -83,6 +84,7 @@ public Optional findById(IEditingContext editingCont } return desc; } + @Override public Map findAll(IEditingContext editingContext) { var descriptions = new HashMap(); @@ -114,6 +116,7 @@ public Diagram getDiagram() { .nodes(List.of()) .size(Size.UNDEFINED) .targetObjectId("") + .style(DiagramStyle.newDiagramStyle().build()) .build(); } }; diff --git a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/RenameDiagramEventHandlerTests.java b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/RenameDiagramEventHandlerTests.java index 823d46ba52..be6547e513 100644 --- a/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/RenameDiagramEventHandlerTests.java +++ b/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/RenameDiagramEventHandlerTests.java @@ -30,6 +30,7 @@ import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.core.api.IPayload; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Position; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.diagrams.description.DiagramDescription; @@ -47,6 +48,7 @@ * @author arichard */ public class RenameDiagramEventHandlerTests { + private static final String OLD_LABEL = "oldLabel"; private static final String NEW_LABEL = "newLabel"; @@ -59,7 +61,6 @@ public void testRenameRepresentation() { DiagramDescription diagramDescription = new TestDiagramDescriptionBuilder().getDiagramDescription(UUID.randomUUID().toString(), List.of(), List.of(), List.of()); - // @formatter:off Diagram diagram = Diagram.newDiagram(representationId) .label(OLD_LABEL) .descriptionId(diagramDescription.getId()) @@ -68,8 +69,8 @@ public void testRenameRepresentation() { .position(Position.at(0, 0)) .nodes(Collections.emptyList()) .edges(Collections.emptyList()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); - // @formatter:on IRepresentationSearchService representationSearchService = new IRepresentationSearchService() { @Override 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 c331e605cb..349051a256 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 @@ -19,6 +19,7 @@ import org.eclipse.sirius.components.diagrams.ArrowStyle; import org.eclipse.sirius.components.diagrams.CollapsingState; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Edge; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; @@ -62,9 +63,14 @@ public Diagram getDiagram(String id) { .size(Size.UNDEFINED) .nodes(List.of()) .edges(List.of()) + .style(this.getDiagramStyle()) .build(); } + public DiagramStyle getDiagramStyle() { + return DiagramStyle.newDiagramStyle().build(); + } + public RectangularNodeStyle getRectangularNodeStyle() { return RectangularNodeStyle.newRectangularNodeStyle() .borderColor("#000000") 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 6cdf219f52..f01f1abc68 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 @@ -17,6 +17,7 @@ import java.util.function.Function; import org.eclipse.sirius.components.diagrams.ArrowStyle; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.INodeStyle; @@ -55,6 +56,7 @@ public DiagramDescription getDiagramDescription(String diagramDescriptionId, Lis .edgeDescriptions(edgeDescriptions) .palettes(palettes) .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/Diagram.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/Diagram.java index cad5ee2903..f5d55e68a4 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/Diagram.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/Diagram.java @@ -28,6 +28,7 @@ */ @Immutable public final class Diagram implements IRepresentation { + public static final String KIND = IRepresentation.KIND_PREFIX + "?type=Diagram"; private String id; @@ -50,6 +51,8 @@ public final class Diagram implements IRepresentation { private DiagramLayoutData layoutData; + private DiagramStyle style; + private Diagram() { // Prevent instantiation } @@ -99,6 +102,10 @@ public DiagramLayoutData getLayoutData() { return this.layoutData; } + public DiagramStyle getStyle() { + return this.style; + } + public static Builder newDiagram(String id) { return new Builder(id); } @@ -120,9 +127,10 @@ public String toString() { */ @SuppressWarnings("checkstyle:HiddenField") public static final class Builder { - private String id; - private String kind = KIND; + private final String id; + + private final String kind = KIND; private String targetObjectId; @@ -138,6 +146,8 @@ public static final class Builder { private List edges; + private DiagramStyle style; + private DiagramLayoutData layoutData = new DiagramLayoutData(Map.of(), Map.of(), Map.of()); private Builder(String id) { @@ -153,6 +163,7 @@ private Builder(Diagram diagram) { this.size = diagram.getSize(); this.nodes = diagram.getNodes(); this.edges = diagram.getEdges(); + this.style = diagram.getStyle(); this.layoutData = diagram.getLayoutData(); } @@ -191,6 +202,11 @@ public Builder edges(List edges) { return this; } + public Builder style(DiagramStyle style) { + this.style = Objects.requireNonNull(style); + return this; + } + public Builder layoutData(DiagramLayoutData layoutData) { this.layoutData = Objects.requireNonNull(layoutData); return this; @@ -207,6 +223,7 @@ public Diagram build() { diagram.size = Objects.requireNonNull(this.size); diagram.nodes = Objects.requireNonNull(this.nodes); diagram.edges = Objects.requireNonNull(this.edges); + diagram.style = Objects.requireNonNull(this.style); diagram.layoutData = Objects.requireNonNull(this.layoutData); return diagram; } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/DiagramStyle.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/DiagramStyle.java new file mode 100644 index 0000000000..fbbe6cab1a --- /dev/null +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/DiagramStyle.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * 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.diagrams; + +import java.util.Objects; + +import org.eclipse.sirius.components.annotations.Immutable; + +/** + * A diagram style. + * + * @author frouene + */ +@Immutable +public final class DiagramStyle { + + private String background; + + private DiagramStyle() { + // prevent initialisation + } + + public static Builder newDiagramStyle() { + return new Builder(); + } + + public String getBackground() { + return this.background; + } + + /** + * The builder used to create the diagram style. + * + * @author frouene + */ + @SuppressWarnings("checkstyle:HiddenField") + public static final class Builder { + + private String background = "transparent"; + + public Builder background(String background) { + this.background = Objects.requireNonNull(background); + return this; + } + + public DiagramStyle build() { + DiagramStyle diagramStyle = new DiagramStyle(); + diagramStyle.background = Objects.requireNonNull(this.background); + return diagramStyle; + } + + } +} diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/DiagramComponent.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/DiagramComponent.java index 9708924414..d65305b9a1 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/DiagramComponent.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/components/DiagramComponent.java @@ -55,12 +55,12 @@ public Element render() { String diagramId = optionalPreviousDiagram.map(Diagram::getId).orElseGet(() -> UUID.randomUUID().toString()); String targetObjectId = diagramDescription.getTargetObjectIdProvider().apply(variableManager); + var style = diagramDescription.getStyleProvider().apply(variableManager); DiagramRenderingCache cache = new DiagramRenderingCache(); IDiagramElementRequestor diagramElementRequestor = new DiagramElementRequestor(); INodeDescriptionRequestor nodeDescriptionRequestor = new NodeDescriptionRequestor(allDiagramDescriptions); - // @formatter:off var nodes = diagramDescription.getNodeDescriptions().stream() .map(nodeDescription -> { var previousNodes = optionalPreviousDiagram.map(previousDiagram -> diagramElementRequestor.getRootNodes(previousDiagram, nodeDescription)) @@ -94,13 +94,11 @@ public Element render() { return new Element(EdgeComponent.class, edgeComponentProps); }) .toList(); - // @formatter:on List children = new ArrayList<>(); children.addAll(nodes); children.addAll(edges); - // @formatter:off Position position = optionalPreviousDiagram.map(Diagram::getPosition) .orElse(Position.UNDEFINED); @@ -115,8 +113,9 @@ public Element render() { .position(position) .size(size) .children(children) + .style(style) .build(); - // @formatter:on + return new Element(DiagramElementProps.TYPE, diagramElementProps); } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/DiagramDescription.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/DiagramDescription.java index 67b50baa8a..fbe17b1961 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/DiagramDescription.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/description/DiagramDescription.java @@ -20,6 +20,7 @@ import org.eclipse.sirius.components.annotations.Immutable; import org.eclipse.sirius.components.diagrams.ArrangeLayoutDirection; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.tools.Palette; import org.eclipse.sirius.components.representations.IRepresentationDescription; import org.eclipse.sirius.components.representations.IStatus; @@ -66,6 +67,8 @@ public final class DiagramDescription implements IRepresentationDescription { private Function dropNodeHandler; + private Function styleProvider; + private DiagramDescription() { // Prevent instantiation } @@ -129,6 +132,10 @@ public Function getDropNodeHandler() { return this.dropNodeHandler; } + public Function getStyleProvider() { + return this.styleProvider; + } + @Override public String toString() { String pattern = "{0} '{'id: {1}, label: {2}, nodeDescriptionCount: {3}, edgeDescriptionCount: {4}'}'"; @@ -167,6 +174,8 @@ public static final class Builder { private Function dropNodeHandler; + private Function styleProvider; + private Builder(String id) { this.id = Objects.requireNonNull(id); } @@ -184,6 +193,7 @@ private Builder(DiagramDescription diagramDescription) { this.edgeDescriptions = diagramDescription.getEdgeDescriptions(); this.dropHandler = diagramDescription.getDropHandler(); this.dropNodeHandler = diagramDescription.getDropNodeHandler(); + this.styleProvider = diagramDescription.getStyleProvider(); } public Builder label(String label) { @@ -241,6 +251,11 @@ public Builder dropNodeHandler(Function dropNodeHandle return this; } + public Builder styleProvider(Function styleProvider) { + this.styleProvider = Objects.requireNonNull(styleProvider); + return this; + } + public DiagramDescription build() { DiagramDescription diagramDescription = new DiagramDescription(); diagramDescription.id = Objects.requireNonNull(this.id); @@ -255,6 +270,7 @@ public DiagramDescription build() { diagramDescription.edgeDescriptions = Objects.requireNonNull(this.edgeDescriptions); diagramDescription.dropHandler = Objects.requireNonNull(this.dropHandler); diagramDescription.dropNodeHandler = this.dropNodeHandler; // Optional on purpose. + diagramDescription.styleProvider = Objects.requireNonNull(this.styleProvider); return diagramDescription; } } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/elements/DiagramElementProps.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/elements/DiagramElementProps.java index cc1f6aff73..486b02c15c 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/elements/DiagramElementProps.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/elements/DiagramElementProps.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2022 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.Objects; import org.eclipse.sirius.components.annotations.Immutable; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Position; import org.eclipse.sirius.components.diagrams.Size; import org.eclipse.sirius.components.representations.Element; @@ -29,6 +30,7 @@ */ @Immutable public final class DiagramElementProps implements IProps { + public static final String TYPE = "Diagram"; private String id; @@ -43,6 +45,8 @@ public final class DiagramElementProps implements IProps { private Size size; + private DiagramStyle style; + private List children; private DiagramElementProps() { @@ -73,6 +77,10 @@ public Size getSize() { return this.size; } + public DiagramStyle getStyle() { + return this.style; + } + @Override public List getChildren() { return this.children; @@ -95,7 +103,8 @@ public String toString() { */ @SuppressWarnings("checkstyle:HiddenField") public static final class Builder { - private String id; + + private final String id; private String targetObjectId; @@ -107,6 +116,8 @@ public static final class Builder { private Size size; + private DiagramStyle style; + private List children; private Builder(String id) { @@ -138,6 +149,11 @@ public Builder size(Size size) { return this; } + public Builder style(DiagramStyle style) { + this.style = Objects.requireNonNull(style); + return this; + } + public Builder children(List children) { this.children = Objects.requireNonNull(children); return this; @@ -152,6 +168,7 @@ public DiagramElementProps build() { diagramElementProps.position = Objects.requireNonNull(this.position); diagramElementProps.size = Objects.requireNonNull(this.size); diagramElementProps.children = Objects.requireNonNull(this.children); + diagramElementProps.style = Objects.requireNonNull(this.style); return diagramElementProps; } } diff --git a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementFactory.java b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementFactory.java index 8897efb578..ca82416851 100644 --- a/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementFactory.java +++ b/packages/diagrams/backend/sirius-components-diagrams/src/main/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementFactory.java @@ -79,6 +79,7 @@ private Diagram instantiateDiagram(IProps props, List children) { .size(diagramElementProps.getSize()) .nodes(nodes) .edges(edges) + .style(diagramElementProps.getStyle()) .build(); } return null; 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 598fe92bfd..d0bfef687e 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 @@ -29,6 +29,7 @@ import org.eclipse.sirius.components.diagrams.ArrowStyle; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Edge; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; @@ -205,6 +206,7 @@ private Diagram createDiagram(Optional previousDiagram, List new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); VariableManager variableManager = new VariableManager(); 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 d5decff404..14ee29d45d 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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.components.diagrams.ArrowStyle; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Edge; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; @@ -148,6 +149,7 @@ private Diagram renderDiagram(List nodeDescriptions, List new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); VariableManager variableManager = new VariableManager(); 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 653ef840ae..ee580dca31 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 @@ -23,6 +23,7 @@ import org.eclipse.sirius.components.diagrams.CustomizableProperties; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.INodeStyle; import org.eclipse.sirius.components.diagrams.ImageNodeStyle; @@ -297,6 +298,7 @@ private Diagram createDiagram(Function styleProvide .edgeDescriptions(new ArrayList<>()) .palettes(List.of()) .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); VariableManager variableManager = new VariableManager(); 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 ca074305dd..872a12fdaf 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 @@ -20,6 +20,7 @@ import java.util.function.Function; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.ILayoutStrategy; import org.eclipse.sirius.components.diagrams.INodeStyle; @@ -306,55 +307,22 @@ private DiagramDescription getDiagramDescription(Function childrenLayoutStrategyProvider = variableManager -> new FreeFormLayoutStrategy(); - NodeDescription subUnsynchronizedNodeDescription = NodeDescription.newNodeDescription("subUnsynchronized") + NodeDescription subUnsynchronizedNodeDescription = this.getCommonNodeDescriptionBuilder("subUnsynchronized", insideLabelDescription, styleProvider, childrenLayoutStrategyProvider) .synchronizationPolicy(SynchronizationPolicy.UNSYNCHRONIZED) - .typeProvider(variableManager -> NODE_TYPE) .semanticElementsProvider(semanticElementsProvider) - .targetObjectIdProvider(variableManager -> TARGET_OBJECT_ID) - .targetObjectKindProvider(variableManager -> "") - .targetObjectLabelProvider(variableManager -> "") - .insideLabelDescription(insideLabelDescription) - .styleProvider(styleProvider) - .childrenLayoutStrategyProvider(childrenLayoutStrategyProvider) - .sizeProvider(variableManager -> Size.UNDEFINED) - .borderNodeDescriptions(new ArrayList<>()) .childNodeDescriptions(new ArrayList<>()) - .labelEditHandler((variableManager, newLabel) -> new Success()) - .deleteHandler(variableManager -> new Success()) .build(); - NodeDescription unsynchronizedNodeDescription = NodeDescription.newNodeDescription("unsynchronized") + NodeDescription unsynchronizedNodeDescription = this.getCommonNodeDescriptionBuilder("unsynchronized", insideLabelDescription, styleProvider, childrenLayoutStrategyProvider) .synchronizationPolicy(SynchronizationPolicy.UNSYNCHRONIZED) - .typeProvider(variableManager -> NODE_TYPE) .semanticElementsProvider(semanticElementsProvider) - .targetObjectIdProvider(variableManager -> TARGET_OBJECT_ID) - .targetObjectKindProvider(variableManager -> "") - .targetObjectLabelProvider(variableManager -> "") - .insideLabelDescription(insideLabelDescription) - .styleProvider(styleProvider) - .childrenLayoutStrategyProvider(childrenLayoutStrategyProvider) - .sizeProvider(variableManager -> Size.UNDEFINED) - .borderNodeDescriptions(new ArrayList<>()) .childNodeDescriptions(List.of(subUnsynchronizedNodeDescription)) - .labelEditHandler((variableManager, newLabel) -> new Success()) - .deleteHandler(variableManager -> new Success()) .build(); - NodeDescription synchronizedNodeDescription = NodeDescription.newNodeDescription("synchronized") + NodeDescription synchronizedNodeDescription = this.getCommonNodeDescriptionBuilder("synchronized", insideLabelDescription, styleProvider, childrenLayoutStrategyProvider) .synchronizationPolicy(SynchronizationPolicy.SYNCHRONIZED) - .typeProvider(variableManager -> NODE_TYPE) .semanticElementsProvider(variableManager -> List.of(new Object())) - .targetObjectIdProvider(variableManager -> TARGET_OBJECT_ID) - .targetObjectKindProvider(variableManager -> "") - .targetObjectLabelProvider(variableManager -> "") - .insideLabelDescription(insideLabelDescription) - .styleProvider(styleProvider) - .childrenLayoutStrategyProvider(childrenLayoutStrategyProvider) - .sizeProvider(variableManager -> Size.UNDEFINED) - .borderNodeDescriptions(new ArrayList<>()) .childNodeDescriptions(new ArrayList<>()) - .labelEditHandler((variableManager, newLabel) -> new Success()) - .deleteHandler(variableManager -> new Success()) .build(); return DiagramDescription.newDiagramDescription("diagram") @@ -366,6 +334,24 @@ private DiagramDescription getDiagramDescription(Function new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); } + + private NodeDescription.Builder getCommonNodeDescriptionBuilder(String id, + InsideLabelDescription insideLabelDescription, Function styleProvider, Function childrenLayoutStrategyProvider) { + + return NodeDescription.newNodeDescription(id) + .typeProvider(variableManager -> NODE_TYPE) + .targetObjectIdProvider(variableManager -> TARGET_OBJECT_ID) + .targetObjectKindProvider(variableManager -> "") + .targetObjectLabelProvider(variableManager -> "") + .insideLabelDescription(insideLabelDescription) + .styleProvider(styleProvider) + .childrenLayoutStrategyProvider(childrenLayoutStrategyProvider) + .sizeProvider(variableManager -> Size.UNDEFINED) + .borderNodeDescriptions(new ArrayList<>()) + .labelEditHandler((variableManager, newLabel) -> new Success()) + .deleteHandler(variableManager -> new Success()); + } } 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 e9e9b6f0cb..2b0b3f37c5 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertDiagram.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/converter/convertDiagram.ts @@ -221,6 +221,9 @@ export const convertDiagram = ( layoutHandles(rawDiagram, diagramDescription, nodeInternals); return { + style: { + background: gqlDiagram.style.background, + }, nodes: rawDiagram.nodes, edges: rawDiagram.edges, }; diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.ts index ea99bf75b1..8f339622ea 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.ts @@ -23,6 +23,9 @@ fragment diagramFragment on Diagram { label kind } + style { + background + } layoutData { nodeLayoutData { id diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.types.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.types.ts index 39a799b6c1..10b7a039a3 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.types.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/graphql/subscription/diagramFragment.types.ts @@ -20,6 +20,7 @@ export interface GQLDiagram { metadata: GQLRepresentationMetadata; nodes: GQLNode[]; edges: GQLEdge[]; + style: GQLDiagramStyle; layoutData: GQLDiagramLayoutData; } @@ -38,3 +39,7 @@ export interface GQLRepresentationMetadata { kind: string; label: string; } + +export interface GQLDiagramStyle { + background: string; +} diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.tsx b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.tsx index 7f36c5397c..26d661a299 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.tsx +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/DiagramRenderer.tsx @@ -117,7 +117,7 @@ export const DiagramRenderer = memo(({ diagramRefreshedEventPayload }: DiagramRe const { reconnectEdge } = useReconnectEdge(); const { onDrop, onDragOver } = useDrop(); const { onNodeDragStart, onNodeDrag, onNodeDragStop } = useDropNode(); - const { backgroundColor, largeGridColor, smallGridColor } = useDropDiagramStyle(); + const { background, setBackground, largeGridColor, smallGridColor } = useDropDiagramStyle(); const { nodeTypes } = useNodeType(); const { nodeConverters } = useContext(NodeTypeContext); @@ -162,6 +162,9 @@ export const DiagramRenderer = memo(({ diagramRefreshedEventPayload }: DiagramRe synchronizeLayoutData(diagramRefreshedEventPayload.id, laidOutDiagram); }); } + if (convertedDiagram.style.background) { + setBackground(String(convertedDiagram.style.background)); + } }, [diagramRefreshedEventPayload, diagramDescription, edgeType]); useEffect(() => { @@ -339,7 +342,7 @@ export const DiagramRenderer = memo(({ diagramRefreshedEventPayload }: DiagramRe <> ) : ( - + )} []; edges: Edge[]; + style: React.CSSProperties; } export type OutsideLabelLocation = 'BOTTOM_BEGIN' | 'BOTTOM_MIDDLE' | 'BOTTOM_END'; diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.tsx b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.tsx index ad2ce9fb98..dafbb8d02a 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.tsx +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.tsx @@ -11,8 +11,9 @@ * Obeo - initial API and implementation *******************************************************************************/ +import { getCSSColor } from '@eclipse-sirius/sirius-components-core'; import { useTheme } from '@mui/material/styles'; -import { useContext, useMemo } from 'react'; +import { useCallback, useContext, useMemo, useState } from 'react'; import { useStore } from '../../representation/useStore'; import { DropNodeContext } from './DropNodeContext'; import { DropNodeContextValue } from './DropNodeContext.types'; @@ -22,6 +23,7 @@ export const useDropDiagramStyle = (): useDropDiagramStyleValue => { const { droppableOnDiagram } = useContext(DropNodeContext); const { getNodes } = useStore(); const theme = useTheme(); + const [background, setBackground] = useState(theme.palette.background.default); const targetNode = getNodes().find((node) => node.data.isDropNodeTarget); const draggedNode = getNodes().find((node) => node.dragging); @@ -29,15 +31,23 @@ export const useDropDiagramStyle = (): useDropDiagramStyleValue => { const diagramTargeted: boolean = !!draggedNode && !targetNode && !!draggedNode?.parentNode && !draggedNode.data.isBorderNode; const diagramForbidden: boolean = diagramTargeted && !!draggedNode?.id !== null && !droppableOnDiagram; - const backgroundColor = diagramForbidden ? theme.palette.action.disabledBackground : theme.palette.background.default; + const backgroundColor = diagramForbidden ? theme.palette.action.disabledBackground : background; + + const setBackgroundAfterTransformation = useCallback( + (newBackground: string) => { + setBackground(getCSSColor(newBackground, theme)); + }, + [setBackground] + ); const memoizedStyle = useMemo(() => { return { - backgroundColor, - smallGridColor: diagramForbidden ? backgroundColor : '#f1f1f1', - largeGridColor: diagramForbidden ? backgroundColor : '#cccccc', + background: backgroundColor, + smallGridColor: diagramForbidden ? 'transparent' : '#f1f1f1', + largeGridColor: diagramForbidden ? 'transparent' : '#cccccc', + setBackground: setBackgroundAfterTransformation, }; - }, [diagramForbidden]); + }, [diagramForbidden, backgroundColor]); return memoizedStyle; }; diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.types.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.types.ts index 1887a162bc..34f25c2db8 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.types.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/dropNode/useDropDiagramStyle.types.ts @@ -12,7 +12,8 @@ *******************************************************************************/ export interface useDropDiagramStyleValue { - backgroundColor: string; + background: string; smallGridColor: string; largeGridColor: string; + setBackground: (background: string) => void; } diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/editingcontext/migration/participants/DiagramStyleDescriptionAddMigrationParticipant.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/editingcontext/migration/participants/DiagramStyleDescriptionAddMigrationParticipant.java new file mode 100644 index 0000000000..8797d35009 --- /dev/null +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/editingcontext/migration/participants/DiagramStyleDescriptionAddMigrationParticipant.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * 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.editingcontext.migration.participants; + +import com.google.gson.JsonObject; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.sirius.components.emf.migration.api.IMigrationParticipant; +import org.eclipse.sirius.components.view.diagram.DiagramDescription; +import org.eclipse.sirius.components.view.diagram.DiagramPackage; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; +import org.springframework.stereotype.Service; + +/** + * MigrationParticipant that add the DiagramStyle of DiagramDescription. + * + * @author frouene + */ +@Service +public class DiagramStyleDescriptionAddMigrationParticipant implements IMigrationParticipant { + + @Override + public String getVersion() { + return "2024.9.0-202456071800"; + } + + @Override + public void postObjectLoading(EObject eObject, JsonObject jsonObject) { + if (eObject instanceof DiagramDescription diagramDescription && diagramDescription.getStyle() == null) { + DiagramStyleDescription diagramStyleDescription = DiagramPackage.eINSTANCE.getDiagramFactory().createDiagramStyleDescription(); + diagramDescription.setStyle(diagramStyleDescription); + } + } +} 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 8555ff9e1e..d5562196ed 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 @@ -74,6 +74,7 @@ public Resource getResource(String domainName) { viewDiagramDescription.setDomainType(domainName + "::Root"); viewDiagramDescription.setTitleExpression(domainName + " diagram"); viewDiagramDescription.setPalette(defaultToolsFactory.createDefaultDiagramPalette()); + viewDiagramDescription.setStyle(DiagramFactory.eINSTANCE.createDiagramStyleDescription()); view.getDescriptions().add(viewDiagramDescription); view.getColorPalettes().add(this.createColorPalette()); 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 e90b2c528d..6500d1a2a4 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 @@ -155,6 +155,8 @@ private DiagramDescription domainDiagramDescription() { .nodeTools(newEntityNodeTool) .build(); + var style = new DiagramBuilders().newDiagramStyleDescription().build(); + return new DiagramBuilders() .newDiagramDescription() .name("Domain") @@ -162,6 +164,7 @@ private DiagramDescription domainDiagramDescription() { .titleExpression("aql:'Domain'") .palette(palette) .arrangeLayoutDirection(ArrangeLayoutDirection.DOWN) + .style(style) .build(); } diff --git a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/classdiagram/ClassDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/classdiagram/ClassDiagramDescriptionProvider.java index aa3ba1343f..55adc9ac3e 100644 --- a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/classdiagram/ClassDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/classdiagram/ClassDiagramDescriptionProvider.java @@ -34,6 +34,7 @@ import org.eclipse.sirius.web.papaya.representations.classdiagram.nodedescriptions.InterfaceNodeDescriptionProvider; import org.eclipse.sirius.web.papaya.representations.classdiagram.nodedescriptions.RecordNodeDescriptionProvider; import org.eclipse.sirius.web.papaya.representations.classdiagram.tools.ClassDiagramDropToolProvider; +import org.eclipse.sirius.web.papaya.services.PapayaColorPaletteProvider; /** * Used to provide the view model used to create class diagrams. @@ -52,6 +53,18 @@ public RepresentationDescription create(IColorProvider colorProvider) { classDiagramDescription.setTitleExpression("aql:self.name + ' class diagram'"); classDiagramDescription.setAutoLayout(false); classDiagramDescription.setArrangeLayoutDirection(ArrangeLayoutDirection.UP); + classDiagramDescription.setStyle(DiagramFactory.eINSTANCE.createDiagramStyleDescription()); + classDiagramDescription.setStyle(new DiagramBuilders().newDiagramStyleDescription() + .background(colorProvider.getColor(PapayaColorPaletteProvider.DEFAULT_BACKGROUND)) + .build()); + + var emptyDiagramStyle = new DiagramBuilders().newConditionalDiagramStyle() + .condition("aql:diagramServices.isDiagramEmpty()") + .style(new DiagramBuilders().newDiagramStyleDescription() + .background(colorProvider.getColor(PapayaColorPaletteProvider.EMPTY_DIAGRAM_BACKGROUND)) + .build()) + .build(); + classDiagramDescription.getConditionalStyles().add(emptyDiagramStyle); var cache = new DefaultViewDiagramElementFinder(); diff --git a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/componentdiagram/ComponentDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/componentdiagram/ComponentDiagramDescriptionProvider.java index 01388048b5..fbbc2f21c3 100644 --- a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/componentdiagram/ComponentDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/representations/componentdiagram/ComponentDiagramDescriptionProvider.java @@ -29,6 +29,7 @@ import org.eclipse.sirius.web.papaya.representations.componentdiagram.nodedescriptions.ComponentNodeDescriptionProvider; import org.eclipse.sirius.web.papaya.representations.componentdiagram.tools.ComponentDiagramDropToolProvider; import org.eclipse.sirius.web.papaya.representations.componentdiagram.tools.CreateComponentNodeToolProvider; +import org.eclipse.sirius.web.papaya.services.PapayaColorPaletteProvider; /** * Used to provide the view model used to create component diagrams. @@ -47,6 +48,17 @@ public RepresentationDescription create(IColorProvider colorProvider) { componentDiagramDescription.setTitleExpression("aql:self.name + ' component diagram'"); componentDiagramDescription.setAutoLayout(false); componentDiagramDescription.setArrangeLayoutDirection(ArrangeLayoutDirection.DOWN); + componentDiagramDescription.setStyle(new DiagramBuilders().newDiagramStyleDescription() + .background(colorProvider.getColor(PapayaColorPaletteProvider.DEFAULT_BACKGROUND)) + .build()); + + var emptyDiagramStyle = new DiagramBuilders().newConditionalDiagramStyle() + .condition("aql:diagramServices.isDiagramEmpty()") + .style(new DiagramBuilders().newDiagramStyleDescription() + .background(colorProvider.getColor(PapayaColorPaletteProvider.EMPTY_DIAGRAM_BACKGROUND)) + .build()) + .build(); + componentDiagramDescription.getConditionalStyles().add(emptyDiagramStyle); var cache = new DefaultViewDiagramElementFinder(); diff --git a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaColorPaletteProvider.java b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaColorPaletteProvider.java index 751ed52aeb..64f4e86e4e 100644 --- a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaColorPaletteProvider.java +++ b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaColorPaletteProvider.java @@ -28,7 +28,14 @@ public class PapayaColorPaletteProvider { public static final String DEFAULT_BACKGROUND = "default.background"; + public static final String EMPTY_DIAGRAM_BACKGROUND = "empty-diagram-background"; + public ColorPalette getColorPalette() { + var emptyDiagramBackground = new ViewBuilders().newFixedColor() + .name(EMPTY_DIAGRAM_BACKGROUND) + .value("url('data:image/svg+xml;utf8, Drag and drop elements to get started ') no-repeat center center / contain") + .build(); + var paletteTextPrimary = new ViewBuilders().newFixedColor() .name(PALETTE_TEXT_PRIMARY) .value(PALETTE_TEXT_PRIMARY) @@ -47,6 +54,7 @@ public ColorPalette getColorPalette() { return new ViewBuilders().newColorPalette() .name("Papaya Color Palette") .colors( + emptyDiagramBackground, paletteTextPrimary, paletteErrorMain, defaultBackground diff --git a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaProjectTemplateInitializer.java b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaProjectTemplateInitializer.java index 42e0807092..6876b9f296 100644 --- a/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaProjectTemplateInitializer.java +++ b/packages/sirius-web/backend/sirius-web-papaya/src/main/java/org/eclipse/sirius/web/papaya/services/PapayaProjectTemplateInitializer.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.sirius.web.papaya.services; -import java.util.List; +import java.util.Objects; import java.util.Optional; import org.eclipse.sirius.components.core.RepresentationMetadata; @@ -26,7 +26,6 @@ import org.eclipse.sirius.web.papaya.factories.SiriusWebProjectFactory; import org.eclipse.sirius.web.papaya.factories.SpringProjectFactory; import org.eclipse.sirius.web.papaya.factories.services.EObjectIndexer; -import org.eclipse.sirius.web.papaya.factories.services.EObjectInitializer; import org.springframework.stereotype.Service; /** @@ -39,7 +38,7 @@ public class PapayaProjectTemplateInitializer implements IProjectTemplateInitial @Override public boolean canHandle(String projectTemplateId) { - return List.of(PapayaProjectTemplateProvider.SIRIUS_WEB_PROJECT_TEMPLATE_ID).contains(projectTemplateId); + return Objects.equals(PapayaProjectTemplateProvider.SIRIUS_WEB_PROJECT_TEMPLATE_ID, projectTemplateId); } @Override @@ -62,8 +61,6 @@ public Optional handle(String projectTemplateId, IEditin new EMFProjectFactory().link(eObjectIndexer); new SiriusWebProjectFactory().link(eObjectIndexer); - var eObjectInitializer = new EObjectInitializer(eObjectIndexer); - eObjectInitializer.initialize(emfEditingContext.getDomain().getResourceSet()); } return Optional.empty(); } diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/diagrams/DiagramStyleControllerTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/diagrams/DiagramStyleControllerTests.java new file mode 100644 index 0000000000..29256453cc --- /dev/null +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/diagrams/DiagramStyleControllerTests.java @@ -0,0 +1,163 @@ +/******************************************************************************* + * 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.diagrams; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import com.jayway.jsonpath.JsonPath; + +import java.time.Duration; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import org.eclipse.sirius.components.collaborative.diagrams.dto.DiagramRefreshedEventPayload; +import org.eclipse.sirius.components.collaborative.dto.CreateChildInput; +import org.eclipse.sirius.components.collaborative.dto.CreateChildSuccessPayload; +import org.eclipse.sirius.components.collaborative.dto.CreateRepresentationInput; +import org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload; +import org.eclipse.sirius.components.forms.Form; +import org.eclipse.sirius.components.forms.tests.assertions.FormAssertions; +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.application.views.details.dto.DetailsEventInput; +import org.eclipse.sirius.web.data.StudioIdentifiers; +import org.eclipse.sirius.web.tests.graphql.CreateChildMutationRunner; +import org.eclipse.sirius.web.tests.graphql.DetailsEventSubscriptionRunner; +import org.eclipse.sirius.web.tests.services.api.IGivenCreatedDiagramSubscription; +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 "Diagram Style" view. + * + * @author frouene + */ +@Transactional +@SuppressWarnings("checkstyle:MultipleStringLiterals") +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "sirius.web.test.enabled=studio" }) +public class DiagramStyleControllerTests extends AbstractIntegrationTests { + + @Autowired + private IGivenInitialServerState givenInitialServerState; + + @Autowired + private DetailsEventSubscriptionRunner detailsEventSubscriptionRunner; + + @Autowired + private IGivenCreatedDiagramSubscription givenCreatedDiagramSubscription; + + @Autowired + private CreateChildMutationRunner createChildMutationRunner; + + @BeforeEach + public void beforeEach() { + this.givenInitialServerState.initialize(); + } + + @Test + @DisplayName("Given a diagram style, when we subscribe to its properties events, then the form contains background property") + @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 givenDiagramStyleObjectWhenWeSubscribeToItsPropertiesEventsThenTheFormContainsBackgroundProperty() { + var input = new DetailsEventInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString(), List.of(StudioIdentifiers.DIAGRAM_STYLE_DESCRIPTION_OBJECT.toString())); + var flux = this.detailsEventSubscriptionRunner.run(input); + + Predicate
formPredicate = form -> { + var groupNavigator = new FormNavigator(form).page("").group("Core Properties"); + + var backgroundReferenceWidget = groupNavigator.findWidget("Background", ReferenceWidget.class); + FormAssertions.assertThat(backgroundReferenceWidget).hasValueWithLabel("White"); + + 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)); + } + + @Test + @DisplayName("Given a view based diagram, when diagram is using conditional style, then the style is computed properly") + @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 givenViewBasedDiagramWhenDiagramIsUsingConditionalStyleThenTheStyleIsComputedProperly() { + var input = new CreateRepresentationInput(UUID.randomUUID(), StudioIdentifiers.INSTANCE_PROJECT.toString(), StudioIdentifiers.DIAGRAM_DESCRIPTION_ID, StudioIdentifiers.ROOT_OBJECT.toString(), ""); + var flux = this.givenCreatedDiagramSubscription.createAndSubscribe(input); + + Consumer initialDiagramStyleConsumer = payload -> Optional.of(payload) + .filter(DiagramRefreshedEventPayload.class::isInstance) + .map(DiagramRefreshedEventPayload.class::cast) + .map(DiagramRefreshedEventPayload::diagram) + .ifPresentOrElse(diagram -> { + assertThat(diagram.getStyle()) + .isNotNull() + .matches(style -> style.getBackground().equals("#FFFFFF")); + }, () -> fail("Missing style background")); + + Consumer conditonnalDiagramStyleConsumer = payload -> Optional.of(payload) + .filter(DiagramRefreshedEventPayload.class::isInstance) + .map(DiagramRefreshedEventPayload.class::cast) + .map(DiagramRefreshedEventPayload::diagram) + .ifPresentOrElse(diagram -> { + assertThat(diagram.getStyle()) + .isNotNull() + .matches(style -> style.getBackground().equals("#000000")); + }, () -> fail("Missing style background")); + + Runnable runnable = () -> { + var createChildInput = new CreateChildInput( + UUID.randomUUID(), + StudioIdentifiers.INSTANCE_PROJECT.toString(), + StudioIdentifiers.ROOT_OBJECT.toString(), + "humans-Human" + ); + var result = this.createChildMutationRunner.run(createChildInput); + String typename = JsonPath.read(result, "$.data.createChild.__typename"); + assertThat(typename).isEqualTo(CreateChildSuccessPayload.class.getSimpleName()); + }; + + StepVerifier.create(flux) + .consumeNextWith(initialDiagramStyleConsumer) + .then(runnable) + .consumeNextWith(conditonnalDiagramStyleConsumer) + .thenCancel() + .verify(Duration.ofSeconds(10)); + } + +} diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/MigrationIdentifiers.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/MigrationIdentifiers.java index c5ca99fd86..313b5d4205 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/MigrationIdentifiers.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/data/MigrationIdentifiers.java @@ -53,7 +53,9 @@ public final class MigrationIdentifiers { public static final String MIGRATION_SELECTION_DIALOG_DESCRIPTION_SELECTION_CANDIDATES_EXPRESSION_STUDIO_DIAGRAM = "SelectionDialogDescription#selectionCandidatesExpression migration"; + public static final UUID MIGRATION_DIAGRAM_STYLE_DESCRIPTION = UUID.fromString("14df1eb9-0915-4a62-ba83-b26ce5e2cfe1"); + public static final String MIGRATION_DIAGRAM_STYLE_DESCRIPTION_DIAGRAM = "NodeStyleDescription#color migration"; private MigrationIdentifiers() { // Prevent instantiation 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 3e0bb52b7e..9dd53d2371 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 @@ -53,6 +53,8 @@ public final class StudioIdentifiers { public static final UUID HUMAN_INSIDE_LABEL_STYLE_OBJECT = UUID.fromString("c8338087-e98e-43bd-ae1a-879b64308a7d"); + public static final UUID DIAGRAM_STYLE_DESCRIPTION_OBJECT = UUID.fromString("82dd8017-a782-4d48-8926-019c1a88db53"); + private StudioIdentifiers() { // Prevent instantiation } diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/CustomNodesDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/CustomNodesDiagramDescriptionProvider.java index 2ee7000d23..8864c127f1 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/CustomNodesDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/CustomNodesDiagramDescriptionProvider.java @@ -23,6 +23,7 @@ import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.components.view.View; import org.eclipse.sirius.components.view.builder.generated.customnodes.EllipseNodeStyleDescriptionBuilder; +import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramBuilders; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.NodeDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.view.ViewBuilder; @@ -103,6 +104,8 @@ private DiagramDescription createDiagramDescription() { .nodeDescriptions(nodeDescription) .edgeDescriptions() .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription() + .build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/DropNodeDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/DropNodeDiagramDescriptionProvider.java index 91177ee292..26a3e7ddb1 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/DropNodeDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/DropNodeDiagramDescriptionProvider.java @@ -155,6 +155,7 @@ private DiagramDescription createDiagramDescription() { .edgeDescriptions(edgeDescription) .palette(diagramPalette) .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription().build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EdgeDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EdgeDiagramDescriptionProvider.java index c5db5801a6..f0441dadfc 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EdgeDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EdgeDiagramDescriptionProvider.java @@ -157,6 +157,7 @@ private DiagramDescription createDiagramDescription() { .nodeDescriptions(nodeDescription) .edgeDescriptions(edgeDescription) .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription().build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EditableLabelDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EditableLabelDiagramDescriptionProvider.java index 8af76eb48f..af14dbe032 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EditableLabelDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/EditableLabelDiagramDescriptionProvider.java @@ -22,6 +22,7 @@ import org.eclipse.sirius.components.emf.services.IDAdapter; import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.components.view.View; +import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramBuilders; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.InsideLabelDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.LabelEditToolBuilder; @@ -132,6 +133,8 @@ private DiagramDescription createDiagramDescription() { .nodeDescriptions(nodeDescription) .edgeDescriptions() .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription() + .build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ExpandCollapseDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ExpandCollapseDiagramDescriptionProvider.java index f1e262cb4a..df14950f5a 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ExpandCollapseDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ExpandCollapseDiagramDescriptionProvider.java @@ -22,6 +22,7 @@ import org.eclipse.sirius.components.emf.services.IDAdapter; import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.components.view.View; +import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramBuilders; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.InsideLabelDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.NodeDescriptionBuilder; @@ -153,6 +154,8 @@ private DiagramDescription createDiagramDescription() { .nodeDescriptions(nodeDescription) .edgeDescriptions() .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription() + .build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ModelOperationDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ModelOperationDiagramDescriptionProvider.java index 421936e062..3ac3ec5970 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ModelOperationDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/ModelOperationDiagramDescriptionProvider.java @@ -23,6 +23,7 @@ import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.components.view.View; import org.eclipse.sirius.components.view.builder.generated.SelectionDialogTreeDescriptionBuilder; +import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramBuilders; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramPaletteBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.InsideLabelDescriptionBuilder; @@ -141,6 +142,7 @@ private DiagramDescription createDiagramDescription() { .edgeDescriptions() .palette(diagramPalette) .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription().build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/UnsynchronizedDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/UnsynchronizedDiagramDescriptionProvider.java index 30ee514876..23c50e73cb 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/UnsynchronizedDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/UnsynchronizedDiagramDescriptionProvider.java @@ -23,6 +23,7 @@ import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.components.view.View; import org.eclipse.sirius.components.view.builder.generated.diagram.CreateViewBuilder; +import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramBuilders; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramPaletteBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.DropToolBuilder; @@ -188,6 +189,8 @@ private DiagramDescription createDiagramDescription() { .edgeDescriptions() .palette(diagramPalette) .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription() + .build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/VisibilityDiagramDescriptionProvider.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/VisibilityDiagramDescriptionProvider.java index b18fa16bf4..9f7452ba71 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/VisibilityDiagramDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/diagrams/VisibilityDiagramDescriptionProvider.java @@ -22,6 +22,7 @@ import org.eclipse.sirius.components.emf.services.IDAdapter; import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.components.view.View; +import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramBuilders; import org.eclipse.sirius.components.view.builder.generated.diagram.DiagramDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.InsideLabelDescriptionBuilder; import org.eclipse.sirius.components.view.builder.generated.diagram.NodeDescriptionBuilder; @@ -196,6 +197,8 @@ private DiagramDescription createDiagramDescription() { .nodeDescriptions(nodeDescription) .edgeDescriptions() .autoLayout(false) + .style(new DiagramBuilders().newDiagramStyleDescription() + .build()) .build(); return this.diagramDescription; diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/migration/DiagramStyleDescriptionAddMigrationParticipantTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/migration/DiagramStyleDescriptionAddMigrationParticipantTests.java new file mode 100644 index 0000000000..8d9fc80b27 --- /dev/null +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/services/migration/DiagramStyleDescriptionAddMigrationParticipantTests.java @@ -0,0 +1,212 @@ +/******************************************************************************* + * 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.services.migration; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.jayway.jsonpath.JsonPath; + +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiFunction; +import java.util.function.Predicate; + +import org.eclipse.sirius.components.core.api.IEditingContext; +import org.eclipse.sirius.components.core.api.IEditingContextSearchService; +import org.eclipse.sirius.components.core.api.IInput; +import org.eclipse.sirius.components.core.api.IPayload; +import org.eclipse.sirius.components.emf.ResourceMetadataAdapter; +import org.eclipse.sirius.components.emf.migration.api.IMigrationParticipant; +import org.eclipse.sirius.components.emf.migration.api.MigrationData; +import org.eclipse.sirius.components.graphql.api.UploadFile; +import org.eclipse.sirius.components.graphql.tests.ExecuteEditingContextFunctionInput; +import org.eclipse.sirius.components.graphql.tests.ExecuteEditingContextFunctionRunner; +import org.eclipse.sirius.components.graphql.tests.ExecuteEditingContextFunctionSuccessPayload; +import org.eclipse.sirius.components.view.diagram.DiagramDescription; +import org.eclipse.sirius.web.AbstractIntegrationTests; +import org.eclipse.sirius.web.application.document.dto.UploadDocumentInput; +import org.eclipse.sirius.web.application.document.dto.UploadDocumentSuccessPayload; +import org.eclipse.sirius.web.application.editingcontext.EditingContext; +import org.eclipse.sirius.web.data.MigrationIdentifiers; +import org.eclipse.sirius.web.tests.graphql.UploadDocumentMutationRunner; +import org.eclipse.sirius.web.tests.services.api.IGivenCommittedTransaction; +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.test.context.transaction.TestTransaction; +import org.springframework.transaction.annotation.Transactional; + +import reactor.test.StepVerifier; + +/** + * Integration tests of DiagramStyleDescriptionAddMigrationParticipant. + * + * @author frouene + */ +@Transactional +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class DiagramStyleDescriptionAddMigrationParticipantTests extends AbstractIntegrationTests { + + @Autowired + private IEditingContextSearchService editingContextSearchService; + + @Autowired + private IGivenCommittedTransaction givenCommittedTransaction; + + @Autowired + private ExecuteEditingContextFunctionRunner executeEditingContextFunctionRunner; + + @Autowired + private UploadDocumentMutationRunner uploadDocumentMutationRunner; + + @Autowired + private List migrationParticipants; + + @Test + @DisplayName("Given a project with an old model, DiagramStyleDescriptionAddMigrationParticipant migrates the model correctly") + @Sql(scripts = { "/scripts/migration.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 givenAnOldModelMigrationParticipantCanBeContributedToUpdateTheModel() { + var optionalEditingContext = this.editingContextSearchService.findById(MigrationIdentifiers.MIGRATION_DIAGRAM_STYLE_DESCRIPTION.toString()); + assertThat(optionalEditingContext).isPresent(); + this.testIsMigrationSuccessful(optionalEditingContext.get()); + } + + @Test + @DisplayName("Given an uploaded project with an old model, DiagramStyleDescriptionAddMigrationParticipant migrates the model correctly") + @Sql(scripts = { "/scripts/migration.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 givenAnOldViewDiagramMigrationServiceIsExecutedProperly() { + var content = """ + { + "json": { "version": "1.0", "encoding": "utf-8" }, + "ns": { + "diagram": "http://www.eclipse.org/sirius-web/diagram", + "view": "http://www.eclipse.org/sirius-web/view" + }, + "content": [ + { + "id": "9674f8f7-ff1a-4061-bb32-a4a235a9c2ca", + "eClass": "view:View", + "data": { + "colorPalettes": [ + { + "data": { + "colors": [ + { + "data": { + "name": "color_empty", + "value": "" + }, + "eClass": "view:FixedColor", + "id": "63184ddc-74c4-4888-bb65-418361689e2b" + } + ] + }, + "eClass": "view:ColorPalette", + "id": "d315989f-826f-490d-b898-d94200b0caa2" + } + ], + "descriptions": [ + { + "id": "22fb1f4d-109d-4e73-bff0-f7cd96fb5fbb", + "eClass": "diagram:DiagramDescription", + "data": { + "name": "DiagramStyleDescription#migration_upload", + "domainType": "flow::System", + "nodeDescriptions": [] + } + } + ] + } + } + ] + } + """; + this.uploadDocument(MigrationIdentifiers.MIGRATION_DIAGRAM_STYLE_DESCRIPTION.toString(), content); + } + + private void uploadDocument(String editingContextId, String content) { + this.givenCommittedTransaction.commit(); + + var file = new UploadFile("test_upload", new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))); + var input = new UploadDocumentInput(UUID.randomUUID(), editingContextId, file); + var result = this.uploadDocumentMutationRunner.run(input); + + TestTransaction.flagForCommit(); + TestTransaction.end(); + + String typename = JsonPath.read(result, "$.data.uploadDocument.__typename"); + assertThat(typename).isEqualTo(UploadDocumentSuccessPayload.class.getSimpleName()); + + Predicate predicate = payload -> Optional.of(payload) + .filter(ExecuteEditingContextFunctionSuccessPayload.class::isInstance) + .map(ExecuteEditingContextFunctionSuccessPayload.class::cast) + .map(ExecuteEditingContextFunctionSuccessPayload::result) + .filter(Boolean.class::isInstance) + .map(Boolean.class::cast) + .orElse(false); + + var optionalLastMigrationData = this.migrationParticipants.stream() + .sorted(Comparator.comparing(IMigrationParticipant::getVersion).reversed()) + .map(migrationParticipant -> new MigrationData(migrationParticipant.getClass().getSimpleName(), migrationParticipant.getVersion())) + .findFirst(); + assertThat(optionalLastMigrationData).isPresent(); + var lastMigrationData = optionalLastMigrationData.get(); + + BiFunction function = (editingContext, executeEditingContextFunctionInput) -> { + var isMigrated = Optional.of(editingContext) + .filter(EditingContext.class::isInstance) + .map(EditingContext.class::cast) + .map(siriusWebEditingContext -> siriusWebEditingContext.getViews().stream() + .anyMatch(view -> view.eResource().eAdapters().stream() + .filter(ResourceMetadataAdapter.class::isInstance) + .map(ResourceMetadataAdapter.class::cast) + .filter(resourceMetadataAdapter -> resourceMetadataAdapter.getMigrationData() != null) + .anyMatch(resourceMetadataAdapter -> resourceMetadataAdapter.getMigrationData().migrationVersion().equals(lastMigrationData.migrationVersion()) + && resourceMetadataAdapter.getMigrationData().lastMigrationPerformed().equals(lastMigrationData.lastMigrationPerformed())) + )) + .orElse(false); + return new ExecuteEditingContextFunctionSuccessPayload(executeEditingContextFunctionInput.id(), isMigrated); + }; + + var mono = this.executeEditingContextFunctionRunner.execute(new ExecuteEditingContextFunctionInput(UUID.randomUUID(), editingContextId, function)); + StepVerifier.create(mono) + .expectNextMatches(predicate) + .thenCancel() + .verify(); + } + + private void testIsMigrationSuccessful(IEditingContext editingContext) { + if (editingContext instanceof EditingContext siriusWebEditingContext) { + var optionalDiagramDescription = siriusWebEditingContext.getViews().stream().flatMap(view -> view.getDescriptions().stream()) + .filter(representationDescription -> representationDescription.getName().equals(MigrationIdentifiers.MIGRATION_NODE_STYLE_DESCRIPTION_COLOR_STUDIO_DIAGRAM)).findFirst(); + assertThat(optionalDiagramDescription).isPresent(); + assertThat(optionalDiagramDescription.get()).isInstanceOf(DiagramDescription.class); + optionalDiagramDescription.ifPresent(representationDescription -> { + if (representationDescription instanceof DiagramDescription diagramDescription) { + assertThat(diagramDescription.getStyle()).isNotNull(); + } + }); + } + } + + +} diff --git a/packages/sirius-web/backend/sirius-web/src/test/resources/scripts/studio.sql b/packages/sirius-web/backend/sirius-web/src/test/resources/scripts/studio.sql index fccc9fff9e..63506c40b8 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/resources/scripts/studio.sql +++ b/packages/sirius-web/backend/sirius-web/src/test/resources/scripts/studio.sql @@ -389,7 +389,30 @@ INSERT INTO document ( "data":{ "name":"Root Diagram", "domainType":"buck::Root", - "nodeDescriptions":[ + "conditionalStyles": [ + { + "data": { + "condition": "aql:self.eAllContents()->size()>2", + "style": { + "data": { + "background": "//@colorPalettes.0/@colors.0" + }, + "eClass": "diagram:DiagramStyleDescription", + "id": "7994fbc6-2600-41f9-b409-a1ba104a01d3" + } + }, + "eClass": "diagram:ConditionalDiagramStyle", + "id": "6d3674d2-c51f-4317-8b2b-b4395246ab9f" + } + ], + "style": { + "data": { + "background": "//@colorPalettes.0/@colors.1" + }, + "eClass": "diagram:DiagramStyleDescription", + "id": "82dd8017-a782-4d48-8926-019c1a88db53" + }, + "nodeDescriptions":[ { "id":"e91e6e23-1440-4fbf-b31c-3a21bf25d85b", "eClass":"diagram:NodeDescription", @@ -589,19 +612,6 @@ INSERT INTO project_image ( '2024-01-02 9:42:0.000' ); -/******************************************************************************* - * 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 - *******************************************************************************/ - -- Studio instance project INSERT INTO project ( id, diff --git a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyUnsynchronizedViewDiagramDescriptionProvider.java b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyUnsynchronizedViewDiagramDescriptionProvider.java index 6de449dd7f..b9fdeb8780 100644 --- a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyUnsynchronizedViewDiagramDescriptionProvider.java +++ b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyUnsynchronizedViewDiagramDescriptionProvider.java @@ -52,7 +52,9 @@ public RepresentationDescription create(IColorProvider colorProvider) { .autoLayout(false) .domainType("flow::System") .name("Topography unsynchronized") - .titleExpression("Topography unsynchronized").build(); + .titleExpression("Topography unsynchronized") + .style(this.diagramBuilderHelper.newDiagramStyleDescription().build()) + .build(); var cache = new ViewDiagramElementFinder(); diff --git a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyViewDiagramDescriptionProvider.java b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyViewDiagramDescriptionProvider.java index 7e6a64c28a..a2d1688810 100644 --- a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyViewDiagramDescriptionProvider.java +++ b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyViewDiagramDescriptionProvider.java @@ -51,7 +51,9 @@ public RepresentationDescription create(IColorProvider colorProvider) { .autoLayout(false) .domainType("flow::System") .name("Topography") - .titleExpression("Topography").build(); + .titleExpression("Topography") + .style(this.diagramBuilderHelper.newDiagramStyleDescription().build()) + .build(); var cache = new ViewDiagramElementFinder(); diff --git a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyWithAutoLayoutViewDiagramDescriptionProvider.java b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyWithAutoLayoutViewDiagramDescriptionProvider.java index 381587c2be..cbec584f3f 100644 --- a/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyWithAutoLayoutViewDiagramDescriptionProvider.java +++ b/packages/starters/backend/sirius-components-flow-starter/src/main/java/org/eclipse/sirius/components/flow/starter/view/FlowTopographyWithAutoLayoutViewDiagramDescriptionProvider.java @@ -51,7 +51,9 @@ public RepresentationDescription create(IColorProvider colorProvider) { .autoLayout(true) .domainType("flow::System") .name("Topography with auto layout") - .titleExpression("Topography with auto layout").build(); + .titleExpression("Topography with auto layout") + .style(this.diagramBuilderHelper.newDiagramStyleDescription().build()) + .build(); var cache = new ViewDiagramElementFinder(); diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalDiagramStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalDiagramStyleBuilder.java new file mode 100644 index 0000000000..5754844cfd --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalDiagramStyleBuilder.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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.builder.generated; + +/** + * Builder for ConditionalDiagramStyleBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class ConditionalDiagramStyleBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle. + * @generated + */ + private org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle conditionalDiagramStyle = org.eclipse.sirius.components.view.diagram.DiagramFactory.eINSTANCE.createConditionalDiagramStyle(); + + /** + * Return instance org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle. + * @generated + */ + protected org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle getConditionalDiagramStyle() { + return this.conditionalDiagramStyle; + } + + /** + * Return instance org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle. + * @generated + */ + public org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle build() { + return this.getConditionalDiagramStyle(); + } + + /** + * Setter for Condition. + * + * @generated + */ + public ConditionalDiagramStyleBuilder condition(java.lang.String value) { + this.getConditionalDiagramStyle().setCondition(value); + return this; + } + /** + * Setter for Style. + * + * @generated + */ + public ConditionalDiagramStyleBuilder style(org.eclipse.sirius.components.view.diagram.DiagramStyleDescription value) { + this.getConditionalDiagramStyle().setStyle(value); + return this; + } + +} + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DiagramStyleDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DiagramStyleDescriptionBuilder.java new file mode 100644 index 0000000000..6a7ba30713 --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DiagramStyleDescriptionBuilder.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * 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.builder.generated; + +/** + * Builder for DiagramStyleDescriptionBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class DiagramStyleDescriptionBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.diagram.DiagramStyleDescription. + * @generated + */ + private org.eclipse.sirius.components.view.diagram.DiagramStyleDescription diagramStyleDescription = org.eclipse.sirius.components.view.diagram.DiagramFactory.eINSTANCE.createDiagramStyleDescription(); + + /** + * Return instance org.eclipse.sirius.components.view.diagram.DiagramStyleDescription. + * @generated + */ + protected org.eclipse.sirius.components.view.diagram.DiagramStyleDescription getDiagramStyleDescription() { + return this.diagramStyleDescription; + } + + /** + * Return instance org.eclipse.sirius.components.view.diagram.DiagramStyleDescription. + * @generated + */ + public org.eclipse.sirius.components.view.diagram.DiagramStyleDescription build() { + return this.getDiagramStyleDescription(); + } + + /** + * Setter for Background. + * + * @generated + */ + public DiagramStyleDescriptionBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getDiagramStyleDescription().setBackground(value); + return this; + } + +} + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/ConditionalDiagramStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/ConditionalDiagramStyleBuilder.java new file mode 100644 index 0000000000..cb5f95022f --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/ConditionalDiagramStyleBuilder.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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 + * 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.builder.generated.diagram; + +/** + * Builder for ConditionalDiagramStyleBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class ConditionalDiagramStyleBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle. + * @generated + */ + private org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle conditionalDiagramStyle = org.eclipse.sirius.components.view.diagram.DiagramFactory.eINSTANCE.createConditionalDiagramStyle(); + + /** + * Return instance org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle. + * @generated + */ + protected org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle getConditionalDiagramStyle() { + return this.conditionalDiagramStyle; + } + + /** + * Return instance org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle. + * @generated + */ + public org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle build() { + return this.getConditionalDiagramStyle(); + } + + /** + * Setter for Condition. + * + * @generated + */ + public ConditionalDiagramStyleBuilder condition(java.lang.String value) { + this.getConditionalDiagramStyle().setCondition(value); + return this; + } + /** + * Setter for Style. + * + * @generated + */ + public ConditionalDiagramStyleBuilder style(org.eclipse.sirius.components.view.diagram.DiagramStyleDescription value) { + this.getConditionalDiagramStyle().setStyle(value); + return this; + } + +} + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramBuilders.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramBuilders.java index f752ea8496..4b77f95d53 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramBuilders.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramBuilders.java @@ -21,6 +21,7 @@ * @generated */ public class DiagramBuilders { + /** * Instantiate a DiagramDescriptionBuilder . * @@ -112,15 +113,45 @@ public OutsideLabelStyleBuilder newOutsideLabelStyle() { } /** - * Instantiate a ConditionalNodeStyleBuilder . + * Instantiate a DiagramStyleDescriptionBuilder . + * + * @author BuilderGenerator + * @generated + */ + public DiagramStyleDescriptionBuilder newDiagramStyleDescription() { + return new DiagramStyleDescriptionBuilder(); + } + + /** + * Instantiate a DiagramStyleDescriptionBuilder . * * @author BuilderGenerator + * @generated /** + * Instantiate a ConditionalNodeStyleBuilder . + * @author BuilderGenerator * @generated */ public ConditionalNodeStyleBuilder newConditionalNodeStyle() { return new ConditionalNodeStyleBuilder(); } + /** + * Instantiate a ConditionalDiagramStyleBuilder . + * + * @author BuilderGenerator + * @generated + */ + public ConditionalDiagramStyleBuilder newConditionalDiagramStyle() { + return new ConditionalDiagramStyleBuilder(); + } + + /** + * Instantiate a ConditionalDiagramStyleBuilder . + * + * @author BuilderGenerator + * @generated + */ + /** * Instantiate a ConditionalInsideLabelStyleBuilder . * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramDescriptionBuilder.java index b19c02ca49..1e82790997 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramDescriptionBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramDescriptionBuilder.java @@ -130,5 +130,28 @@ public DiagramDescriptionBuilder arrangeLayoutDirection(org.eclipse.sirius.compo return this; } + /** + * Setter for Style. + * + * @generated + */ + public DiagramDescriptionBuilder style(org.eclipse.sirius.components.view.diagram.DiagramStyleDescription value) { + this.getDiagramDescription().setStyle(value); + return this; + } + + /** + * Setter for ConditionalStyles. + * + * @generated + */ + public DiagramDescriptionBuilder conditionalStyles(org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle ... values) { + for (org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle value : values) { + this.getDiagramDescription().getConditionalStyles().add(value); + } + return this; + } + + } diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramStyleDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramStyleDescriptionBuilder.java new file mode 100644 index 0000000000..a0c9c45610 --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/diagram/DiagramStyleDescriptionBuilder.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * 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 + * 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.builder.generated.diagram; + +/** + * Builder for DiagramStyleDescriptionBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class DiagramStyleDescriptionBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.diagram.DiagramStyleDescription. + * @generated + */ + private org.eclipse.sirius.components.view.diagram.DiagramStyleDescription diagramStyleDescription = org.eclipse.sirius.components.view.diagram.DiagramFactory.eINSTANCE.createDiagramStyleDescription(); + + /** + * Return instance org.eclipse.sirius.components.view.diagram.DiagramStyleDescription. + * @generated + */ + protected org.eclipse.sirius.components.view.diagram.DiagramStyleDescription getDiagramStyleDescription() { + return this.diagramStyleDescription; + } + + /** + * Return instance org.eclipse.sirius.components.view.diagram.DiagramStyleDescription. + * @generated + */ + public org.eclipse.sirius.components.view.diagram.DiagramStyleDescription build() { + return this.getDiagramStyleDescription(); + } + + /** + * Setter for Background. + * + * @generated + */ + public DiagramStyleDescriptionBuilder background(org.eclipse.sirius.components.view.UserColor value) { + this.getDiagramStyleDescription().setBackground(value); + return this; + } + +} + diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalDiagramStyleItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalDiagramStyleItemProvider.java new file mode 100644 index 0000000000..3ec7c3653b --- /dev/null +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/ConditionalDiagramStyleItemProvider.java @@ -0,0 +1,152 @@ +/******************************************************************************* + * 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.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; +import org.eclipse.sirius.components.view.diagram.DiagramFactory; +import org.eclipse.sirius.components.view.diagram.DiagramPackage; +import org.eclipse.sirius.components.view.provider.ConditionalItemProvider; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle} + * object. + * + * @generated + */ +public class ConditionalDiagramStyleItemProvider extends ConditionalItemProvider { + + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public ConditionalDiagramStyleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (this.itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return this.itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (this.childrenFeatures == null) { + super.getChildrenFeatures(object); + this.childrenFeatures.add(DiagramPackage.Literals.CONDITIONAL_DIAGRAM_STYLE__STYLE); + } + return this.childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns ConditionalDiagramStyle.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/ConditionalStyle.svg")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((ConditionalDiagramStyle) object).getCondition(); + return label == null || label.length() == 0 ? this.getString("_UI_ConditionalDiagramStyle_type") : this.getString("_UI_ConditionalDiagramStyle_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + this.updateChildren(notification); + + switch (notification.getFeatureID(ConditionalDiagramStyle.class)) { + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(this.createChildParameter(DiagramPackage.Literals.CONDITIONAL_DIAGRAM_STYLE__STYLE, DiagramFactory.eINSTANCE.createDiagramStyleDescription())); + } + +} diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramDescriptionItemProvider.java index 472d92b507..8084f86796 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramDescriptionItemProvider.java @@ -22,6 +22,7 @@ import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.DiagramDescription; import org.eclipse.sirius.components.view.diagram.DiagramFactory; import org.eclipse.sirius.components.view.diagram.DiagramPackage; @@ -103,6 +104,8 @@ public Collection getChildrenFeatures(Object objec this.childrenFeatures.add(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__PALETTE); this.childrenFeatures.add(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__NODE_DESCRIPTIONS); this.childrenFeatures.add(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__EDGE_DESCRIPTIONS); + this.childrenFeatures.add(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__STYLE); + this.childrenFeatures.add(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES); } return this.childrenFeatures; } @@ -170,6 +173,8 @@ public void notifyChanged(Notification notification) { case DiagramPackage.DIAGRAM_DESCRIPTION__PALETTE: case DiagramPackage.DIAGRAM_DESCRIPTION__NODE_DESCRIPTIONS: case DiagramPackage.DIAGRAM_DESCRIPTION__EDGE_DESCRIPTIONS: + case DiagramPackage.DIAGRAM_DESCRIPTION__STYLE: + case DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -203,6 +208,12 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors edgeChild.setStyle(newEdgeStyle); edgeChild.setPalette(defaultToolsFactory.createDefaultEdgePalette()); newChildDescriptors.add(this.createChildParameter(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__EDGE_DESCRIPTIONS, edgeChild)); + + newChildDescriptors.add(this.createChildParameter(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__STYLE, DiagramFactory.eINSTANCE.createDiagramStyleDescription())); + + ConditionalDiagramStyle conditionalDiagramStyle = DiagramFactory.eINSTANCE.createConditionalDiagramStyle(); + conditionalDiagramStyle.setStyle(DiagramFactory.eINSTANCE.createDiagramStyleDescription()); + newChildDescriptors.add(this.createChildParameter(DiagramPackage.Literals.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES, conditionalDiagramStyle)); } } diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramEditPlugin.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramEditPlugin.java index 56573085c8..a4aa9849d4 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramEditPlugin.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramEditPlugin.java @@ -26,6 +26,7 @@ * @generated */ public final class DiagramEditPlugin extends EMFPlugin { + /** * Keep track of the singleton. * @@ -82,7 +83,7 @@ protected Object doGetImage(String key) throws IOException { * Computes the file extension to be used with the key to specify an image resource. * * @param key - * the key for the imagine. + * the key for the imagine. * @return the file extension to be used with the key to specify an image resource. */ protected static String extensionFor(String key) { @@ -90,15 +91,8 @@ protected static String extensionFor(String key) { int index = key.lastIndexOf('.'); if (index != -1) { String extension = key.substring(index + 1); - if ("png".equalsIgnoreCase(extension) - || "gif".equalsIgnoreCase(extension) - || "bmp".equalsIgnoreCase(extension) - || "ico".equalsIgnoreCase(extension) - || "jpg".equalsIgnoreCase(extension) - || "jpeg".equalsIgnoreCase(extension) - || "tif".equalsIgnoreCase(extension) - || "tiff".equalsIgnoreCase(extension) - || "svg".equalsIgnoreCase(extension)) { + if ("png".equalsIgnoreCase(extension) || "gif".equalsIgnoreCase(extension) || "bmp".equalsIgnoreCase(extension) || "ico".equalsIgnoreCase(extension) || "jpg".equalsIgnoreCase(extension) + || "jpeg".equalsIgnoreCase(extension) || "tif".equalsIgnoreCase(extension) || "tiff".equalsIgnoreCase(extension) || "svg".equalsIgnoreCase(extension)) { result = ""; } } @@ -111,6 +105,7 @@ protected static String extensionFor(String key) { * @generated */ public static class Implementation extends EclipsePlugin { + /** * Creates an instance. * diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramItemProviderAdapterFactory.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramItemProviderAdapterFactory.java index 677d56dceb..6131366a9d 100644 --- a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramItemProviderAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramItemProviderAdapterFactory.java @@ -372,6 +372,24 @@ public class DiagramItemProviderAdapterFactory extends DiagramAdapterFactory imp */ protected DropNodeToolItemProvider dropNodeToolItemProvider; + /** + * This keeps track of the one adapter used for all + * {@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription} instances. + * + * + * @generated + */ + protected DiagramStyleDescriptionItemProvider diagramStyleDescriptionItemProvider; + + /** + * This keeps track of the one adapter used for all + * {@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle} instances. + * + * + * @generated + */ + protected ConditionalDiagramStyleItemProvider conditionalDiagramStyleItemProvider; + /** * This constructs an instance. * @@ -521,6 +539,21 @@ public Adapter createOutsideLabelStyleAdapter() { return this.outsideLabelStyleItemProvider; } + /** + * This creates an adapter for a {@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription}. + * + * @generated + */ + @Override + public Adapter createDiagramStyleDescriptionAdapter() { + if (this.diagramStyleDescriptionItemProvider == null) { + this.diagramStyleDescriptionItemProvider = new DiagramStyleDescriptionItemProvider(this); + } + + return this.diagramStyleDescriptionItemProvider; + } + /** * This creates an adapter for a {@link org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle}. @@ -536,6 +569,21 @@ public Adapter createConditionalNodeStyleAdapter() { return this.conditionalNodeStyleItemProvider; } + /** + * This creates an adapter for a {@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle}. + * + * @generated + */ + @Override + public Adapter createConditionalDiagramStyleAdapter() { + if (this.conditionalDiagramStyleItemProvider == null) { + this.conditionalDiagramStyleItemProvider = new ConditionalDiagramStyleItemProvider(this); + } + + return this.conditionalDiagramStyleItemProvider; + } + /** * This creates an adapter for a {@link org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle}. * @@ -1076,8 +1124,12 @@ public void dispose() { this.insideLabelStyleItemProvider.dispose(); if (this.outsideLabelStyleItemProvider != null) this.outsideLabelStyleItemProvider.dispose(); + if (this.diagramStyleDescriptionItemProvider != null) + this.diagramStyleDescriptionItemProvider.dispose(); if (this.conditionalNodeStyleItemProvider != null) this.conditionalNodeStyleItemProvider.dispose(); + if (this.conditionalDiagramStyleItemProvider != null) + this.conditionalDiagramStyleItemProvider.dispose(); if (this.conditionalInsideLabelStyleItemProvider != null) this.conditionalInsideLabelStyleItemProvider.dispose(); if (this.conditionalOutsideLabelStyleItemProvider != null) @@ -1202,6 +1254,7 @@ public Object caseView(View object) { DiagramDescription newDiagramDescription = DiagramFactory.eINSTANCE.createDiagramDescription(); newDiagramDescription.setName("New Diagram Description"); newDiagramDescription.setPalette(new DefaultToolsFactory().createDefaultDiagramPalette()); + newDiagramDescription.setStyle(DiagramFactory.eINSTANCE.createDiagramStyleDescription()); this.newChildDescriptors.add(this.createChildParameter(ViewPackage.Literals.VIEW__DESCRIPTIONS, newDiagramDescription)); return null; diff --git a/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramStyleDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramStyleDescriptionItemProvider.java new file mode 100644 index 0000000000..90ae6af5f9 --- /dev/null +++ b/packages/view/backend/sirius-components-view-diagram-edit/src/main/java/org/eclipse/sirius/components/view/diagram/provider/DiagramStyleDescriptionItemProvider.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * 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.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IChildCreationExtender; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.sirius.components.view.diagram.DiagramPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription} + * object. + * + * @generated + */ +public class DiagramStyleDescriptionItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public DiagramStyleDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (this.itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + this.addBackgroundPropertyDescriptor(object); + } + return this.itemPropertyDescriptors; + } + + /** + * 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_DiagramStyleDescription_background_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_DiagramStyleDescription_background_feature", "_UI_DiagramStyleDescription_type"), + DiagramPackage.Literals.DIAGRAM_STYLE_DESCRIPTION__BACKGROUND, true, false, true, null, null, null)); + } + + /** + * This returns DiagramStyleDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/Style.svg")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + return this.getString("_UI_DiagramStyleDescription_type"); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + this.updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender) this.adapterFactory).getResourceLocator(); + } + +} 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 fef5f46504..ee6af14d37 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 @@ -38,7 +38,9 @@ _UI_InsideLabelStyle_type=Inside Label Style _UI_OutsideLabelStyle_type=Outside Label Style _UI_NodeLabelStyle_type=Node Label Style _UI_NodeStyleDescription_type=Node Style Description +_UI_DiagramStyleDescription_type=Style Description _UI_ConditionalNodeStyle_type=Conditional Node Style +_UI_ConditionalDiagramStyle_type=Conditional Diagram Style _UI_ConditionalInsideLabelStyle_type=Conditional Inside Label Style _UI_ConditionalOutsideLabelStyle_type=Conditional Outside Label Style _UI_RectangularNodeStyleDescription_type=Rectangular Node Style Description @@ -66,8 +68,8 @@ _UI_DiagramToolSection_type=Diagram Tool Section _UI_NodeToolSection_type=Node Tool Section _UI_EdgeToolSection_type=Edge Tool Section _UI_DropNodeTool_type=Drop Node Tool -_UI_DialogDescription_type = Dialog Description -_UI_SelectionDialogTreeDescription_type = Selection Dialog Tree Description +_UI_DialogDescription_type=Dialog Description +_UI_SelectionDialogTreeDescription_type=Selection Dialog Tree Description _UI_Unknown_type=Object _UI_Unknown_datatype=Value @@ -76,6 +78,8 @@ _UI_DiagramDescription_palette_feature=Palette _UI_DiagramDescription_nodeDescriptions_feature=Node Descriptions _UI_DiagramDescription_edgeDescriptions_feature=Edge Descriptions _UI_DiagramDescription_arrangeLayoutDirection_feature=Arrange Layout Direction +_UI_DiagramDescription_style_feature=Style +_UI_DiagramDescription_conditionalStyles_feature=Conditional Styles _UI_DiagramElementDescription_name_feature=Name _UI_DiagramElementDescription_domainType_feature=Domain Type _UI_DiagramElementDescription_semanticCandidatesExpression_feature=Semantic Candidates Expression @@ -135,7 +139,9 @@ _UI_NodeLabelStyle_background_feature=Background _UI_NodeLabelStyle_showIconExpression_feature=Show Icon Expression _UI_NodeLabelStyle_labelIcon_feature=Label Icon _UI_NodeLabelStyle_maxWidthExpression_feature=Max Width Expression +_UI_DiagramStyleDescription_background_feature=Background _UI_ConditionalNodeStyle_style_feature=Style +_UI_ConditionalDiagramStyle_style_feature=Style _UI_ConditionalInsideLabelStyle_style_feature=Style _UI_ConditionalOutsideLabelStyle_style_feature=Style _UI_RectangularNodeStyleDescription_background_feature=Background @@ -181,17 +187,17 @@ _UI_CreateView_semanticElementExpression_feature=Semantic Element Expression _UI_CreateView_variableName_feature=Variable Name _UI_CreateView_containmentKind_feature=Containment Kind _UI_DeleteView_viewExpression_feature=View Expression -_UI_SelectionDialogDescription_selectionMessage_feature = Selection Message -_UI_SelectionDialogDescription_selectionDialogTreeDescription_feature = Selection Dialog Tree Description +_UI_SelectionDialogDescription_selectionMessage_feature=Selection Message +_UI_SelectionDialogDescription_selectionDialogTreeDescription_feature=Selection Dialog Tree Description _UI_ToolSection_name_feature=Name _UI_DiagramToolSection_nodeTools_feature=Node Tools _UI_NodeToolSection_nodeTools_feature=Node Tools _UI_NodeToolSection_edgeTools_feature=Edge Tools _UI_EdgeToolSection_nodeTools_feature=Node Tools _UI_DropNodeTool_acceptedNodeTypes_feature=Accepted Node Types -_UI_SelectionDialogTreeDescription_elementsExpression_feature = Elements Expression -_UI_SelectionDialogTreeDescription_childrenExpression_feature = Children Expression -_UI_SelectionDialogTreeDescription_isSelectableExpression_feature = Is Selectable Expression +_UI_SelectionDialogTreeDescription_elementsExpression_feature=Elements Expression +_UI_SelectionDialogTreeDescription_childrenExpression_feature=Children Expression +_UI_SelectionDialogTreeDescription_isSelectableExpression_feature=Is Selectable Expression _UI_Unknown_feature=Unspecified _UI_ArrowStyle_None_literal=None diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/ConditionalDiagramStyle.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/ConditionalDiagramStyle.java new file mode 100644 index 0000000000..8ccef112d6 --- /dev/null +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/ConditionalDiagramStyle.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * 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; + +import org.eclipse.sirius.components.view.Conditional; + +/** + * A representation of the model object 'Conditional Diagram Style'. + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle#getStyle Style}
  • + *
+ * + * @model + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getConditionalDiagramStyle() + */ +public interface ConditionalDiagramStyle extends Conditional { + + /** + * Returns the value of the 'Style' containment reference. + * + * @return the value of the 'Style' containment reference. + * @model containment="true" + * @generated + * @see #setStyle(DiagramStyleDescription) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getConditionalDiagramStyle_Style() + */ + DiagramStyleDescription getStyle(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle#getStyle + * Style}' containment reference. + * + * @param value + * the new value of the 'Style' containment reference. + * @generated + * @see #getStyle() + */ + void setStyle(DiagramStyleDescription value); + +} // ConditionalDiagramStyle diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramDescription.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramDescription.java index 1977cf3937..92ad9aad72 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramDescription.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramDescription.java @@ -30,11 +30,14 @@ * Descriptions} *
  • {@link org.eclipse.sirius.components.view.diagram.DiagramDescription#getArrangeLayoutDirection Arrange Layout * Direction}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.DiagramDescription#getStyle Style}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.DiagramDescription#getConditionalStyles Conditional + * Styles}
  • * * - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription() * @model * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription() */ public interface DiagramDescription extends RepresentationDescription { @@ -42,10 +45,10 @@ public interface DiagramDescription extends RepresentationDescription { * Returns the value of the 'Auto Layout' attribute. * * @return the value of the 'Auto Layout' attribute. - * @see #setAutoLayout(boolean) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_AutoLayout() * @model required="true" * @generated + * @see #setAutoLayout(boolean) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_AutoLayout() */ boolean isAutoLayout(); @@ -54,9 +57,9 @@ public interface DiagramDescription extends RepresentationDescription { * Layout}' attribute. * * @param value - * the new value of the 'Auto Layout' attribute. - * @see #isAutoLayout() + * the new value of the 'Auto Layout' attribute. * @generated + * @see #isAutoLayout() */ void setAutoLayout(boolean value); @@ -65,10 +68,10 @@ public interface DiagramDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Palette' containment reference. - * @see #setPalette(DiagramPalette) - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_Palette() * @model containment="true" * @generated + * @see #setPalette(DiagramPalette) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_Palette() */ DiagramPalette getPalette(); @@ -77,9 +80,9 @@ public interface DiagramDescription extends RepresentationDescription { * Palette}' containment reference. * * @param value - * the new value of the 'Palette' containment reference. - * @see #getPalette() + * the new value of the 'Palette' containment reference. * @generated + * @see #getPalette() */ void setPalette(DiagramPalette value); @@ -89,9 +92,9 @@ public interface DiagramDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Node Descriptions' containment reference list. - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_NodeDescriptions() * @model containment="true" keys="name" * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_NodeDescriptions() */ EList getNodeDescriptions(); @@ -101,9 +104,9 @@ public interface DiagramDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Edge Descriptions' containment reference list. - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_EdgeDescriptions() * @model containment="true" keys="name" * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_EdgeDescriptions() */ EList getEdgeDescriptions(); @@ -114,11 +117,11 @@ public interface DiagramDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Arrange Layout Direction' attribute. + * @model default="UNDEFINED" required="true" + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection * @see #setArrangeLayoutDirection(ArrangeLayoutDirection) * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_ArrangeLayoutDirection() - * @model default="UNDEFINED" required="true" - * @generated */ ArrangeLayoutDirection getArrangeLayoutDirection(); @@ -128,11 +131,46 @@ public interface DiagramDescription extends RepresentationDescription { * Layout Direction}' attribute. * * @param value - * the new value of the 'Arrange Layout Direction' attribute. + * the new value of the 'Arrange Layout Direction' attribute. + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection * @see #getArrangeLayoutDirection() - * @generated */ void setArrangeLayoutDirection(ArrangeLayoutDirection value); + /** + * Returns the value of the 'Style' containment reference. + * + * @return the value of the 'Style' containment reference. + * @model containment="true" + * @generated + * @see #setStyle(DiagramStyleDescription) + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_Style() + */ + DiagramStyleDescription getStyle(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.diagram.DiagramDescription#getStyle + * Style}' containment reference. + * + * @param value + * the new value of the 'Style' containment reference. + * @generated + * @see #getStyle() + */ + void setStyle(DiagramStyleDescription value); + + /** + * Returns the value of the 'Conditional Styles' containment reference list. The list contents are + * of type {@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle}. + * + * @return the value of the 'Conditional Styles' containment reference list. + * @model containment="true" + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramDescription_ConditionalStyles() + */ + EList getConditionalStyles(); + } // DiagramDescription diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramFactory.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramFactory.java index 709bc130e3..ae7a229558 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramFactory.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramFactory.java @@ -18,8 +18,8 @@ * The Factory for the model. It provides a create method for each non-abstract class of * the model. * - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage */ public interface DiagramFactory extends EFactory { @@ -104,6 +104,14 @@ public interface DiagramFactory extends EFactory { */ OutsideLabelStyle createOutsideLabelStyle(); + /** + * Returns a new object of class 'Style Description'. + * + * @return a new object of class 'Style Description'. + * @generated + */ + DiagramStyleDescription createDiagramStyleDescription(); + /** * Returns a new object of class 'Conditional Node Style'. * @@ -112,6 +120,14 @@ public interface DiagramFactory extends EFactory { */ ConditionalNodeStyle createConditionalNodeStyle(); + /** + * Returns a new object of class 'Conditional Diagram Style'. + * + * @return a new object of class 'Conditional Diagram Style'. + * @generated + */ + ConditionalDiagramStyle createConditionalDiagramStyle(); + /** * Returns a new object of class 'Conditional Inside Label Style'. 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 dbeb0e36b9..6a934d854c 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 @@ -30,9 +30,9 @@ * * * - * @see org.eclipse.sirius.components.view.diagram.DiagramFactory * @model kind="package" * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramFactory */ public interface DiagramPackage extends EPackage { @@ -61,9 +61,9 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramDescription() - * @generated */ int DIAGRAM_DESCRIPTION = 0; @@ -107,7 +107,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DIAGRAM_DESCRIPTION__AUTO_LAYOUT = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 0; + int DIAGRAM_DESCRIPTION__AUTO_LAYOUT = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT; /** * The feature id for the 'Palette' containment reference. + * + * @generated + * @ordered + */ + int DIAGRAM_DESCRIPTION__STYLE = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Conditional Styles' containment reference list. + * + * + * @generated + * @ordered + */ + int DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 6; + /** * The number of structural features of the 'Description' class. @@ -152,7 +170,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DIAGRAM_DESCRIPTION_FEATURE_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 5; + int DIAGRAM_DESCRIPTION_FEATURE_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 7; /** * The number of operations of the 'Description' class. @@ -160,15 +178,15 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DIAGRAM_DESCRIPTION_OPERATION_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_OPERATION_COUNT + 0; + int DIAGRAM_DESCRIPTION_OPERATION_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramElementDescriptionImpl * Element Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramElementDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramElementDescription() - * @generated */ int DIAGRAM_ELEMENT_DESCRIPTION = 1; @@ -237,9 +255,9 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodeDescriptionImpl Node * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodeDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeDescription() - * @generated */ int NODE_DESCRIPTION = 2; @@ -292,7 +310,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int NODE_DESCRIPTION__COLLAPSIBLE = DIAGRAM_ELEMENT_DESCRIPTION_FEATURE_COUNT + 0; + int NODE_DESCRIPTION__COLLAPSIBLE = DIAGRAM_ELEMENT_DESCRIPTION_FEATURE_COUNT; /** * The feature id for the 'Palette' containment reference. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeDescription() - * @generated */ int EDGE_DESCRIPTION = 3; @@ -523,7 +541,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_DESCRIPTION__BEGIN_LABEL_EXPRESSION = DIAGRAM_ELEMENT_DESCRIPTION_FEATURE_COUNT + 0; + int EDGE_DESCRIPTION__BEGIN_LABEL_EXPRESSION = DIAGRAM_ELEMENT_DESCRIPTION_FEATURE_COUNT; /** * The feature id for the 'Center Label Expression' attribute. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLayoutStrategyDescription() - * @generated */ int LAYOUT_STRATEGY_DESCRIPTION = 4; @@ -665,9 +683,9 @@ public interface DiagramPackage extends EPackage { * '{@link org.eclipse.sirius.components.view.diagram.impl.ListLayoutStrategyDescriptionImpl List Layout * Strategy Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ListLayoutStrategyDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getListLayoutStrategyDescription() - * @generated */ int LIST_LAYOUT_STRATEGY_DESCRIPTION = 5; @@ -678,7 +696,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int LIST_LAYOUT_STRATEGY_DESCRIPTION__ARE_CHILD_NODES_DRAGGABLE_EXPRESSION = LAYOUT_STRATEGY_DESCRIPTION_FEATURE_COUNT + 0; + int LIST_LAYOUT_STRATEGY_DESCRIPTION__ARE_CHILD_NODES_DRAGGABLE_EXPRESSION = LAYOUT_STRATEGY_DESCRIPTION_FEATURE_COUNT; /** * The feature id for the 'Top Gap Expression' attribute. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.FreeFormLayoutStrategyDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getFreeFormLayoutStrategyDescription() - * @generated */ int FREE_FORM_LAYOUT_STRATEGY_DESCRIPTION = 6; @@ -743,7 +761,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int FREE_FORM_LAYOUT_STRATEGY_DESCRIPTION_FEATURE_COUNT = LAYOUT_STRATEGY_DESCRIPTION_FEATURE_COUNT + 0; + int FREE_FORM_LAYOUT_STRATEGY_DESCRIPTION_FEATURE_COUNT = LAYOUT_STRATEGY_DESCRIPTION_FEATURE_COUNT; /** * The number of operations of the 'Free Form Layout Strategy Description' class. @@ -752,15 +770,15 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int FREE_FORM_LAYOUT_STRATEGY_DESCRIPTION_OPERATION_COUNT = LAYOUT_STRATEGY_DESCRIPTION_OPERATION_COUNT + 0; + int FREE_FORM_LAYOUT_STRATEGY_DESCRIPTION_OPERATION_COUNT = LAYOUT_STRATEGY_DESCRIPTION_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.LabelDescriptionImpl Label * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.LabelDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelDescription() - * @generated */ int LABEL_DESCRIPTION = 7; @@ -811,9 +829,9 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.InsideLabelDescriptionImpl * Inside Label Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.InsideLabelDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getInsideLabelDescription() - * @generated */ int INSIDE_LABEL_DESCRIPTION = 8; @@ -849,7 +867,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int INSIDE_LABEL_DESCRIPTION__POSITION = LABEL_DESCRIPTION_FEATURE_COUNT + 0; + int INSIDE_LABEL_DESCRIPTION__POSITION = LABEL_DESCRIPTION_FEATURE_COUNT; /** * The feature id for the 'Style' containment reference. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.OutsideLabelDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getOutsideLabelDescription() - * @generated */ int OUTSIDE_LABEL_DESCRIPTION = 9; @@ -929,7 +947,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int OUTSIDE_LABEL_DESCRIPTION__POSITION = LABEL_DESCRIPTION_FEATURE_COUNT + 0; + int OUTSIDE_LABEL_DESCRIPTION__POSITION = LABEL_DESCRIPTION_FEATURE_COUNT; /** * The feature id for the 'Style' containment reference. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.StyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getStyle() - * @generated */ int STYLE = 10; @@ -1005,9 +1023,9 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.BorderStyle Border Style}' * class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.BorderStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getBorderStyle() - * @generated */ int BORDER_STYLE = 11; @@ -1065,9 +1083,9 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.NodeLabelStyle Node Label * Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeLabelStyle() - * @generated */ int NODE_LABEL_STYLE = 14; @@ -1117,7 +1135,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int NODE_LABEL_STYLE__BORDER_COLOR = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 0; + int NODE_LABEL_STYLE__BORDER_COLOR = ViewPackage.LABEL_STYLE_FEATURE_COUNT; /** * The feature id for the 'Border Radius' attribute. @@ -1201,15 +1219,15 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int NODE_LABEL_STYLE_OPERATION_COUNT = ViewPackage.LABEL_STYLE_OPERATION_COUNT + 0; + int NODE_LABEL_STYLE_OPERATION_COUNT = ViewPackage.LABEL_STYLE_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.InsideLabelStyleImpl * Inside Label Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.InsideLabelStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getInsideLabelStyle() - * @generated */ int INSIDE_LABEL_STYLE = 12; @@ -1334,7 +1352,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int INSIDE_LABEL_STYLE__WITH_HEADER = NODE_LABEL_STYLE_FEATURE_COUNT + 0; + int INSIDE_LABEL_STYLE__WITH_HEADER = NODE_LABEL_STYLE_FEATURE_COUNT; /** * The feature id for the 'Display Header Separator' attribute. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getOutsideLabelStyle() - * @generated */ int OUTSIDE_LABEL_STYLE = 13; @@ -1495,7 +1513,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int OUTSIDE_LABEL_STYLE_FEATURE_COUNT = NODE_LABEL_STYLE_FEATURE_COUNT + 0; + int OUTSIDE_LABEL_STYLE_FEATURE_COUNT = NODE_LABEL_STYLE_FEATURE_COUNT; /** * The number of operations of the 'Outside Label Style' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeStyleDescription * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeStyleDescription() - * @generated */ int NODE_STYLE_DESCRIPTION = 15; @@ -1523,414 +1541,442 @@ public interface DiagramPackage extends EPackage { * @ordered */ int NODE_STYLE_DESCRIPTION__BORDER_COLOR = BORDER_STYLE__BORDER_COLOR; - /** - * The feature id for the 'Border Radius' attribute. + * The feature id for the 'Border Color' reference. * * @generated * @ordered */ - int NODE_STYLE_DESCRIPTION__BORDER_RADIUS = BORDER_STYLE__BORDER_RADIUS; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_COLOR = NODE_STYLE_DESCRIPTION__BORDER_COLOR; /** - * The feature id for the 'Border Size' attribute. + * The feature id for the 'Border Color' reference. * * @generated * @ordered */ - int NODE_STYLE_DESCRIPTION__BORDER_SIZE = BORDER_STYLE__BORDER_SIZE; - + int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_COLOR = NODE_STYLE_DESCRIPTION__BORDER_COLOR; /** - * The feature id for the 'Border Line Style' attribute. + * The feature id for the 'Border Color' reference. * * @generated * @ordered */ - int NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = BORDER_STYLE__BORDER_LINE_STYLE; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_COLOR = NODE_STYLE_DESCRIPTION__BORDER_COLOR; /** - * The number of structural features of the 'Node Style Description' class. + * The feature id for the 'Border Radius' attribute. * * @generated * @ordered */ - int NODE_STYLE_DESCRIPTION_FEATURE_COUNT = BORDER_STYLE_FEATURE_COUNT + 0; - + int NODE_STYLE_DESCRIPTION__BORDER_RADIUS = BORDER_STYLE__BORDER_RADIUS; /** - * The number of operations of the 'Node Style Description' class. + * The feature id for the 'Border Radius' attribute. * * @generated * @ordered */ - int NODE_STYLE_DESCRIPTION_OPERATION_COUNT = BORDER_STYLE_OPERATION_COUNT + 0; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_RADIUS = NODE_STYLE_DESCRIPTION__BORDER_RADIUS; /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalNodeStyleImpl - * Conditional Node Style}' class. + * The feature id for the 'Border Radius' attribute. * - * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalNodeStyleImpl - * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalNodeStyle() * @generated + * @ordered */ - int CONDITIONAL_NODE_STYLE = 16; - + int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_RADIUS = NODE_STYLE_DESCRIPTION__BORDER_RADIUS; /** - * The feature id for the 'Condition' attribute. + * The feature id for the 'Border Radius' attribute. * * @generated * @ordered */ - int CONDITIONAL_NODE_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_RADIUS = NODE_STYLE_DESCRIPTION__BORDER_RADIUS; /** - * The feature id for the 'Style' containment reference. + * The feature id for the 'Border Size' attribute. * * @generated * @ordered */ - int CONDITIONAL_NODE_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 0; - + int NODE_STYLE_DESCRIPTION__BORDER_SIZE = BORDER_STYLE__BORDER_SIZE; /** - * The number of structural features of the 'Conditional Node Style' class. + * The feature id for the 'Border Size' attribute. * * @generated * @ordered */ - int CONDITIONAL_NODE_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_SIZE = NODE_STYLE_DESCRIPTION__BORDER_SIZE; /** - * The number of operations of the 'Conditional Node Style' class. + * The feature id for the 'Border Size' attribute. * * @generated * @ordered */ - int CONDITIONAL_NODE_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT + 0; - + int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_SIZE = NODE_STYLE_DESCRIPTION__BORDER_SIZE; /** - * The meta object id for the - * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalInsideLabelStyleImpl Conditional Inside - * Label Style}' class. + * The feature id for the 'Border Size' attribute. * - * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalInsideLabelStyleImpl - * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalInsideLabelStyle() * @generated + * @ordered */ - int CONDITIONAL_INSIDE_LABEL_STYLE = 17; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_SIZE = NODE_STYLE_DESCRIPTION__BORDER_SIZE; /** - * The feature id for the 'Condition' attribute. + * The feature id for the 'Border Line Style' attribute. * * @generated * @ordered */ - int CONDITIONAL_INSIDE_LABEL_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; - + int NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = BORDER_STYLE__BORDER_LINE_STYLE; /** - * The feature id for the 'Style' containment reference. * * @generated * @ordered */ - int CONDITIONAL_INSIDE_LABEL_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 0; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE; /** - * The number of structural features of the 'Conditional Inside Label Style' class. - * + * The feature id for the 'Border Line Style' attribute. * * @generated * @ordered */ - int CONDITIONAL_INSIDE_LABEL_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; - + int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE; /** - * The number of operations of the 'Conditional Inside Label Style' class. + * The feature id for the 'Border Line Style' attribute. * * @generated * @ordered */ - int CONDITIONAL_INSIDE_LABEL_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT + 0; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE; /** - * The meta object id for the - * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalOutsideLabelStyleImpl Conditional Outside - * Label Style}' class. + * The number of structural features of the 'Node Style Description' class. * - * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalOutsideLabelStyleImpl - * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalOutsideLabelStyle() * @generated + * @ordered */ - int CONDITIONAL_OUTSIDE_LABEL_STYLE = 18; - + int NODE_STYLE_DESCRIPTION_FEATURE_COUNT = BORDER_STYLE_FEATURE_COUNT; /** - * The feature id for the 'Condition' attribute. + * The feature id for the 'Background' reference. * * @generated * @ordered */ - int CONDITIONAL_OUTSIDE_LABEL_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION__BACKGROUND = NODE_STYLE_DESCRIPTION_FEATURE_COUNT; /** - * The feature id for the 'Style' containment reference. + * The number of structural features of the 'Rectangular Node Style Description' class. * * @generated * @ordered */ - int CONDITIONAL_OUTSIDE_LABEL_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 0; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION_FEATURE_COUNT = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Conditional Outside Label Style' class. + * The feature id for the 'Shape' attribute. * * @generated * @ordered */ - int CONDITIONAL_OUTSIDE_LABEL_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; - + int IMAGE_NODE_STYLE_DESCRIPTION__SHAPE = NODE_STYLE_DESCRIPTION_FEATURE_COUNT; /** - * The number of operations of the 'Conditional Outside Label Style' class. * * @generated * @ordered */ - int CONDITIONAL_OUTSIDE_LABEL_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT + 0; - + int IMAGE_NODE_STYLE_DESCRIPTION__POSITION_DEPENDENT_ROTATION = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 1; /** - * The feature id for the 'Border Color' reference. + * The number of structural features of the 'Image Node Style Description' class. + * * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_COLOR = NODE_STYLE_DESCRIPTION__BORDER_COLOR; - + int IMAGE_NODE_STYLE_DESCRIPTION_FEATURE_COUNT = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 2; /** - * The feature id for the 'Border Radius' attribute. + * The feature id for the 'Background' reference. * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_RADIUS = NODE_STYLE_DESCRIPTION__BORDER_RADIUS; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION__BACKGROUND = NODE_STYLE_DESCRIPTION_FEATURE_COUNT; /** - * The feature id for the 'Border Size' attribute. + * The number of structural features of the 'Icon Label Node Style Description' class. * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_SIZE = NODE_STYLE_DESCRIPTION__BORDER_SIZE; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION_FEATURE_COUNT = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 1; /** - * The feature id for the 'Border Line Style' attribute. + * The number of operations of the 'Node Style Description' class. * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE; - + int NODE_STYLE_DESCRIPTION_OPERATION_COUNT = BORDER_STYLE_OPERATION_COUNT; /** - * The feature id for the 'Background' reference. + * The number of operations of the 'Rectangular Node Style Description' class. * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION__BACKGROUND = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 0; - + int RECTANGULAR_NODE_STYLE_DESCRIPTION_OPERATION_COUNT = NODE_STYLE_DESCRIPTION_OPERATION_COUNT; /** - * The number of structural features of the 'Rectangular Node Style Description' class. + * The number of operations of the 'Image Node Style Description' class. * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION_FEATURE_COUNT = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 1; - + int IMAGE_NODE_STYLE_DESCRIPTION_OPERATION_COUNT = NODE_STYLE_DESCRIPTION_OPERATION_COUNT; /** - * The number of operations of the 'Rectangular Node Style Description' class. * * @generated * @ordered */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION_OPERATION_COUNT = NODE_STYLE_DESCRIPTION_OPERATION_COUNT + 0; - + int ICON_LABEL_NODE_STYLE_DESCRIPTION_OPERATION_COUNT = NODE_STYLE_DESCRIPTION_OPERATION_COUNT; /** - * The feature id for the 'Border Color' reference. + * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramStyleDescriptionImpl + * Style Description}' class. * * @generated - * @ordered + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramStyleDescriptionImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramStyleDescription() */ - int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_COLOR = NODE_STYLE_DESCRIPTION__BORDER_COLOR; - + int DIAGRAM_STYLE_DESCRIPTION = 16; /** - * The feature id for the 'Border Radius' attribute. + * The feature id for the 'Background' reference. * * @generated * @ordered */ - int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_RADIUS = NODE_STYLE_DESCRIPTION__BORDER_RADIUS; - + int DIAGRAM_STYLE_DESCRIPTION__BACKGROUND = 0; /** - * The feature id for the 'Border Size' attribute. + * The number of structural features of the 'Style Description' class. * * @generated * @ordered */ - int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_SIZE = NODE_STYLE_DESCRIPTION__BORDER_SIZE; - + int DIAGRAM_STYLE_DESCRIPTION_FEATURE_COUNT = 1; /** - * The feature id for the 'Border Line Style' attribute. + * The number of operations of the 'Style Description' class. * * @generated * @ordered */ - int IMAGE_NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE; - + int DIAGRAM_STYLE_DESCRIPTION_OPERATION_COUNT = 0; /** - * The feature id for the 'Shape' attribute. + * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalNodeStyleImpl + * Conditional Node Style}' class. * * @generated - * @ordered + * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalNodeStyleImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalNodeStyle() */ - int IMAGE_NODE_STYLE_DESCRIPTION__SHAPE = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 0; - + int CONDITIONAL_NODE_STYLE = 17; /** - * The feature id for the 'Position Dependent Rotation' attribute. + * The feature id for the 'Condition' attribute. * * @generated * @ordered */ - int IMAGE_NODE_STYLE_DESCRIPTION__POSITION_DEPENDENT_ROTATION = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 1; - + int CONDITIONAL_NODE_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; /** - * The number of structural features of the 'Image Node Style Description' class. - * + * The feature id for the 'Style' containment reference. * * @generated * @ordered */ - int IMAGE_NODE_STYLE_DESCRIPTION_FEATURE_COUNT = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 2; - + int CONDITIONAL_NODE_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT; /** - * The number of operations of the 'Image Node Style Description' class. * * @generated * @ordered */ - int IMAGE_NODE_STYLE_DESCRIPTION_OPERATION_COUNT = NODE_STYLE_DESCRIPTION_OPERATION_COUNT + 0; - + int CONDITIONAL_NODE_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; /** - * The feature id for the 'Border Color' reference. + * The number of operations of the 'Conditional Node Style' class. * * @generated * @ordered */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_COLOR = NODE_STYLE_DESCRIPTION__BORDER_COLOR; - + int CONDITIONAL_NODE_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT; /** - * The feature id for the 'Border Radius' attribute. + * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalDiagramStyleImpl + * Conditional Diagram Style}' class. * * @generated - * @ordered + * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalDiagramStyleImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalDiagramStyle() */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_RADIUS = NODE_STYLE_DESCRIPTION__BORDER_RADIUS; - + int CONDITIONAL_DIAGRAM_STYLE = 18; /** - * The feature id for the 'Border Size' attribute. + * The feature id for the 'Condition' attribute. * * @generated * @ordered */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_SIZE = NODE_STYLE_DESCRIPTION__BORDER_SIZE; - + int CONDITIONAL_DIAGRAM_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; /** - * The feature id for the 'Border Line Style' attribute. * * @generated * @ordered */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE = NODE_STYLE_DESCRIPTION__BORDER_LINE_STYLE; - + int CONDITIONAL_DIAGRAM_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT; /** - * The feature id for the 'Background' reference. + * The number of structural features of the 'Conditional Diagram Style' class. * * @generated * @ordered */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION__BACKGROUND = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 0; - + int CONDITIONAL_DIAGRAM_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Icon Label Node Style Description' class. + * + * @generated + * @ordered + */ + int CONDITIONAL_DIAGRAM_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT; + /** + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalInsideLabelStyleImpl Conditional Inside + * Label Style}' class. + * + * @generated + * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalInsideLabelStyleImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalInsideLabelStyle() + */ + int CONDITIONAL_INSIDE_LABEL_STYLE = 19; + /** + * The feature id for the 'Condition' attribute. + * + * @generated + * @ordered + */ + int CONDITIONAL_INSIDE_LABEL_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; + /** + * The feature id for the 'Style' containment reference. + * + * @generated + * @ordered + */ + int CONDITIONAL_INSIDE_LABEL_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT; + /** + * The number of structural features of the 'Conditional Inside Label Style' class. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_INSIDE_LABEL_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; + /** + * The number of operations of the 'Conditional Inside Label Style' class. + * + * @generated + * @ordered + */ + int CONDITIONAL_INSIDE_LABEL_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT; + /** + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalOutsideLabelStyleImpl Conditional Outside + * Label Style}' class. + * + * @generated + * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalOutsideLabelStyleImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalOutsideLabelStyle() + */ + int CONDITIONAL_OUTSIDE_LABEL_STYLE = 20; + /** + * The feature id for the 'Condition' attribute. + * + * @generated + * @ordered + */ + int CONDITIONAL_OUTSIDE_LABEL_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; + /** + * The feature id for the 'Style' containment reference. + * + * @generated + * @ordered + */ + int CONDITIONAL_OUTSIDE_LABEL_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT; + /** + * The number of structural features of the 'Conditional Outside Label Style' class. * * @generated * @ordered */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION_FEATURE_COUNT = NODE_STYLE_DESCRIPTION_FEATURE_COUNT + 1; - + int CONDITIONAL_OUTSIDE_LABEL_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; /** - * The number of operations of the 'Icon Label Node Style Description' class. * * @generated * @ordered */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION_OPERATION_COUNT = NODE_STYLE_DESCRIPTION_OPERATION_COUNT + 0; - + int CONDITIONAL_OUTSIDE_LABEL_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT; /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.diagram.impl.RectangularNodeStyleDescriptionImpl Rectangular Node * Style Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.RectangularNodeStyleDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getRectangularNodeStyleDescription() - * @generated */ - int RECTANGULAR_NODE_STYLE_DESCRIPTION = 19; + int RECTANGULAR_NODE_STYLE_DESCRIPTION = 21; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.ImageNodeStyleDescriptionImpl * Image Node Style Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ImageNodeStyleDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getImageNodeStyleDescription() - * @generated */ - int IMAGE_NODE_STYLE_DESCRIPTION = 20; + int IMAGE_NODE_STYLE_DESCRIPTION = 22; /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.diagram.impl.IconLabelNodeStyleDescriptionImpl Icon Label Node * Style Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.IconLabelNodeStyleDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getIconLabelNodeStyleDescription() - * @generated */ - int ICON_LABEL_NODE_STYLE_DESCRIPTION = 21; + int ICON_LABEL_NODE_STYLE_DESCRIPTION = 23; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl Edge * Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeStyle() - * @generated */ - int EDGE_STYLE = 22; + int EDGE_STYLE = 24; /** * The feature id for the 'Color' reference. @@ -1946,7 +1992,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_STYLE__FONT_SIZE = STYLE_FEATURE_COUNT + 0; + int EDGE_STYLE__FONT_SIZE = STYLE_FEATURE_COUNT; /** * The feature id for the 'Italic' attribute. @@ -2095,17 +2141,17 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_STYLE_OPERATION_COUNT = STYLE_OPERATION_COUNT + 0; + int EDGE_STYLE_OPERATION_COUNT = STYLE_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl * Conditional Edge Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalEdgeStyle() - * @generated */ - int CONDITIONAL_EDGE_STYLE = 23; + int CONDITIONAL_EDGE_STYLE = 25; /** * The feature id for the 'Condition' attribute. @@ -2121,7 +2167,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_EDGE_STYLE__COLOR = ViewPackage.CONDITIONAL_FEATURE_COUNT + 0; + int CONDITIONAL_EDGE_STYLE__COLOR = ViewPackage.CONDITIONAL_FEATURE_COUNT; /** * The feature id for the 'Font Size' attribute. @@ -2279,17 +2325,17 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_EDGE_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT + 0; + int CONDITIONAL_EDGE_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramPaletteImpl * Palette}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPaletteImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramPalette() - * @generated */ - int DIAGRAM_PALETTE = 24; + int DIAGRAM_PALETTE = 26; /** * The feature id for the 'Drop Tool' containment reference. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodePaletteImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodePalette() - * @generated */ - int NODE_PALETTE = 25; + int NODE_PALETTE = 27; /** * The feature id for the 'Delete Tool' containment reference. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgePaletteImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgePalette() - * @generated */ - int EDGE_PALETTE = 26; + int EDGE_PALETTE = 28; /** * The feature id for the 'Delete Tool' containment reference. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getTool() - * @generated */ - int TOOL = 27; + int TOOL = 29; /** * The feature id for the 'Name' attribute. @@ -2570,11 +2616,11 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DeleteToolImpl Delete * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DeleteToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDeleteTool() - * @generated */ - int DELETE_TOOL = 28; + int DELETE_TOOL = 30; /** * The feature id for the 'Name' attribute. @@ -2609,7 +2655,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DELETE_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 0; + int DELETE_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT; /** * The number of operations of the 'Delete Tool' class. @@ -2617,17 +2663,17 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DELETE_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT + 0; + int DELETE_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DropToolImpl Drop * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DropToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDropTool() - * @generated */ - int DROP_TOOL = 29; + int DROP_TOOL = 31; /** * The feature id for the 'Name' attribute. @@ -2662,7 +2708,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DROP_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 0; + int DROP_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT; /** * The number of operations of the 'Drop Tool' class. @@ -2670,17 +2716,17 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DROP_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT + 0; + int DROP_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeToolImpl Edge * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeTool() - * @generated */ - int EDGE_TOOL = 30; + int EDGE_TOOL = 32; /** * The feature id for the 'Name' attribute. @@ -2715,7 +2761,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_TOOL__TARGET_ELEMENT_DESCRIPTIONS = TOOL_FEATURE_COUNT + 0; + int EDGE_TOOL__TARGET_ELEMENT_DESCRIPTIONS = TOOL_FEATURE_COUNT; /** * The feature id for the 'Icon UR Ls Expression' attribute. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeReconnectionToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeReconnectionTool() - * @generated */ - int EDGE_RECONNECTION_TOOL = 31; + int EDGE_RECONNECTION_TOOL = 33; /** * The feature id for the 'Name' attribute. @@ -2760,70 +2806,52 @@ public interface DiagramPackage extends EPackage { * @ordered */ int EDGE_RECONNECTION_TOOL__NAME = TOOL__NAME; - /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Name' attribute. * * @generated * @ordered */ - int EDGE_RECONNECTION_TOOL__PRECONDITION_EXPRESSION = TOOL__PRECONDITION_EXPRESSION; - + int SOURCE_EDGE_END_RECONNECTION_TOOL__NAME = EDGE_RECONNECTION_TOOL__NAME; /** - * The feature id for the 'Body' containment reference list. + * The feature id for the 'Name' attribute. * * @generated * @ordered */ - int EDGE_RECONNECTION_TOOL__BODY = TOOL__BODY; - + int TARGET_EDGE_END_RECONNECTION_TOOL__NAME = EDGE_RECONNECTION_TOOL__NAME; /** - * The number of structural features of the 'Edge Reconnection Tool' class. * * @generated * @ordered */ - int EDGE_RECONNECTION_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 0; - + int EDGE_RECONNECTION_TOOL__PRECONDITION_EXPRESSION = TOOL__PRECONDITION_EXPRESSION; /** - * The number of operations of the 'Edge Reconnection Tool' class. * * @generated * @ordered */ - int EDGE_RECONNECTION_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.LabelEditToolImpl Label - * Edit Tool}' class. - * - * @see org.eclipse.sirius.components.view.diagram.impl.LabelEditToolImpl - * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelEditTool() - * @generated - */ - int LABEL_EDIT_TOOL = 32; - + int SOURCE_EDGE_END_RECONNECTION_TOOL__PRECONDITION_EXPRESSION = EDGE_RECONNECTION_TOOL__PRECONDITION_EXPRESSION; /** - * The feature id for the 'Name' attribute. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int LABEL_EDIT_TOOL__NAME = TOOL__NAME; - + int TARGET_EDGE_END_RECONNECTION_TOOL__PRECONDITION_EXPRESSION = EDGE_RECONNECTION_TOOL__PRECONDITION_EXPRESSION; /** - * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int LABEL_EDIT_TOOL__PRECONDITION_EXPRESSION = TOOL__PRECONDITION_EXPRESSION; - + int EDGE_RECONNECTION_TOOL__BODY = TOOL__BODY; /** * The feature id for the 'Body' containment reference list. @@ -2831,150 +2859,134 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int LABEL_EDIT_TOOL__BODY = TOOL__BODY; - + int SOURCE_EDGE_END_RECONNECTION_TOOL__BODY = EDGE_RECONNECTION_TOOL__BODY; /** - * The feature id for the 'Initial Direct Edit Label Expression' attribute. - * + * The feature id for the 'Body' containment reference list. * * @generated * @ordered */ - int LABEL_EDIT_TOOL__INITIAL_DIRECT_EDIT_LABEL_EXPRESSION = TOOL_FEATURE_COUNT + 0; - + int TARGET_EDGE_END_RECONNECTION_TOOL__BODY = EDGE_RECONNECTION_TOOL__BODY; /** - * The number of structural features of the 'Label Edit Tool' class. * * @generated * @ordered */ - int LABEL_EDIT_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 1; - + int EDGE_RECONNECTION_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT; /** - * The number of operations of the 'Label Edit Tool' class. + * The number of structural features of the 'Source Edge End Reconnection Tool' class. * * @generated * @ordered */ - int LABEL_EDIT_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT + 0; - + int SOURCE_EDGE_END_RECONNECTION_TOOL_FEATURE_COUNT = EDGE_RECONNECTION_TOOL_FEATURE_COUNT; /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodeToolImpl Node - * Tool}' class. + * The number of structural features of the 'Target Edge End Reconnection Tool' class. * - * @see org.eclipse.sirius.components.view.diagram.impl.NodeToolImpl - * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeTool() * @generated + * @ordered */ - int NODE_TOOL = 33; - + int TARGET_EDGE_END_RECONNECTION_TOOL_FEATURE_COUNT = EDGE_RECONNECTION_TOOL_FEATURE_COUNT; /** - * The feature id for the 'Name' attribute. + * The number of operations of the 'Edge Reconnection Tool' class. * * @generated * @ordered */ - int NODE_TOOL__NAME = TOOL__NAME; - + int EDGE_RECONNECTION_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT; /** - * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int NODE_TOOL__PRECONDITION_EXPRESSION = TOOL__PRECONDITION_EXPRESSION; - + int SOURCE_EDGE_END_RECONNECTION_TOOL_OPERATION_COUNT = EDGE_RECONNECTION_TOOL_OPERATION_COUNT; /** - * The feature id for the 'Body' containment reference list. * * @generated * @ordered */ - int NODE_TOOL__BODY = TOOL__BODY; - - int NODE_TOOL__DIALOG_DESCRIPTION = TOOL_FEATURE_COUNT; - + int TARGET_EDGE_END_RECONNECTION_TOOL_OPERATION_COUNT = EDGE_RECONNECTION_TOOL_OPERATION_COUNT; /** - * The feature id for the 'Icon UR Ls Expression' attribute. + * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.LabelEditToolImpl Label + * Edit Tool}' class. * * @generated - * @ordered + * @see org.eclipse.sirius.components.view.diagram.impl.LabelEditToolImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelEditTool() */ - int NODE_TOOL__ICON_UR_LS_EXPRESSION = TOOL_FEATURE_COUNT + 1; - + int LABEL_EDIT_TOOL = 34; /** - * The number of structural features of the 'Node Tool' class. + * The feature id for the 'Name' attribute. * * @generated * @ordered */ - int NODE_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 2; - + int LABEL_EDIT_TOOL__NAME = TOOL__NAME; /** - * The number of operations of the 'Node Tool' class. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int NODE_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT + 0; - + int LABEL_EDIT_TOOL__PRECONDITION_EXPRESSION = TOOL__PRECONDITION_EXPRESSION; /** - * The feature id for the 'Name' attribute. + * The feature id for the 'Body' containment reference list. * * @generated * @ordered */ - int SOURCE_EDGE_END_RECONNECTION_TOOL__NAME = EDGE_RECONNECTION_TOOL__NAME; - + int LABEL_EDIT_TOOL__BODY = TOOL__BODY; /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Initial Direct Edit Label Expression' attribute. + * * * @generated * @ordered */ - int SOURCE_EDGE_END_RECONNECTION_TOOL__PRECONDITION_EXPRESSION = EDGE_RECONNECTION_TOOL__PRECONDITION_EXPRESSION; - + int LABEL_EDIT_TOOL__INITIAL_DIRECT_EDIT_LABEL_EXPRESSION = TOOL_FEATURE_COUNT; /** - * The feature id for the 'Body' containment reference list. * * @generated * @ordered */ - int SOURCE_EDGE_END_RECONNECTION_TOOL__BODY = EDGE_RECONNECTION_TOOL__BODY; - + int LABEL_EDIT_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Source Edge End Reconnection Tool' class. + * The number of operations of the 'Label Edit Tool' class. * * @generated * @ordered */ - int SOURCE_EDGE_END_RECONNECTION_TOOL_FEATURE_COUNT = EDGE_RECONNECTION_TOOL_FEATURE_COUNT + 0; - + int LABEL_EDIT_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT; /** - * The number of operations of the 'Source Edge End Reconnection Tool' class. + * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodeToolImpl Node + * Tool}' class. * * @generated - * @ordered + * @see org.eclipse.sirius.components.view.diagram.impl.NodeToolImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeTool() */ - int SOURCE_EDGE_END_RECONNECTION_TOOL_OPERATION_COUNT = EDGE_RECONNECTION_TOOL_OPERATION_COUNT + 0; - + int NODE_TOOL = 35; /** * The feature id for the 'Name' attribute. * * @generated * @ordered */ - int TARGET_EDGE_END_RECONNECTION_TOOL__NAME = EDGE_RECONNECTION_TOOL__NAME; - + int NODE_TOOL__NAME = TOOL__NAME; /** * The feature id for the 'Precondition Expression' attribute. @@ -2982,8 +2994,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int TARGET_EDGE_END_RECONNECTION_TOOL__PRECONDITION_EXPRESSION = EDGE_RECONNECTION_TOOL__PRECONDITION_EXPRESSION; - + int NODE_TOOL__PRECONDITION_EXPRESSION = TOOL__PRECONDITION_EXPRESSION; /** * The feature id for the 'Body' containment reference list. @@ -2991,57 +3002,62 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int TARGET_EDGE_END_RECONNECTION_TOOL__BODY = EDGE_RECONNECTION_TOOL__BODY; - + int NODE_TOOL__BODY = TOOL__BODY; + int NODE_TOOL__DIALOG_DESCRIPTION = TOOL_FEATURE_COUNT; /** - * The number of structural features of the 'Target Edge End Reconnection Tool' class. + * The feature id for the 'Icon UR Ls Expression' attribute. * * @generated * @ordered */ - int TARGET_EDGE_END_RECONNECTION_TOOL_FEATURE_COUNT = EDGE_RECONNECTION_TOOL_FEATURE_COUNT + 0; - + int NODE_TOOL__ICON_UR_LS_EXPRESSION = TOOL_FEATURE_COUNT + 1; /** - * The number of operations of the 'Target Edge End Reconnection Tool' class. + * The number of structural features of the 'Node Tool' class. * * @generated * @ordered */ - int TARGET_EDGE_END_RECONNECTION_TOOL_OPERATION_COUNT = EDGE_RECONNECTION_TOOL_OPERATION_COUNT + 0; - + int NODE_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 2; + /** + * The number of operations of the 'Node Tool' class. + * + * @generated + * @ordered + */ + int NODE_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT; /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.diagram.impl.SourceEdgeEndReconnectionToolImpl Source Edge End * Reconnection Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.SourceEdgeEndReconnectionToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSourceEdgeEndReconnectionTool() - * @generated */ - int SOURCE_EDGE_END_RECONNECTION_TOOL = 34; + int SOURCE_EDGE_END_RECONNECTION_TOOL = 36; /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.diagram.impl.TargetEdgeEndReconnectionToolImpl Target Edge End * Reconnection Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.TargetEdgeEndReconnectionToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getTargetEdgeEndReconnectionTool() - * @generated */ - int TARGET_EDGE_END_RECONNECTION_TOOL = 35; + int TARGET_EDGE_END_RECONNECTION_TOOL = 37; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.CreateViewImpl Create * View}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.CreateViewImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getCreateView() - * @generated */ - int CREATE_VIEW = 36; + int CREATE_VIEW = 38; /** * The feature id for the 'Children' containment reference list. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DeleteViewImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDeleteView() - * @generated */ - int DELETE_VIEW = 37; + int DELETE_VIEW = 39; /** * The feature id for the 'Children' containment reference list. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DialogDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDialogDescription() - * @generated */ - int DIALOG_DESCRIPTION = 44; + int DIALOG_DESCRIPTION = 46; /** * The number of structural features of the 'Dialog Description' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.SelectionDialogDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSelectionDialogDescription() - * @generated */ - int SELECTION_DIALOG_DESCRIPTION = 38; + int SELECTION_DIALOG_DESCRIPTION = 40; /** * The feature id for the 'Selection Message' attribute. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getToolSection() - * @generated */ - int TOOL_SECTION = 39; + int TOOL_SECTION = 41; /** * The feature id for the 'Name' attribute. @@ -3270,11 +3286,11 @@ public interface DiagramPackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramToolSectionImpl * Tool Section}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramToolSection() - * @generated */ - int DIAGRAM_TOOL_SECTION = 40; + int DIAGRAM_TOOL_SECTION = 42; /** * The feature id for the 'Name' attribute. @@ -3291,7 +3307,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DIAGRAM_TOOL_SECTION__NODE_TOOLS = TOOL_SECTION_FEATURE_COUNT + 0; + int DIAGRAM_TOOL_SECTION__NODE_TOOLS = TOOL_SECTION_FEATURE_COUNT; /** * The number of structural features of the 'Tool Section' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodeToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeToolSection() - * @generated */ - int NODE_TOOL_SECTION = 41; + int NODE_TOOL_SECTION = 43; /** * The feature id for the 'Name' attribute. @@ -3335,7 +3351,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int NODE_TOOL_SECTION__NODE_TOOLS = TOOL_SECTION_FEATURE_COUNT + 0; + int NODE_TOOL_SECTION__NODE_TOOLS = TOOL_SECTION_FEATURE_COUNT; /** * The feature id for the 'Edge Tools' containment reference list. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeToolSection() - * @generated */ - int EDGE_TOOL_SECTION = 42; + int EDGE_TOOL_SECTION = 44; /** * The feature id for the 'Name' attribute. @@ -3388,7 +3404,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int EDGE_TOOL_SECTION__NODE_TOOLS = TOOL_SECTION_FEATURE_COUNT + 0; + int EDGE_TOOL_SECTION__NODE_TOOLS = TOOL_SECTION_FEATURE_COUNT; /** * The number of structural features of the 'Edge Tool Section' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DropNodeToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDropNodeTool() - * @generated */ - int DROP_NODE_TOOL = 43; + int DROP_NODE_TOOL = 45; /** * The feature id for the 'Name' attribute. @@ -3450,8 +3466,7 @@ public interface DiagramPackage extends EPackage { * @generated * @ordered */ - int DROP_NODE_TOOL__ACCEPTED_NODE_TYPES = TOOL_FEATURE_COUNT + 0; - + int DROP_NODE_TOOL__ACCEPTED_NODE_TYPES = TOOL_FEATURE_COUNT; /** * The number of structural features of the 'Drop Node Tool' class. @@ -3460,26 +3475,23 @@ public interface DiagramPackage extends EPackage { * @ordered */ int DROP_NODE_TOOL_FEATURE_COUNT = TOOL_FEATURE_COUNT + 1; - /** * The number of operations of the 'Drop Node Tool' class. * * @generated * @ordered */ - int DROP_NODE_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT + 0; - + int DROP_NODE_TOOL_OPERATION_COUNT = TOOL_OPERATION_COUNT; /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.diagram.impl.SelectionDialogTreeDescriptionImpl Selection Dialog * Tree Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.SelectionDialogTreeDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSelectionDialogTreeDescription() - * @generated */ - int SELECTION_DIALOG_TREE_DESCRIPTION = 45; - + int SELECTION_DIALOG_TREE_DESCRIPTION = 47; /** * The feature id for the 'Elements Expression' attribute. @@ -3488,7 +3500,6 @@ public interface DiagramPackage extends EPackage { * @ordered */ int SELECTION_DIALOG_TREE_DESCRIPTION__ELEMENTS_EXPRESSION = 0; - /** * The feature id for the 'Children Expression' attribute. @@ -3497,7 +3508,6 @@ public interface DiagramPackage extends EPackage { * @ordered */ int SELECTION_DIALOG_TREE_DESCRIPTION__CHILDREN_EXPRESSION = 1; - /** * The feature id for the 'Is Selectable Expression' attribute. @@ -3506,7 +3516,6 @@ public interface DiagramPackage extends EPackage { * @ordered */ int SELECTION_DIALOG_TREE_DESCRIPTION__IS_SELECTABLE_EXPRESSION = 2; - /** * The number of structural features of the 'Selection Dialog Tree Description' class. @@ -3515,7 +3524,6 @@ public interface DiagramPackage extends EPackage { * @ordered */ int SELECTION_DIALOG_TREE_DESCRIPTION_FEATURE_COUNT = 3; - /** * The number of operations of the 'Selection Dialog Tree Description' class. @@ -3524,117 +3532,105 @@ public interface DiagramPackage extends EPackage { * @ordered */ int SELECTION_DIALOG_TREE_DESCRIPTION_OPERATION_COUNT = 0; - /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.ArrowStyle Arrow Style}' * enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getArrowStyle() - * @generated */ - int ARROW_STYLE = 46; - + int ARROW_STYLE = 48; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.LayoutDirection Layout * Direction}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LayoutDirection * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLayoutDirection() - * @generated */ - int LAYOUT_DIRECTION = 47; - + int LAYOUT_DIRECTION = 49; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.LineStyle Line Style}' * enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LineStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLineStyle() - * @generated */ - int LINE_STYLE = 48; - + int LINE_STYLE = 50; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.NodeContainmentKind Node * Containment Kind}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeContainmentKind * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeContainmentKind() - * @generated */ - int NODE_CONTAINMENT_KIND = 49; - + int NODE_CONTAINMENT_KIND = 51; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.SynchronizationPolicy * Synchronization Policy}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.SynchronizationPolicy * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSynchronizationPolicy() - * @generated */ - int SYNCHRONIZATION_POLICY = 50; - + int SYNCHRONIZATION_POLICY = 52; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.InsideLabelPosition Inside * Label Position}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.InsideLabelPosition * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getInsideLabelPosition() - * @generated */ - int INSIDE_LABEL_POSITION = 51; - + int INSIDE_LABEL_POSITION = 53; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.OutsideLabelPosition Outside * Label Position}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.OutsideLabelPosition * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getOutsideLabelPosition() - * @generated */ - int OUTSIDE_LABEL_POSITION = 52; - + int OUTSIDE_LABEL_POSITION = 54; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy Label * Overflow Strategy}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelOverflowStrategy() - * @generated */ - int LABEL_OVERFLOW_STRATEGY = 53; - + int LABEL_OVERFLOW_STRATEGY = 55; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection Arrange * Layout Direction}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getArrangeLayoutDirection() - * @generated */ - int ARRANGE_LAYOUT_DIRECTION = 54; - + int ARRANGE_LAYOUT_DIRECTION = 56; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.LabelTextAlign Label Text * Align}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelTextAlign * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelTextAlign() - * @generated */ - int LABEL_TEXT_ALIGN = 55; - + int LABEL_TEXT_ALIGN = 57; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.diagram.UserResizableDirection User * Resizable Direction}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.UserResizableDirection * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getUserResizableDirection() - * @generated */ - int USER_RESIZABLE_DIRECTION = 56; - + int USER_RESIZABLE_DIRECTION = 58; /** * The singleton instance of the package. * @@ -3647,8 +3643,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Description'. - * @see org.eclipse.sirius.components.view.diagram.DiagramDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramDescription */ EClass getDiagramDescription(); @@ -3682,9 +3678,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the containment reference list 'Node Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramDescription#getNodeDescriptions() * @see #getDiagramDescription() - * @generated */ EReference getDiagramDescription_NodeDescriptions(); @@ -3694,9 +3690,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the containment reference list 'Edge Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramDescription#getEdgeDescriptions() * @see #getDiagramDescription() - * @generated */ EReference getDiagramDescription_EdgeDescriptions(); @@ -3706,19 +3702,43 @@ public interface DiagramPackage extends EPackage { * Layout Direction}'. * * @return the meta object for the attribute 'Arrange Layout Direction'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramDescription#getArrangeLayoutDirection() * @see #getDiagramDescription() - * @generated */ EAttribute getDiagramDescription_ArrangeLayoutDirection(); + /** + * Returns the meta object for the containment reference + * '{@link org.eclipse.sirius.components.view.diagram.DiagramDescription#getStyle Style}'. + * + * @return the meta object for the containment reference 'Style'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramDescription#getStyle() + * @see #getDiagramDescription() + */ + EReference getDiagramDescription_Style(); + + /** + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.diagram.DiagramDescription#getConditionalStyles Conditional + * Styles}'. + * + * @return the meta object for the containment reference list 'Conditional Styles'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramDescription#getConditionalStyles() + * @see #getDiagramDescription() + */ + EReference getDiagramDescription_ConditionalStyles(); + /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.DiagramElementDescription * Element Description}'. * * @return the meta object for class 'Element Description'. - * @see org.eclipse.sirius.components.view.diagram.DiagramElementDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramElementDescription */ EClass getDiagramElementDescription(); @@ -3740,9 +3760,9 @@ public interface DiagramPackage extends EPackage { * Type}'. * * @return the meta object for the attribute 'Domain Type'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramElementDescription#getDomainType() * @see #getDiagramElementDescription() - * @generated */ EAttribute getDiagramElementDescription_DomainType(); @@ -3752,9 +3772,9 @@ public interface DiagramPackage extends EPackage { * Semantic Candidates Expression}'. * * @return the meta object for the attribute 'Semantic Candidates Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramElementDescription#getSemanticCandidatesExpression() * @see #getDiagramElementDescription() - * @generated */ EAttribute getDiagramElementDescription_SemanticCandidatesExpression(); @@ -3764,9 +3784,9 @@ public interface DiagramPackage extends EPackage { * Precondition Expression}'. * * @return the meta object for the attribute 'Precondition Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramElementDescription#getPreconditionExpression() * @see #getDiagramElementDescription() - * @generated */ EAttribute getDiagramElementDescription_PreconditionExpression(); @@ -3776,9 +3796,9 @@ public interface DiagramPackage extends EPackage { * Synchronization Policy}'. * * @return the meta object for the attribute 'Synchronization Policy'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DiagramElementDescription#getSynchronizationPolicy() * @see #getDiagramElementDescription() - * @generated */ EAttribute getDiagramElementDescription_SynchronizationPolicy(); @@ -3787,8 +3807,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Node Description'. - * @see org.eclipse.sirius.components.view.diagram.NodeDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeDescription */ EClass getNodeDescription(); @@ -3822,9 +3842,9 @@ public interface DiagramPackage extends EPackage { * Strategy}'. * * @return the meta object for the containment reference 'Children Layout Strategy'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getChildrenLayoutStrategy() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_ChildrenLayoutStrategy(); @@ -3834,9 +3854,9 @@ public interface DiagramPackage extends EPackage { * --> * * @return the meta object for the containment reference 'Style'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getStyle() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_Style(); @@ -3846,9 +3866,9 @@ public interface DiagramPackage extends EPackage { * Styles}'. * * @return the meta object for the containment reference list 'Conditional Styles'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getConditionalStyles() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_ConditionalStyles(); @@ -3858,9 +3878,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the containment reference list 'Children Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getChildrenDescriptions() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_ChildrenDescriptions(); @@ -3870,9 +3890,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the containment reference list 'Border Nodes Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getBorderNodesDescriptions() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_BorderNodesDescriptions(); @@ -3882,9 +3902,9 @@ public interface DiagramPackage extends EPackage { * Child Node Descriptions}'. * * @return the meta object for the reference list 'Reused Child Node Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getReusedChildNodeDescriptions() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_ReusedChildNodeDescriptions(); @@ -3894,9 +3914,9 @@ public interface DiagramPackage extends EPackage { * Border Node Descriptions}'. * * @return the meta object for the reference list 'Reused Border Node Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getReusedBorderNodeDescriptions() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_ReusedBorderNodeDescriptions(); @@ -3906,9 +3926,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the attribute 'User Resizable'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getUserResizable() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_UserResizable(); @@ -3918,9 +3938,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Default Width Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getDefaultWidthExpression() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_DefaultWidthExpression(); @@ -3930,9 +3950,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Default Height Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getDefaultHeightExpression() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_DefaultHeightExpression(); @@ -3942,9 +3962,9 @@ public interface DiagramPackage extends EPackage { * Ratio}'. * * @return the meta object for the attribute 'Keep Aspect Ratio'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#isKeepAspectRatio() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_KeepAspectRatio(); @@ -3954,9 +3974,9 @@ public interface DiagramPackage extends EPackage { * Collapsed By Default Expression}'. * * @return the meta object for the attribute 'Is Collapsed By Default Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getIsCollapsedByDefaultExpression() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_IsCollapsedByDefaultExpression(); @@ -3978,9 +3998,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the containment reference list 'Outside Labels'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getOutsideLabels() * @see #getNodeDescription() - * @generated */ EReference getNodeDescription_OutsideLabels(); @@ -3990,9 +4010,9 @@ public interface DiagramPackage extends EPackage { * By Default Expression}'. * * @return the meta object for the attribute 'Is Hidden By Default Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getIsHiddenByDefaultExpression() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_IsHiddenByDefaultExpression(); @@ -4002,9 +4022,9 @@ public interface DiagramPackage extends EPackage { * Default Expression}'. * * @return the meta object for the attribute 'Is Faded By Default Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeDescription#getIsFadedByDefaultExpression() * @see #getNodeDescription() - * @generated */ EAttribute getNodeDescription_IsFadedByDefaultExpression(); @@ -4013,8 +4033,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Edge Description'. - * @see org.eclipse.sirius.components.view.diagram.EdgeDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeDescription */ EClass getEdgeDescription(); @@ -4024,9 +4044,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Begin Label Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getBeginLabelExpression() * @see #getEdgeDescription() - * @generated */ EAttribute getEdgeDescription_BeginLabelExpression(); @@ -4036,9 +4056,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Center Label Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getCenterLabelExpression() * @see #getEdgeDescription() - * @generated */ EAttribute getEdgeDescription_CenterLabelExpression(); @@ -4048,9 +4068,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'End Label Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getEndLabelExpression() * @see #getEdgeDescription() - * @generated */ EAttribute getEdgeDescription_EndLabelExpression(); @@ -4060,9 +4080,9 @@ public interface DiagramPackage extends EPackage { * Edge}'. * * @return the meta object for the attribute 'Is Domain Based Edge'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#isIsDomainBasedEdge() * @see #getEdgeDescription() - * @generated */ EAttribute getEdgeDescription_IsDomainBasedEdge(); @@ -4084,9 +4104,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the reference list 'Source Node Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getSourceNodeDescriptions() * @see #getEdgeDescription() - * @generated */ EReference getEdgeDescription_SourceNodeDescriptions(); @@ -4096,9 +4116,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the reference list 'Target Node Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getTargetNodeDescriptions() * @see #getEdgeDescription() - * @generated */ EReference getEdgeDescription_TargetNodeDescriptions(); @@ -4108,9 +4128,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Source Nodes Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getSourceNodesExpression() * @see #getEdgeDescription() - * @generated */ EAttribute getEdgeDescription_SourceNodesExpression(); @@ -4120,9 +4140,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Target Nodes Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getTargetNodesExpression() * @see #getEdgeDescription() - * @generated */ EAttribute getEdgeDescription_TargetNodesExpression(); @@ -4132,9 +4152,9 @@ public interface DiagramPackage extends EPackage { * --> * * @return the meta object for the containment reference 'Style'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getStyle() * @see #getEdgeDescription() - * @generated */ EReference getEdgeDescription_Style(); @@ -4144,9 +4164,9 @@ public interface DiagramPackage extends EPackage { * Styles}'. * * @return the meta object for the containment reference list 'Conditional Styles'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeDescription#getConditionalStyles() * @see #getEdgeDescription() - * @generated */ EReference getEdgeDescription_ConditionalStyles(); @@ -4155,8 +4175,8 @@ public interface DiagramPackage extends EPackage { * Layout Strategy Description}'. * * @return the meta object for class 'Layout Strategy Description'. - * @see org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription */ EClass getLayoutStrategyDescription(); @@ -4166,8 +4186,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'List Layout Strategy Description'. - * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription */ EClass getListLayoutStrategyDescription(); @@ -4177,9 +4197,9 @@ public interface DiagramPackage extends EPackage { * Are Child Nodes Draggable Expression}'. * * @return the meta object for the attribute 'Are Child Nodes Draggable Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription#getAreChildNodesDraggableExpression() * @see #getListLayoutStrategyDescription() - * @generated */ EAttribute getListLayoutStrategyDescription_AreChildNodesDraggableExpression(); @@ -4189,9 +4209,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Top Gap Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription#getTopGapExpression() * @see #getListLayoutStrategyDescription() - * @generated */ EAttribute getListLayoutStrategyDescription_TopGapExpression(); @@ -4201,9 +4221,9 @@ public interface DiagramPackage extends EPackage { * Bottom Gap Expression}'. * * @return the meta object for the attribute 'Bottom Gap Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription#getBottomGapExpression() * @see #getListLayoutStrategyDescription() - * @generated */ EAttribute getListLayoutStrategyDescription_BottomGapExpression(); @@ -4213,9 +4233,9 @@ public interface DiagramPackage extends EPackage { * Nodes}'. * * @return the meta object for the reference list 'Growable Nodes'. + * @generated * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription#getGrowableNodes() * @see #getListLayoutStrategyDescription() - * @generated */ EReference getListLayoutStrategyDescription_GrowableNodes(); @@ -4225,8 +4245,8 @@ public interface DiagramPackage extends EPackage { * Strategy Description}'. * * @return the meta object for class 'Free Form Layout Strategy Description'. - * @see org.eclipse.sirius.components.view.diagram.FreeFormLayoutStrategyDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.FreeFormLayoutStrategyDescription */ EClass getFreeFormLayoutStrategyDescription(); @@ -4235,8 +4255,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Label Description'. - * @see org.eclipse.sirius.components.view.diagram.LabelDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.LabelDescription */ EClass getLabelDescription(); @@ -4246,9 +4266,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Label Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelDescription#getLabelExpression() * @see #getLabelDescription() - * @generated */ EAttribute getLabelDescription_LabelExpression(); @@ -4258,9 +4278,9 @@ public interface DiagramPackage extends EPackage { * Strategy}'. * * @return the meta object for the attribute 'Overflow Strategy'. + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelDescription#getOverflowStrategy() * @see #getLabelDescription() - * @generated */ EAttribute getLabelDescription_OverflowStrategy(); @@ -4281,8 +4301,8 @@ public interface DiagramPackage extends EPackage { * Inside Label Description}'. * * @return the meta object for class 'Inside Label Description'. - * @see org.eclipse.sirius.components.view.diagram.InsideLabelDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.InsideLabelDescription */ EClass getInsideLabelDescription(); @@ -4316,9 +4336,9 @@ public interface DiagramPackage extends EPackage { * Styles}'. * * @return the meta object for the containment reference list 'Conditional Styles'. + * @generated * @see org.eclipse.sirius.components.view.diagram.InsideLabelDescription#getConditionalStyles() * @see #getInsideLabelDescription() - * @generated */ EReference getInsideLabelDescription_ConditionalStyles(); @@ -4327,8 +4347,8 @@ public interface DiagramPackage extends EPackage { * Outside Label Description}'. * * @return the meta object for class 'Outside Label Description'. - * @see org.eclipse.sirius.components.view.diagram.OutsideLabelDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.OutsideLabelDescription */ EClass getOutsideLabelDescription(); @@ -4362,9 +4382,9 @@ public interface DiagramPackage extends EPackage { * Styles}'. * * @return the meta object for the containment reference list 'Conditional Styles'. + * @generated * @see org.eclipse.sirius.components.view.diagram.OutsideLabelDescription#getConditionalStyles() * @see #getOutsideLabelDescription() - * @generated */ EReference getOutsideLabelDescription_ConditionalStyles(); @@ -4383,9 +4403,9 @@ public interface DiagramPackage extends EPackage { * Color}'. * * @return the meta object for the reference 'Color'. + * @generated * @see org.eclipse.sirius.components.view.diagram.Style#getColor() * @see #getStyle() - * @generated */ EReference getStyle_Color(); @@ -4394,8 +4414,8 @@ public interface DiagramPackage extends EPackage { * Style}'. * * @return the meta object for class 'Border Style'. - * @see org.eclipse.sirius.components.view.diagram.BorderStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.BorderStyle */ EClass getBorderStyle(); @@ -4441,9 +4461,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the attribute 'Border Line Style'. + * @generated * @see org.eclipse.sirius.components.view.diagram.BorderStyle#getBorderLineStyle() * @see #getBorderStyle() - * @generated */ EAttribute getBorderStyle_BorderLineStyle(); @@ -4452,8 +4472,8 @@ public interface DiagramPackage extends EPackage { * Label Style}'. * * @return the meta object for class 'Inside Label Style'. - * @see org.eclipse.sirius.components.view.diagram.InsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.InsideLabelStyle */ EClass getInsideLabelStyle(); @@ -4475,9 +4495,9 @@ public interface DiagramPackage extends EPackage { * Separator}'. * * @return the meta object for the attribute 'Display Header Separator'. + * @generated * @see org.eclipse.sirius.components.view.diagram.InsideLabelStyle#isDisplayHeaderSeparator() * @see #getInsideLabelStyle() - * @generated */ EAttribute getInsideLabelStyle_DisplayHeaderSeparator(); @@ -4486,8 +4506,8 @@ public interface DiagramPackage extends EPackage { * Outside Label Style}'. * * @return the meta object for class 'Outside Label Style'. - * @see org.eclipse.sirius.components.view.diagram.OutsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.OutsideLabelStyle */ EClass getOutsideLabelStyle(); @@ -4496,8 +4516,8 @@ public interface DiagramPackage extends EPackage { * Label Style}'. * * @return the meta object for class 'Node Label Style'. - * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle */ EClass getNodeLabelStyle(); @@ -4531,9 +4551,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Show Icon Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle#getShowIconExpression() * @see #getNodeLabelStyle() - * @generated */ EAttribute getNodeLabelStyle_ShowIconExpression(); @@ -4555,9 +4575,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Max Width Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle#getMaxWidthExpression() * @see #getNodeLabelStyle() - * @generated */ EAttribute getNodeLabelStyle_MaxWidthExpression(); @@ -4566,18 +4586,40 @@ public interface DiagramPackage extends EPackage { * Node Style Description}'. * * @return the meta object for class 'Node Style Description'. - * @see org.eclipse.sirius.components.view.diagram.NodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeStyleDescription */ EClass getNodeStyleDescription(); + /** + * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription + * Style Description}'. + * + * @return the meta object for class 'Style Description'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramStyleDescription + */ + EClass getDiagramStyleDescription(); + + /** + * Returns the meta object for the reference + * '{@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription#getBackground Background}'. + * + * + * @return the meta object for the reference 'Background'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramStyleDescription#getBackground() + * @see #getDiagramStyleDescription() + */ + EReference getDiagramStyleDescription_Background(); + /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle * Conditional Node Style}'. * * @return the meta object for class 'Conditional Node Style'. - * @see org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle */ EClass getConditionalNodeStyle(); @@ -4593,13 +4635,35 @@ public interface DiagramPackage extends EPackage { */ EReference getConditionalNodeStyle_Style(); + /** + * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle + * Conditional Diagram Style}'. + * + * @return the meta object for class 'Conditional Diagram Style'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle + */ + EClass getConditionalDiagramStyle(); + + /** + * Returns the meta object for the containment reference + * '{@link org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle#getStyle Style}'. + * + * @return the meta object for the containment reference 'Style'. + * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle#getStyle() + * @see #getConditionalDiagramStyle() + */ + EReference getConditionalDiagramStyle_Style(); + /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle * Conditional Inside Label Style}'. * * @return the meta object for class 'Conditional Inside Label Style'. - * @see org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle */ EClass getConditionalInsideLabelStyle(); @@ -4620,8 +4684,8 @@ public interface DiagramPackage extends EPackage { * Conditional Outside Label Style}'. * * @return the meta object for class 'Conditional Outside Label Style'. - * @see org.eclipse.sirius.components.view.diagram.ConditionalOutsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalOutsideLabelStyle */ EClass getConditionalOutsideLabelStyle(); @@ -4643,8 +4707,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Rectangular Node Style Description'. - * @see org.eclipse.sirius.components.view.diagram.RectangularNodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.RectangularNodeStyleDescription */ EClass getRectangularNodeStyleDescription(); @@ -4654,9 +4718,9 @@ public interface DiagramPackage extends EPackage { * Background}'. * * @return the meta object for the reference 'Background'. + * @generated * @see org.eclipse.sirius.components.view.diagram.RectangularNodeStyleDescription#getBackground() * @see #getRectangularNodeStyleDescription() - * @generated */ EReference getRectangularNodeStyleDescription_Background(); @@ -4665,8 +4729,8 @@ public interface DiagramPackage extends EPackage { * Image Node Style Description}'. * * @return the meta object for class 'Image Node Style Description'. - * @see org.eclipse.sirius.components.view.diagram.ImageNodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.ImageNodeStyleDescription */ EClass getImageNodeStyleDescription(); @@ -4688,9 +4752,9 @@ public interface DiagramPackage extends EPackage { * Position Dependent Rotation}'. * * @return the meta object for the attribute 'Position Dependent Rotation'. + * @generated * @see org.eclipse.sirius.components.view.diagram.ImageNodeStyleDescription#isPositionDependentRotation() * @see #getImageNodeStyleDescription() - * @generated */ EAttribute getImageNodeStyleDescription_PositionDependentRotation(); @@ -4700,8 +4764,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Icon Label Node Style Description'. - * @see org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription */ EClass getIconLabelNodeStyleDescription(); @@ -4711,9 +4775,9 @@ public interface DiagramPackage extends EPackage { * Background}'. * * @return the meta object for the reference 'Background'. + * @generated * @see org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription#getBackground() * @see #getIconLabelNodeStyleDescription() - * @generated */ EReference getIconLabelNodeStyleDescription_Background(); @@ -4722,8 +4786,8 @@ public interface DiagramPackage extends EPackage { * Style}'. * * @return the meta object for class 'Edge Style'. - * @see org.eclipse.sirius.components.view.diagram.EdgeStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeStyle */ EClass getEdgeStyle(); @@ -4745,9 +4809,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the attribute 'Source Arrow Style'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeStyle#getSourceArrowStyle() * @see #getEdgeStyle() - * @generated */ EAttribute getEdgeStyle_SourceArrowStyle(); @@ -4757,9 +4821,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the attribute 'Target Arrow Style'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeStyle#getTargetArrowStyle() * @see #getEdgeStyle() - * @generated */ EAttribute getEdgeStyle_TargetArrowStyle(); @@ -4780,9 +4844,9 @@ public interface DiagramPackage extends EPackage { * Show Icon}'. * * @return the meta object for the attribute 'Show Icon'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeStyle#isShowIcon() * @see #getEdgeStyle() - * @generated */ EAttribute getEdgeStyle_ShowIcon(); @@ -4816,9 +4880,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Max Width Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeStyle#getMaxWidthExpression() * @see #getEdgeStyle() - * @generated */ EAttribute getEdgeStyle_MaxWidthExpression(); @@ -4827,8 +4891,8 @@ public interface DiagramPackage extends EPackage { * Conditional Edge Style}'. * * @return the meta object for class 'Conditional Edge Style'. - * @see org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle */ EClass getConditionalEdgeStyle(); @@ -4837,8 +4901,8 @@ public interface DiagramPackage extends EPackage { * Palette}'. * * @return the meta object for class 'Palette'. - * @see org.eclipse.sirius.components.view.diagram.DiagramPalette * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPalette */ EClass getDiagramPalette(); @@ -4895,8 +4959,8 @@ public interface DiagramPackage extends EPackage { * Palette}'. * * @return the meta object for class 'Node Palette'. - * @see org.eclipse.sirius.components.view.diagram.NodePalette * @generated + * @see org.eclipse.sirius.components.view.diagram.NodePalette */ EClass getNodePalette(); @@ -4977,8 +5041,8 @@ public interface DiagramPackage extends EPackage { * Palette}'. * * @return the meta object for class 'Edge Palette'. - * @see org.eclipse.sirius.components.view.diagram.EdgePalette * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgePalette */ EClass getEdgePalette(); @@ -5000,9 +5064,9 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for the containment reference 'Center Label Edit Tool'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgePalette#getCenterLabelEditTool() * @see #getEdgePalette() - * @generated */ EReference getEdgePalette_CenterLabelEditTool(); @@ -5012,9 +5076,9 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for the containment reference 'Begin Label Edit Tool'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgePalette#getBeginLabelEditTool() * @see #getEdgePalette() - * @generated */ EReference getEdgePalette_BeginLabelEditTool(); @@ -5024,9 +5088,9 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for the containment reference 'End Label Edit Tool'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgePalette#getEndLabelEditTool() * @see #getEdgePalette() - * @generated */ EReference getEdgePalette_EndLabelEditTool(); @@ -5048,9 +5112,9 @@ public interface DiagramPackage extends EPackage { * Tools}'. * * @return the meta object for the containment reference list 'Edge Reconnection Tools'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgePalette#getEdgeReconnectionTools() * @see #getEdgePalette() - * @generated */ EReference getEdgePalette_EdgeReconnectionTools(); @@ -5081,9 +5145,9 @@ public interface DiagramPackage extends EPackage { * Name}'. * * @return the meta object for the attribute 'Name'. + * @generated * @see org.eclipse.sirius.components.view.diagram.Tool#getName() * @see #getTool() - * @generated */ EAttribute getTool_Name(); @@ -5093,9 +5157,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Precondition Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.Tool#getPreconditionExpression() * @see #getTool() - * @generated */ EAttribute getTool_PreconditionExpression(); @@ -5105,9 +5169,9 @@ public interface DiagramPackage extends EPackage { * end-user-doc --> * * @return the meta object for the containment reference list 'Body'. + * @generated * @see org.eclipse.sirius.components.view.diagram.Tool#getBody() * @see #getTool() - * @generated */ EReference getTool_Body(); @@ -5116,8 +5180,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Delete Tool'. - * @see org.eclipse.sirius.components.view.diagram.DeleteTool * @generated + * @see org.eclipse.sirius.components.view.diagram.DeleteTool */ EClass getDeleteTool(); @@ -5126,8 +5190,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Drop Tool'. - * @see org.eclipse.sirius.components.view.diagram.DropTool * @generated + * @see org.eclipse.sirius.components.view.diagram.DropTool */ EClass getDropTool(); @@ -5136,8 +5200,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Edge Tool'. - * @see org.eclipse.sirius.components.view.diagram.EdgeTool * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeTool */ EClass getEdgeTool(); @@ -5147,9 +5211,9 @@ public interface DiagramPackage extends EPackage { * Descriptions}'. * * @return the meta object for the reference list 'Target Element Descriptions'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeTool#getTargetElementDescriptions() * @see #getEdgeTool() - * @generated */ EReference getEdgeTool_TargetElementDescriptions(); @@ -5159,9 +5223,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Icon UR Ls Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.EdgeTool#getIconURLsExpression() * @see #getEdgeTool() - * @generated */ EAttribute getEdgeTool_IconURLsExpression(); @@ -5170,8 +5234,8 @@ public interface DiagramPackage extends EPackage { * Edge Reconnection Tool}'. * * @return the meta object for class 'Edge Reconnection Tool'. - * @see org.eclipse.sirius.components.view.diagram.EdgeReconnectionTool * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeReconnectionTool */ EClass getEdgeReconnectionTool(); @@ -5180,8 +5244,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Label Edit Tool'. - * @see org.eclipse.sirius.components.view.diagram.LabelEditTool * @generated + * @see org.eclipse.sirius.components.view.diagram.LabelEditTool */ EClass getLabelEditTool(); @@ -5191,9 +5255,9 @@ public interface DiagramPackage extends EPackage { * Direct Edit Label Expression}'. * * @return the meta object for the attribute 'Initial Direct Edit Label Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelEditTool#getInitialDirectEditLabelExpression() * @see #getLabelEditTool() - * @generated */ EAttribute getLabelEditTool_InitialDirectEditLabelExpression(); @@ -5202,8 +5266,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Node Tool'. - * @see org.eclipse.sirius.components.view.diagram.NodeTool * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeTool */ EClass getNodeTool(); @@ -5213,9 +5277,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the containment reference 'Dialog Description'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeTool#getDialogDescription() * @see #getNodeTool() - * @generated */ EReference getNodeTool_DialogDescription(); @@ -5225,9 +5289,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Icon UR Ls Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeTool#getIconURLsExpression() * @see #getNodeTool() - * @generated */ EAttribute getNodeTool_IconURLsExpression(); @@ -5237,8 +5301,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Source Edge End Reconnection Tool'. - * @see org.eclipse.sirius.components.view.diagram.SourceEdgeEndReconnectionTool * @generated + * @see org.eclipse.sirius.components.view.diagram.SourceEdgeEndReconnectionTool */ EClass getSourceEdgeEndReconnectionTool(); @@ -5248,8 +5312,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Target Edge End Reconnection Tool'. - * @see org.eclipse.sirius.components.view.diagram.TargetEdgeEndReconnectionTool * @generated + * @see org.eclipse.sirius.components.view.diagram.TargetEdgeEndReconnectionTool */ EClass getTargetEdgeEndReconnectionTool(); @@ -5258,8 +5322,8 @@ public interface DiagramPackage extends EPackage { * View}'. * * @return the meta object for class 'Create View'. - * @see org.eclipse.sirius.components.view.diagram.CreateView * @generated + * @see org.eclipse.sirius.components.view.diagram.CreateView */ EClass getCreateView(); @@ -5269,9 +5333,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Parent View Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.CreateView#getParentViewExpression() * @see #getCreateView() - * @generated */ EAttribute getCreateView_ParentViewExpression(); @@ -5281,9 +5345,9 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for the reference 'Element Description'. + * @generated * @see org.eclipse.sirius.components.view.diagram.CreateView#getElementDescription() * @see #getCreateView() - * @generated */ EReference getCreateView_ElementDescription(); @@ -5293,9 +5357,9 @@ public interface DiagramPackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Semantic Element Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.CreateView#getSemanticElementExpression() * @see #getCreateView() - * @generated */ EAttribute getCreateView_SemanticElementExpression(); @@ -5317,9 +5381,9 @@ public interface DiagramPackage extends EPackage { * * * @return the meta object for the attribute 'Containment Kind'. + * @generated * @see org.eclipse.sirius.components.view.diagram.CreateView#getContainmentKind() * @see #getCreateView() - * @generated */ EAttribute getCreateView_ContainmentKind(); @@ -5328,8 +5392,8 @@ public interface DiagramPackage extends EPackage { * View}'. * * @return the meta object for class 'Delete View'. - * @see org.eclipse.sirius.components.view.diagram.DeleteView * @generated + * @see org.eclipse.sirius.components.view.diagram.DeleteView */ EClass getDeleteView(); @@ -5350,8 +5414,8 @@ public interface DiagramPackage extends EPackage { * Selection Dialog Description}'. * * @return the meta object for class 'Selection Dialog Description'. - * @see org.eclipse.sirius.components.view.diagram.SelectionDialogDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.SelectionDialogDescription */ EClass getSelectionDialogDescription(); @@ -5361,9 +5425,9 @@ public interface DiagramPackage extends EPackage { * Message}'. * * @return the meta object for the attribute 'Selection Message'. + * @generated * @see org.eclipse.sirius.components.view.diagram.SelectionDialogDescription#getSelectionMessage() * @see #getSelectionDialogDescription() - * @generated */ EAttribute getSelectionDialogDescription_SelectionMessage(); @@ -5373,9 +5437,9 @@ public interface DiagramPackage extends EPackage { * Selection Dialog Tree Description}'. * * @return the meta object for the containment reference 'Selection Dialog Tree Description'. + * @generated * @see org.eclipse.sirius.components.view.diagram.SelectionDialogDescription#getSelectionDialogTreeDescription() * @see #getSelectionDialogDescription() - * @generated */ EReference getSelectionDialogDescription_SelectionDialogTreeDescription(); @@ -5384,8 +5448,8 @@ public interface DiagramPackage extends EPackage { * Section}'. * * @return the meta object for class 'Tool Section'. - * @see org.eclipse.sirius.components.view.diagram.ToolSection * @generated + * @see org.eclipse.sirius.components.view.diagram.ToolSection */ EClass getToolSection(); @@ -5394,9 +5458,9 @@ public interface DiagramPackage extends EPackage { * Name}'. * * @return the meta object for the attribute 'Name'. + * @generated * @see org.eclipse.sirius.components.view.diagram.ToolSection#getName() * @see #getToolSection() - * @generated */ EAttribute getToolSection_Name(); @@ -5405,8 +5469,8 @@ public interface DiagramPackage extends EPackage { * Section}'. * * @return the meta object for class 'Tool Section'. - * @see org.eclipse.sirius.components.view.diagram.DiagramToolSection * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramToolSection */ EClass getDiagramToolSection(); @@ -5427,8 +5491,8 @@ public interface DiagramPackage extends EPackage { * Tool Section}'. * * @return the meta object for class 'Node Tool Section'. - * @see org.eclipse.sirius.components.view.diagram.NodeToolSection * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeToolSection */ EClass getNodeToolSection(); @@ -5461,8 +5525,8 @@ public interface DiagramPackage extends EPackage { * Tool Section}'. * * @return the meta object for class 'Edge Tool Section'. - * @see org.eclipse.sirius.components.view.diagram.EdgeToolSection * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeToolSection */ EClass getEdgeToolSection(); @@ -5483,8 +5547,8 @@ public interface DiagramPackage extends EPackage { * Tool}'. * * @return the meta object for class 'Drop Node Tool'. - * @see org.eclipse.sirius.components.view.diagram.DropNodeTool * @generated + * @see org.eclipse.sirius.components.view.diagram.DropNodeTool */ EClass getDropNodeTool(); @@ -5494,9 +5558,9 @@ public interface DiagramPackage extends EPackage { * Types}'. * * @return the meta object for the reference list 'Accepted Node Types'. + * @generated * @see org.eclipse.sirius.components.view.diagram.DropNodeTool#getAcceptedNodeTypes() * @see #getDropNodeTool() - * @generated */ EReference getDropNodeTool_AcceptedNodeTypes(); @@ -5505,8 +5569,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Dialog Description'. - * @see org.eclipse.sirius.components.view.diagram.DialogDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.DialogDescription */ EClass getDialogDescription(); @@ -5516,8 +5580,8 @@ public interface DiagramPackage extends EPackage { * Description}'. * * @return the meta object for class 'Selection Dialog Tree Description'. - * @see org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription */ EClass getSelectionDialogTreeDescription(); @@ -5527,9 +5591,9 @@ public interface DiagramPackage extends EPackage { * Elements Expression}'. * * @return the meta object for the attribute 'Elements Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription#getElementsExpression() * @see #getSelectionDialogTreeDescription() - * @generated */ EAttribute getSelectionDialogTreeDescription_ElementsExpression(); @@ -5539,9 +5603,9 @@ public interface DiagramPackage extends EPackage { * Children Expression}'. * * @return the meta object for the attribute 'Children Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription#getChildrenExpression() * @see #getSelectionDialogTreeDescription() - * @generated */ EAttribute getSelectionDialogTreeDescription_ChildrenExpression(); @@ -5551,9 +5615,9 @@ public interface DiagramPackage extends EPackage { * Is Selectable Expression}'. * * @return the meta object for the attribute 'Is Selectable Expression'. + * @generated * @see org.eclipse.sirius.components.view.diagram.SelectionDialogTreeDescription#getIsSelectableExpression() * @see #getSelectionDialogTreeDescription() - * @generated */ EAttribute getSelectionDialogTreeDescription_IsSelectableExpression(); @@ -5562,8 +5626,8 @@ public interface DiagramPackage extends EPackage { * Style}'. * * @return the meta object for enum 'Arrow Style'. - * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ArrowStyle */ EEnum getArrowStyle(); @@ -5572,8 +5636,8 @@ public interface DiagramPackage extends EPackage { * Direction}'. * * @return the meta object for enum 'Layout Direction'. - * @see org.eclipse.sirius.components.view.diagram.LayoutDirection * @generated + * @see org.eclipse.sirius.components.view.diagram.LayoutDirection */ EEnum getLayoutDirection(); @@ -5582,8 +5646,8 @@ public interface DiagramPackage extends EPackage { * Style}'. * * @return the meta object for enum 'Line Style'. - * @see org.eclipse.sirius.components.view.diagram.LineStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.LineStyle */ EEnum getLineStyle(); @@ -5592,8 +5656,8 @@ public interface DiagramPackage extends EPackage { * Containment Kind}'. * * @return the meta object for enum 'Node Containment Kind'. - * @see org.eclipse.sirius.components.view.diagram.NodeContainmentKind * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeContainmentKind */ EEnum getNodeContainmentKind(); @@ -5602,8 +5666,8 @@ public interface DiagramPackage extends EPackage { * Synchronization Policy}'. * * @return the meta object for enum 'Synchronization Policy'. - * @see org.eclipse.sirius.components.view.diagram.SynchronizationPolicy * @generated + * @see org.eclipse.sirius.components.view.diagram.SynchronizationPolicy */ EEnum getSynchronizationPolicy(); @@ -5612,8 +5676,8 @@ public interface DiagramPackage extends EPackage { * Inside Label Position}'. * * @return the meta object for enum 'Inside Label Position'. - * @see org.eclipse.sirius.components.view.diagram.InsideLabelPosition * @generated + * @see org.eclipse.sirius.components.view.diagram.InsideLabelPosition */ EEnum getInsideLabelPosition(); @@ -5622,8 +5686,8 @@ public interface DiagramPackage extends EPackage { * Outside Label Position}'. * * @return the meta object for enum 'Outside Label Position'. - * @see org.eclipse.sirius.components.view.diagram.OutsideLabelPosition * @generated + * @see org.eclipse.sirius.components.view.diagram.OutsideLabelPosition */ EEnum getOutsideLabelPosition(); @@ -5632,8 +5696,8 @@ public interface DiagramPackage extends EPackage { * Label Overflow Strategy}'. * * @return the meta object for enum 'Label Overflow Strategy'. - * @see org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy * @generated + * @see org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy */ EEnum getLabelOverflowStrategy(); @@ -5642,8 +5706,8 @@ public interface DiagramPackage extends EPackage { * Arrange Layout Direction}'. * * @return the meta object for enum 'Arrange Layout Direction'. - * @see org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection * @generated + * @see org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection */ EEnum getArrangeLayoutDirection(); @@ -5652,8 +5716,8 @@ public interface DiagramPackage extends EPackage { * Align}'. * * @return the meta object for enum 'Label Text Align'. - * @see org.eclipse.sirius.components.view.diagram.LabelTextAlign * @generated + * @see org.eclipse.sirius.components.view.diagram.LabelTextAlign */ EEnum getLabelTextAlign(); @@ -5662,8 +5726,8 @@ public interface DiagramPackage extends EPackage { * User Resizable Direction}'. * * @return the meta object for enum 'User Resizable Direction'. - * @see org.eclipse.sirius.components.view.diagram.UserResizableDirection * @generated + * @see org.eclipse.sirius.components.view.diagram.UserResizableDirection */ EEnum getUserResizableDirection(); @@ -5695,9 +5759,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl Description}' class. * * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramDescription() - * @generated */ EClass DIAGRAM_DESCRIPTION = eINSTANCE.getDiagramDescription(); @@ -5741,14 +5805,30 @@ interface Literals { */ EAttribute DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION = eINSTANCE.getDiagramDescription_ArrangeLayoutDirection(); + /** + * The meta object literal for the 'Style' containment reference feature. + * + * @generated + */ + EReference DIAGRAM_DESCRIPTION__STYLE = eINSTANCE.getDiagramDescription_Style(); + + /** + * The meta object literal for the 'Conditional Styles' containment reference list feature. + * + * @generated + */ + EReference DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES = eINSTANCE.getDiagramDescription_ConditionalStyles(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramElementDescriptionImpl Element * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramElementDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramElementDescription() - * @generated */ EClass DIAGRAM_ELEMENT_DESCRIPTION = eINSTANCE.getDiagramElementDescription(); @@ -5796,9 +5876,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodeDescriptionImpl * Node Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodeDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeDescription() - * @generated */ EClass NODE_DESCRIPTION = eINSTANCE.getNodeDescription(); @@ -5950,9 +6030,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeDescriptionImpl * Edge Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeDescription() - * @generated */ EClass EDGE_DESCRIPTION = eINSTANCE.getEdgeDescription(); @@ -6048,9 +6128,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription * Layout Strategy Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLayoutStrategyDescription() - * @generated */ EClass LAYOUT_STRATEGY_DESCRIPTION = eINSTANCE.getLayoutStrategyDescription(); @@ -6059,9 +6139,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.ListLayoutStrategyDescriptionImpl List Layout * Strategy Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ListLayoutStrategyDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getListLayoutStrategyDescription() - * @generated */ EClass LIST_LAYOUT_STRATEGY_DESCRIPTION = eINSTANCE.getListLayoutStrategyDescription(); @@ -6102,9 +6182,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.FreeFormLayoutStrategyDescriptionImpl Free Form * Layout Strategy Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.FreeFormLayoutStrategyDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getFreeFormLayoutStrategyDescription() - * @generated */ EClass FREE_FORM_LAYOUT_STRATEGY_DESCRIPTION = eINSTANCE.getFreeFormLayoutStrategyDescription(); @@ -6112,9 +6192,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.LabelDescriptionImpl * Label Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.LabelDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelDescription() - * @generated */ EClass LABEL_DESCRIPTION = eINSTANCE.getLabelDescription(); @@ -6147,9 +6227,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.InsideLabelDescriptionImpl Inside Label * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.InsideLabelDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getInsideLabelDescription() - * @generated */ EClass INSIDE_LABEL_DESCRIPTION = eINSTANCE.getInsideLabelDescription(); @@ -6182,9 +6262,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelDescriptionImpl Outside Label * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.OutsideLabelDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getOutsideLabelDescription() - * @generated */ EClass OUTSIDE_LABEL_DESCRIPTION = eINSTANCE.getOutsideLabelDescription(); @@ -6216,9 +6296,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.StyleImpl * Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.StyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getStyle() - * @generated */ EClass STYLE = eINSTANCE.getStyle(); @@ -6234,9 +6314,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.BorderStyle Border * Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.BorderStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getBorderStyle() - * @generated */ EClass BORDER_STYLE = eINSTANCE.getBorderStyle(); @@ -6276,9 +6356,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.InsideLabelStyleImpl * Inside Label Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.InsideLabelStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getInsideLabelStyle() - * @generated */ EClass INSIDE_LABEL_STYLE = eINSTANCE.getInsideLabelStyle(); @@ -6302,9 +6382,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl * Outside Label Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.OutsideLabelStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getOutsideLabelStyle() - * @generated */ EClass OUTSIDE_LABEL_STYLE = eINSTANCE.getOutsideLabelStyle(); @@ -6312,9 +6392,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.NodeLabelStyle Node * Label Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeLabelStyle() - * @generated */ EClass NODE_LABEL_STYLE = eINSTANCE.getNodeLabelStyle(); @@ -6362,20 +6442,39 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.NodeStyleDescription * Node Style Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeStyleDescription * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeStyleDescription() - * @generated */ EClass NODE_STYLE_DESCRIPTION = eINSTANCE.getNodeStyleDescription(); + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramStyleDescriptionImpl Style + * Description}' class. + * + * @generated + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramStyleDescriptionImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramStyleDescription() + */ + EClass DIAGRAM_STYLE_DESCRIPTION = eINSTANCE.getDiagramStyleDescription(); + + /** + * The meta object literal for the 'Background' reference feature. + * + * @generated + */ + EReference DIAGRAM_STYLE_DESCRIPTION__BACKGROUND = eINSTANCE.getDiagramStyleDescription_Background(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalNodeStyleImpl Conditional Node * Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalNodeStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalNodeStyle() - * @generated */ EClass CONDITIONAL_NODE_STYLE = eINSTANCE.getConditionalNodeStyle(); @@ -6387,14 +6486,33 @@ interface Literals { */ EReference CONDITIONAL_NODE_STYLE__STYLE = eINSTANCE.getConditionalNodeStyle_Style(); + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalDiagramStyleImpl Conditional Diagram + * Style}' class. + * + * @generated + * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalDiagramStyleImpl + * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalDiagramStyle() + */ + EClass CONDITIONAL_DIAGRAM_STYLE = eINSTANCE.getConditionalDiagramStyle(); + + /** + * The meta object literal for the 'Style' containment reference feature. + * + * @generated + */ + EReference CONDITIONAL_DIAGRAM_STYLE__STYLE = eINSTANCE.getConditionalDiagramStyle_Style(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalInsideLabelStyleImpl Conditional * Inside Label Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalInsideLabelStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalInsideLabelStyle() - * @generated */ EClass CONDITIONAL_INSIDE_LABEL_STYLE = eINSTANCE.getConditionalInsideLabelStyle(); @@ -6411,9 +6529,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalOutsideLabelStyleImpl Conditional * Outside Label Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalOutsideLabelStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalOutsideLabelStyle() - * @generated */ EClass CONDITIONAL_OUTSIDE_LABEL_STYLE = eINSTANCE.getConditionalOutsideLabelStyle(); @@ -6430,9 +6548,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.RectangularNodeStyleDescriptionImpl Rectangular * Node Style Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.RectangularNodeStyleDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getRectangularNodeStyleDescription() - * @generated */ EClass RECTANGULAR_NODE_STYLE_DESCRIPTION = eINSTANCE.getRectangularNodeStyleDescription(); @@ -6449,9 +6567,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.ImageNodeStyleDescriptionImpl Image Node Style * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ImageNodeStyleDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getImageNodeStyleDescription() - * @generated */ EClass IMAGE_NODE_STYLE_DESCRIPTION = eINSTANCE.getImageNodeStyleDescription(); @@ -6476,9 +6594,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.IconLabelNodeStyleDescriptionImpl Icon Label Node * Style Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.IconLabelNodeStyleDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getIconLabelNodeStyleDescription() - * @generated */ EClass ICON_LABEL_NODE_STYLE_DESCRIPTION = eINSTANCE.getIconLabelNodeStyleDescription(); @@ -6494,9 +6612,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl * Edge Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeStyle() - * @generated */ EClass EDGE_STYLE = eINSTANCE.getEdgeStyle(); @@ -6569,9 +6687,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl Conditional Edge * Style}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ConditionalEdgeStyleImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getConditionalEdgeStyle() - * @generated */ EClass CONDITIONAL_EDGE_STYLE = eINSTANCE.getConditionalEdgeStyle(); @@ -6579,9 +6697,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramPaletteImpl * Palette}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPaletteImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramPalette() - * @generated */ EClass DIAGRAM_PALETTE = eINSTANCE.getDiagramPalette(); @@ -6621,9 +6739,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodePaletteImpl * Node Palette}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodePaletteImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodePalette() - * @generated */ EClass NODE_PALETTE = eINSTANCE.getNodePalette(); @@ -6679,9 +6797,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgePaletteImpl * Edge Palette}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgePaletteImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgePalette() - * @generated */ EClass EDGE_PALETTE = eINSTANCE.getEdgePalette(); @@ -6745,9 +6863,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.ToolImpl * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getTool() - * @generated */ EClass TOOL = eINSTANCE.getTool(); @@ -6779,9 +6897,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.DeleteToolImpl * Delete Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DeleteToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDeleteTool() - * @generated */ EClass DELETE_TOOL = eINSTANCE.getDeleteTool(); @@ -6789,9 +6907,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.DropToolImpl Drop * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DropToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDropTool() - * @generated */ EClass DROP_TOOL = eINSTANCE.getDropTool(); @@ -6799,9 +6917,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeToolImpl Edge * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeTool() - * @generated */ EClass EDGE_TOOL = eINSTANCE.getEdgeTool(); @@ -6826,9 +6944,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeReconnectionToolImpl Edge Reconnection * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeReconnectionToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeReconnectionTool() - * @generated */ EClass EDGE_RECONNECTION_TOOL = eINSTANCE.getEdgeReconnectionTool(); @@ -6836,9 +6954,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.LabelEditToolImpl * Label Edit Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.LabelEditToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelEditTool() - * @generated */ EClass LABEL_EDIT_TOOL = eINSTANCE.getLabelEditTool(); @@ -6854,9 +6972,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodeToolImpl Node * Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodeToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeTool() - * @generated */ EClass NODE_TOOL = eINSTANCE.getNodeTool(); @@ -6881,9 +6999,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.SourceEdgeEndReconnectionToolImpl Source Edge End * Reconnection Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.SourceEdgeEndReconnectionToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSourceEdgeEndReconnectionTool() - * @generated */ EClass SOURCE_EDGE_END_RECONNECTION_TOOL = eINSTANCE.getSourceEdgeEndReconnectionTool(); @@ -6892,9 +7010,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.TargetEdgeEndReconnectionToolImpl Target Edge End * Reconnection Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.TargetEdgeEndReconnectionToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getTargetEdgeEndReconnectionTool() - * @generated */ EClass TARGET_EDGE_END_RECONNECTION_TOOL = eINSTANCE.getTargetEdgeEndReconnectionTool(); @@ -6902,9 +7020,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.CreateViewImpl * Create View}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.CreateViewImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getCreateView() - * @generated */ EClass CREATE_VIEW = eINSTANCE.getCreateView(); @@ -6952,9 +7070,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.DeleteViewImpl * Delete View}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DeleteViewImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDeleteView() - * @generated */ EClass DELETE_VIEW = eINSTANCE.getDeleteView(); @@ -6971,9 +7089,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.SelectionDialogDescriptionImpl Selection Dialog * Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.SelectionDialogDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSelectionDialogDescription() - * @generated */ EClass SELECTION_DIALOG_DESCRIPTION = eINSTANCE.getSelectionDialogDescription(); @@ -6997,9 +7115,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.ToolSectionImpl * Tool Section}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.ToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getToolSection() - * @generated */ EClass TOOL_SECTION = eINSTANCE.getToolSection(); @@ -7016,9 +7134,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.DiagramToolSectionImpl Tool Section}' class. * * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DiagramToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDiagramToolSection() - * @generated */ EClass DIAGRAM_TOOL_SECTION = eINSTANCE.getDiagramToolSection(); @@ -7034,9 +7152,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.NodeToolSectionImpl * Node Tool Section}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.NodeToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeToolSection() - * @generated */ EClass NODE_TOOL_SECTION = eINSTANCE.getNodeToolSection(); @@ -7060,9 +7178,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.EdgeToolSectionImpl * Edge Tool Section}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.EdgeToolSectionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getEdgeToolSection() - * @generated */ EClass EDGE_TOOL_SECTION = eINSTANCE.getEdgeToolSection(); @@ -7078,9 +7196,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.DropNodeToolImpl * Drop Node Tool}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DropNodeToolImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDropNodeTool() - * @generated */ EClass DROP_NODE_TOOL = eINSTANCE.getDropNodeTool(); @@ -7096,9 +7214,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.impl.DialogDescriptionImpl * Dialog Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.DialogDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getDialogDescription() - * @generated */ EClass DIALOG_DESCRIPTION = eINSTANCE.getDialogDescription(); @@ -7107,9 +7225,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.diagram.impl.SelectionDialogTreeDescriptionImpl Selection * Dialog Tree Description}' class. * + * @generated * @see org.eclipse.sirius.components.view.diagram.impl.SelectionDialogTreeDescriptionImpl * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSelectionDialogTreeDescription() - * @generated */ EClass SELECTION_DIALOG_TREE_DESCRIPTION = eINSTANCE.getSelectionDialogTreeDescription(); @@ -7141,9 +7259,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.ArrowStyle Arrow * Style}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrowStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getArrowStyle() - * @generated */ EEnum ARROW_STYLE = eINSTANCE.getArrowStyle(); @@ -7151,9 +7269,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.LayoutDirection Layout * Direction}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LayoutDirection * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLayoutDirection() - * @generated */ EEnum LAYOUT_DIRECTION = eINSTANCE.getLayoutDirection(); @@ -7161,9 +7279,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.LineStyle Line * Style}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LineStyle * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLineStyle() - * @generated */ EEnum LINE_STYLE = eINSTANCE.getLineStyle(); @@ -7171,9 +7289,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.NodeContainmentKind * Node Containment Kind}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.NodeContainmentKind * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getNodeContainmentKind() - * @generated */ EEnum NODE_CONTAINMENT_KIND = eINSTANCE.getNodeContainmentKind(); @@ -7181,9 +7299,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.SynchronizationPolicy * Synchronization Policy}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.SynchronizationPolicy * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getSynchronizationPolicy() - * @generated */ EEnum SYNCHRONIZATION_POLICY = eINSTANCE.getSynchronizationPolicy(); @@ -7191,9 +7309,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.InsideLabelPosition * Inside Label Position}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.InsideLabelPosition * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getInsideLabelPosition() - * @generated */ EEnum INSIDE_LABEL_POSITION = eINSTANCE.getInsideLabelPosition(); @@ -7201,9 +7319,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.OutsideLabelPosition * Outside Label Position}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.OutsideLabelPosition * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getOutsideLabelPosition() - * @generated */ EEnum OUTSIDE_LABEL_POSITION = eINSTANCE.getOutsideLabelPosition(); @@ -7211,9 +7329,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy * Label Overflow Strategy}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelOverflowStrategy * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelOverflowStrategy() - * @generated */ EEnum LABEL_OVERFLOW_STRATEGY = eINSTANCE.getLabelOverflowStrategy(); @@ -7221,9 +7339,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection * Arrange Layout Direction}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getArrangeLayoutDirection() - * @generated */ EEnum ARRANGE_LAYOUT_DIRECTION = eINSTANCE.getArrangeLayoutDirection(); @@ -7231,9 +7349,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.LabelTextAlign Label * Text Align}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.LabelTextAlign * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getLabelTextAlign() - * @generated */ EEnum LABEL_TEXT_ALIGN = eINSTANCE.getLabelTextAlign(); @@ -7241,9 +7359,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.diagram.UserResizableDirection * User Resizable Direction}' enum. * + * @generated * @see org.eclipse.sirius.components.view.diagram.UserResizableDirection * @see org.eclipse.sirius.components.view.diagram.impl.DiagramPackageImpl#getUserResizableDirection() - * @generated */ EEnum USER_RESIZABLE_DIRECTION = eINSTANCE.getUserResizableDirection(); diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramStyleDescription.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramStyleDescription.java new file mode 100644 index 0000000000..01d3e4ccf5 --- /dev/null +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/DiagramStyleDescription.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * 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; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.sirius.components.view.UserColor; + +/** + * A representation of the model object 'Style Description'. + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription#getBackground Background}
    • + *
    + * + * @model + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage#getDiagramStyleDescription() + */ +public interface DiagramStyleDescription extends EObject { + + /** + * 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#getDiagramStyleDescription_Background() + */ + UserColor getBackground(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription#getBackground + * Background}' reference. + * + * @param value + * the new value of the 'Background' reference. + * @generated + * @see #getBackground() + */ + void setBackground(UserColor value); + +} // DiagramStyleDescription diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalDiagramStyleImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalDiagramStyleImpl.java new file mode 100644 index 0000000000..b62e7f8787 --- /dev/null +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/ConditionalDiagramStyleImpl.java @@ -0,0 +1,188 @@ +/******************************************************************************* + * 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 org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +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.diagram.ConditionalDiagramStyle; +import org.eclipse.sirius.components.view.diagram.DiagramPackage; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; +import org.eclipse.sirius.components.view.impl.ConditionalImpl; + +/** + * An implementation of the model object 'Conditional Diagram Style'. + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.ConditionalDiagramStyleImpl#getStyle Style}
    • + *
    + * + * @generated + */ +public class ConditionalDiagramStyleImpl extends ConditionalImpl implements ConditionalDiagramStyle { + + /** + * The cached value of the '{@link #getStyle() Style}' containment reference. + * + * @generated + * @ordered + * @see #getStyle() + */ + protected DiagramStyleDescription style; + + /** + * + * + * @generated + */ + protected ConditionalDiagramStyleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DiagramPackage.Literals.CONDITIONAL_DIAGRAM_STYLE; + } + + /** + * + * + * @generated + */ + @Override + public DiagramStyleDescription getStyle() { + return this.style; + } + + /** + * + * + * @generated + */ + @Override + public void setStyle(DiagramStyleDescription newStyle) { + if (newStyle != this.style) { + NotificationChain msgs = null; + if (this.style != null) + msgs = ((InternalEObject) this.style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE, null, msgs); + if (newStyle != null) + msgs = ((InternalEObject) newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE, null, msgs); + msgs = this.basicSetStyle(newStyle, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE, newStyle, newStyle)); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetStyle(DiagramStyleDescription newStyle, NotificationChain msgs) { + DiagramStyleDescription oldStyle = this.style; + this.style = newStyle; + if (this.eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE, oldStyle, newStyle); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE: + return this.basicSetStyle(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE: + return this.getStyle(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE: + this.setStyle((DiagramStyleDescription) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE: + this.setStyle(null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE__STYLE: + return this.style != null; + } + return super.eIsSet(featureID); + } + +} // ConditionalDiagramStyleImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramDescriptionImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramDescriptionImpl.java index 75e23d7a73..9d40540c84 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramDescriptionImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramDescriptionImpl.java @@ -23,9 +23,11 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.DiagramDescription; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.DiagramPalette; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.EdgeDescription; import org.eclipse.sirius.components.view.diagram.NodeDescription; import org.eclipse.sirius.components.view.impl.RepresentationDescriptionImpl; @@ -45,6 +47,9 @@ * Descriptions} *
  • {@link org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl#getArrangeLayoutDirection * Arrange Layout Direction}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl#getStyle Style}
  • + *
  • {@link org.eclipse.sirius.components.view.diagram.impl.DiagramDescriptionImpl#getConditionalStyles + * Conditional Styles}
  • * * * @generated @@ -55,71 +60,85 @@ public class DiagramDescriptionImpl extends RepresentationDescriptionImpl implem * The default value of the '{@link #isAutoLayout() Auto Layout}' attribute. * - * @see #isAutoLayout() * @generated * @ordered + * @see #isAutoLayout() */ protected static final boolean AUTO_LAYOUT_EDEFAULT = false; - + /** + * The default value of the '{@link #getArrangeLayoutDirection() Arrange Layout Direction}' attribute. + * + * @generated + * @ordered + * @see #getArrangeLayoutDirection() + */ + protected static final ArrangeLayoutDirection ARRANGE_LAYOUT_DIRECTION_EDEFAULT = ArrangeLayoutDirection.UNDEFINED; /** * The cached value of the '{@link #isAutoLayout() Auto Layout}' attribute. * - * @see #isAutoLayout() * @generated * @ordered + * @see #isAutoLayout() */ protected boolean autoLayout = AUTO_LAYOUT_EDEFAULT; - /** * The cached value of the '{@link #getPalette() Palette}' containment reference. * * - * @see #getPalette() * @generated * @ordered + * @see #getPalette() */ protected DiagramPalette palette; - /** * The cached value of the '{@link #getNodeDescriptions() Node Descriptions}' containment reference list. * * - * @see #getNodeDescriptions() * @generated * @ordered + * @see #getNodeDescriptions() */ protected EList nodeDescriptions; - /** * The cached value of the '{@link #getEdgeDescriptions() Edge Descriptions}' containment reference list. * * - * @see #getEdgeDescriptions() * @generated * @ordered + * @see #getEdgeDescriptions() */ protected EList edgeDescriptions; - /** - * The default value of the '{@link #getArrangeLayoutDirection() Arrange Layout Direction}' attribute. * * @generated * @ordered * @see #getArrangeLayoutDirection() */ - protected static final ArrangeLayoutDirection ARRANGE_LAYOUT_DIRECTION_EDEFAULT = ArrangeLayoutDirection.UNDEFINED; + protected ArrangeLayoutDirection arrangeLayoutDirection = ARRANGE_LAYOUT_DIRECTION_EDEFAULT; /** - * The cached value of the '{@link #getArrangeLayoutDirection() Arrange Layout Direction}' attribute. + * The cached value of the '{@link #getStyle() Style}' containment reference. * * @generated * @ordered - * @see #getArrangeLayoutDirection() + * @see #getStyle() */ - protected ArrangeLayoutDirection arrangeLayoutDirection = ARRANGE_LAYOUT_DIRECTION_EDEFAULT; + protected DiagramStyleDescription style; + + /** + * The cached value of the '{@link #getConditionalStyles() Conditional Styles}' containment reference list. + * + * + * @generated + * @ordered + * @see #getConditionalStyles() + */ + protected EList conditionalStyles; /** * @@ -260,6 +279,67 @@ public void setArrangeLayoutDirection(ArrangeLayoutDirection newArrangeLayoutDir this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION, oldArrangeLayoutDirection, this.arrangeLayoutDirection)); } + /** + * + * + * @generated + */ + @Override + public DiagramStyleDescription getStyle() { + return this.style; + } + + /** + * + * + * @generated + */ + @Override + public void setStyle(DiagramStyleDescription newStyle) { + if (newStyle != this.style) { + NotificationChain msgs = null; + if (this.style != null) + msgs = ((InternalEObject) this.style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DiagramPackage.DIAGRAM_DESCRIPTION__STYLE, null, msgs); + if (newStyle != null) + msgs = ((InternalEObject) newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DiagramPackage.DIAGRAM_DESCRIPTION__STYLE, null, msgs); + msgs = this.basicSetStyle(newStyle, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.DIAGRAM_DESCRIPTION__STYLE, newStyle, newStyle)); + } + + /** + * + * + * @generated + */ + @Override + public EList getConditionalStyles() { + if (this.conditionalStyles == null) { + this.conditionalStyles = new EObjectContainmentEList<>(ConditionalDiagramStyle.class, this, DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES); + } + return this.conditionalStyles; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetStyle(DiagramStyleDescription newStyle, NotificationChain msgs) { + DiagramStyleDescription oldStyle = this.style; + this.style = newStyle; + if (this.eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DiagramPackage.DIAGRAM_DESCRIPTION__STYLE, oldStyle, newStyle); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + /** * * @@ -274,6 +354,10 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, return ((InternalEList) this.getNodeDescriptions()).basicRemove(otherEnd, msgs); case DiagramPackage.DIAGRAM_DESCRIPTION__EDGE_DESCRIPTIONS: return ((InternalEList) this.getEdgeDescriptions()).basicRemove(otherEnd, msgs); + case DiagramPackage.DIAGRAM_DESCRIPTION__STYLE: + return this.basicSetStyle(null, msgs); + case DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES: + return ((InternalEList) this.getConditionalStyles()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -296,6 +380,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.getEdgeDescriptions(); case DiagramPackage.DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION: return this.getArrangeLayoutDirection(); + case DiagramPackage.DIAGRAM_DESCRIPTION__STYLE: + return this.getStyle(); + case DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES: + return this.getConditionalStyles(); } return super.eGet(featureID, resolve, coreType); } @@ -326,6 +414,13 @@ public void eSet(int featureID, Object newValue) { case DiagramPackage.DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION: this.setArrangeLayoutDirection((ArrangeLayoutDirection) newValue); return; + case DiagramPackage.DIAGRAM_DESCRIPTION__STYLE: + this.setStyle((DiagramStyleDescription) newValue); + return; + case DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES: + this.getConditionalStyles().clear(); + this.getConditionalStyles().addAll((Collection) newValue); + return; } super.eSet(featureID, newValue); } @@ -342,7 +437,7 @@ public void eUnset(int featureID) { this.setAutoLayout(AUTO_LAYOUT_EDEFAULT); return; case DiagramPackage.DIAGRAM_DESCRIPTION__PALETTE: - this.setPalette((DiagramPalette) null); + this.setPalette(null); return; case DiagramPackage.DIAGRAM_DESCRIPTION__NODE_DESCRIPTIONS: this.getNodeDescriptions().clear(); @@ -353,6 +448,12 @@ public void eUnset(int featureID) { case DiagramPackage.DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION: this.setArrangeLayoutDirection(ARRANGE_LAYOUT_DIRECTION_EDEFAULT); return; + case DiagramPackage.DIAGRAM_DESCRIPTION__STYLE: + this.setStyle(null); + return; + case DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES: + this.getConditionalStyles().clear(); + return; } super.eUnset(featureID); } @@ -375,6 +476,10 @@ public boolean eIsSet(int featureID) { return this.edgeDescriptions != null && !this.edgeDescriptions.isEmpty(); case DiagramPackage.DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION: return this.arrangeLayoutDirection != ARRANGE_LAYOUT_DIRECTION_EDEFAULT; + case DiagramPackage.DIAGRAM_DESCRIPTION__STYLE: + return this.style != null; + case DiagramPackage.DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES: + return this.conditionalStyles != null && !this.conditionalStyles.isEmpty(); } return super.eIsSet(featureID); } @@ -389,13 +494,12 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (autoLayout: "); - result.append(this.autoLayout); - result.append(", arrangeLayoutDirection: "); - result.append(this.arrangeLayoutDirection); - result.append(')'); - return result.toString(); + String result = super.toString() + " (autoLayout: " + + this.autoLayout + + ", arrangeLayoutDirection: " + + this.arrangeLayoutDirection + + ')'; + return result; } } // DiagramDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramFactoryImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramFactoryImpl.java index e420216745..146e7ae88d 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramFactoryImpl.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramFactoryImpl.java @@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection; import org.eclipse.sirius.components.view.diagram.ArrowStyle; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle; import org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle; import org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle; @@ -31,6 +32,7 @@ import org.eclipse.sirius.components.view.diagram.DiagramFactory; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.DiagramPalette; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.DiagramToolSection; import org.eclipse.sirius.components.view.diagram.DropNodeTool; import org.eclipse.sirius.components.view.diagram.DropTool; @@ -137,8 +139,12 @@ public EObject create(EClass eClass) { return this.createInsideLabelStyle(); case DiagramPackage.OUTSIDE_LABEL_STYLE: return this.createOutsideLabelStyle(); + case DiagramPackage.DIAGRAM_STYLE_DESCRIPTION: + return this.createDiagramStyleDescription(); case DiagramPackage.CONDITIONAL_NODE_STYLE: return this.createConditionalNodeStyle(); + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE: + return this.createConditionalDiagramStyle(); case DiagramPackage.CONDITIONAL_INSIDE_LABEL_STYLE: return this.createConditionalInsideLabelStyle(); case DiagramPackage.CONDITIONAL_OUTSIDE_LABEL_STYLE: @@ -363,6 +369,17 @@ public OutsideLabelStyle createOutsideLabelStyle() { return outsideLabelStyle; } + /** + * + * + * @generated + */ + @Override + public DiagramStyleDescription createDiagramStyleDescription() { + DiagramStyleDescriptionImpl diagramStyleDescription = new DiagramStyleDescriptionImpl(); + return diagramStyleDescription; + } + /** * * @@ -374,6 +391,17 @@ public ConditionalNodeStyle createConditionalNodeStyle() { return conditionalNodeStyle; } + /** + * + * + * @generated + */ + @Override + public ConditionalDiagramStyle createConditionalDiagramStyle() { + ConditionalDiagramStyleImpl conditionalDiagramStyle = new ConditionalDiagramStyleImpl(); + return conditionalDiagramStyle; + } + /** * * 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 e075d899fe..85f13945f1 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 @@ -22,6 +22,7 @@ import org.eclipse.sirius.components.view.diagram.ArrangeLayoutDirection; import org.eclipse.sirius.components.view.diagram.ArrowStyle; import org.eclipse.sirius.components.view.diagram.BorderStyle; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle; import org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle; import org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle; @@ -34,6 +35,7 @@ import org.eclipse.sirius.components.view.diagram.DiagramFactory; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.DiagramPalette; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.DiagramToolSection; import org.eclipse.sirius.components.view.diagram.DialogDescription; import org.eclipse.sirius.components.view.diagram.DropNodeTool; @@ -205,6 +207,13 @@ public class DiagramPackageImpl extends EPackageImpl implements DiagramPackage { */ private EClass nodeStyleDescriptionEClass = null; + /** + * + * + * @generated + */ + private EClass diagramStyleDescriptionEClass = null; + /** * * @@ -212,6 +221,13 @@ public class DiagramPackageImpl extends EPackageImpl implements DiagramPackage { */ private EClass conditionalNodeStyleEClass = null; + /** + * + * + * @generated + */ + private EClass conditionalDiagramStyleEClass = null; + /** * * @@ -623,6 +639,26 @@ public EAttribute getDiagramDescription_ArrangeLayoutDirection() { return (EAttribute) this.diagramDescriptionEClass.getEStructuralFeatures().get(4); } + /** + * + * + * @generated + */ + @Override + public EReference getDiagramDescription_Style() { + return (EReference) this.diagramDescriptionEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDiagramDescription_ConditionalStyles() { + return (EReference) this.diagramDescriptionEClass.getEStructuralFeatures().get(6); + } + /** * * @@ -1363,6 +1399,26 @@ public EClass getNodeStyleDescription() { return this.nodeStyleDescriptionEClass; } + /** + * + * + * @generated + */ + @Override + public EClass getDiagramStyleDescription() { + return this.diagramStyleDescriptionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDiagramStyleDescription_Background() { + return (EReference) this.diagramStyleDescriptionEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -1383,6 +1439,26 @@ public EReference getConditionalNodeStyle_Style() { return (EReference) this.conditionalNodeStyleEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + @Override + public EClass getConditionalDiagramStyle() { + return this.conditionalDiagramStyleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConditionalDiagramStyle_Style() { + return (EReference) this.conditionalDiagramStyleEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -2371,6 +2447,8 @@ public void createPackageContents() { this.createEReference(this.diagramDescriptionEClass, DIAGRAM_DESCRIPTION__NODE_DESCRIPTIONS); this.createEReference(this.diagramDescriptionEClass, DIAGRAM_DESCRIPTION__EDGE_DESCRIPTIONS); this.createEAttribute(this.diagramDescriptionEClass, DIAGRAM_DESCRIPTION__ARRANGE_LAYOUT_DIRECTION); + this.createEReference(this.diagramDescriptionEClass, DIAGRAM_DESCRIPTION__STYLE); + this.createEReference(this.diagramDescriptionEClass, DIAGRAM_DESCRIPTION__CONDITIONAL_STYLES); this.diagramElementDescriptionEClass = this.createEClass(DIAGRAM_ELEMENT_DESCRIPTION); this.createEAttribute(this.diagramElementDescriptionEClass, DIAGRAM_ELEMENT_DESCRIPTION__NAME); @@ -2461,9 +2539,15 @@ public void createPackageContents() { this.nodeStyleDescriptionEClass = this.createEClass(NODE_STYLE_DESCRIPTION); + this.diagramStyleDescriptionEClass = this.createEClass(DIAGRAM_STYLE_DESCRIPTION); + this.createEReference(this.diagramStyleDescriptionEClass, DIAGRAM_STYLE_DESCRIPTION__BACKGROUND); + this.conditionalNodeStyleEClass = this.createEClass(CONDITIONAL_NODE_STYLE); this.createEReference(this.conditionalNodeStyleEClass, CONDITIONAL_NODE_STYLE__STYLE); + this.conditionalDiagramStyleEClass = this.createEClass(CONDITIONAL_DIAGRAM_STYLE); + this.createEReference(this.conditionalDiagramStyleEClass, CONDITIONAL_DIAGRAM_STYLE__STYLE); + this.conditionalInsideLabelStyleEClass = this.createEClass(CONDITIONAL_INSIDE_LABEL_STYLE); this.createEReference(this.conditionalInsideLabelStyleEClass, CONDITIONAL_INSIDE_LABEL_STYLE__STYLE); @@ -2629,6 +2713,7 @@ public void initializePackageContents() { this.nodeLabelStyleEClass.getESuperTypes().add(this.getBorderStyle()); this.nodeStyleDescriptionEClass.getESuperTypes().add(this.getBorderStyle()); this.conditionalNodeStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); + this.conditionalDiagramStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); this.conditionalInsideLabelStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); this.conditionalOutsideLabelStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); this.rectangularNodeStyleDescriptionEClass.getESuperTypes().add(this.getNodeStyleDescription()); @@ -2669,6 +2754,10 @@ public void initializePackageContents() { this.getDiagramDescription_EdgeDescriptions().getEKeys().add(this.getDiagramElementDescription_Name()); this.initEAttribute(this.getDiagramDescription_ArrangeLayoutDirection(), this.getArrangeLayoutDirection(), "arrangeLayoutDirection", "UNDEFINED", 1, 1, DiagramDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEReference(this.getDiagramDescription_Style(), this.getDiagramStyleDescription(), null, "style", null, 0, 1, DiagramDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEReference(this.getDiagramDescription_ConditionalStyles(), this.getConditionalDiagramStyle(), null, "conditionalStyles", null, 0, -1, DiagramDescription.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.diagramElementDescriptionEClass, DiagramElementDescription.class, "DiagramElementDescription", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getDiagramElementDescription_Name(), theViewPackage.getIdentifier(), "name", "NewRepresentationDescription", 0, 1, DiagramElementDescription.class, !IS_TRANSIENT, @@ -2821,10 +2910,18 @@ public void initializePackageContents() { this.initEClass(this.nodeStyleDescriptionEClass, NodeStyleDescription.class, "NodeStyleDescription", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + this.initEClass(this.diagramStyleDescriptionEClass, DiagramStyleDescription.class, "DiagramStyleDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + this.initEReference(this.getDiagramStyleDescription_Background(), theViewPackage.getUserColor(), null, "background", null, 0, 1, DiagramStyleDescription.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.conditionalNodeStyleEClass, ConditionalNodeStyle.class, "ConditionalNodeStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEReference(this.getConditionalNodeStyle_Style(), this.getNodeStyleDescription(), null, "style", null, 0, 1, ConditionalNodeStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.conditionalDiagramStyleEClass, ConditionalDiagramStyle.class, "ConditionalDiagramStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + this.initEReference(this.getConditionalDiagramStyle_Style(), this.getDiagramStyleDescription(), null, "style", null, 0, 1, ConditionalDiagramStyle.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.conditionalInsideLabelStyleEClass, ConditionalInsideLabelStyle.class, "ConditionalInsideLabelStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEReference(this.getConditionalInsideLabelStyle_Style(), this.getInsideLabelStyle(), null, "style", null, 0, 1, ConditionalInsideLabelStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramStyleDescriptionImpl.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramStyleDescriptionImpl.java new file mode 100644 index 0000000000..ce0be88e2f --- /dev/null +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/impl/DiagramStyleDescriptionImpl.java @@ -0,0 +1,168 @@ +/******************************************************************************* + * 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 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.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.sirius.components.view.UserColor; +import org.eclipse.sirius.components.view.diagram.DiagramPackage; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; + +/** + * An implementation of the model object 'Style Description'. + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.sirius.components.view.diagram.impl.DiagramStyleDescriptionImpl#getBackground + * Background}
    • + *
    + * + * @generated + */ +public class DiagramStyleDescriptionImpl extends MinimalEObjectImpl.Container implements DiagramStyleDescription { + + /** + * The cached value of the '{@link #getBackground() Background}' reference. + * + * @generated + * @ordered + * @see #getBackground() + */ + protected UserColor background; + + /** + * + * + * @generated + */ + protected DiagramStyleDescriptionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DiagramPackage.Literals.DIAGRAM_STYLE_DESCRIPTION; + } + + /** + * + * + * @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.DIAGRAM_STYLE_DESCRIPTION__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.DIAGRAM_STYLE_DESCRIPTION__BACKGROUND, oldBackground, this.background)); + } + + /** + * + * + * @generated + */ + public UserColor basicGetBackground() { + return this.background; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DiagramPackage.DIAGRAM_STYLE_DESCRIPTION__BACKGROUND: + if (resolve) + return this.getBackground(); + return this.basicGetBackground(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DiagramPackage.DIAGRAM_STYLE_DESCRIPTION__BACKGROUND: + this.setBackground((UserColor) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DiagramPackage.DIAGRAM_STYLE_DESCRIPTION__BACKGROUND: + this.setBackground(null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DiagramPackage.DIAGRAM_STYLE_DESCRIPTION__BACKGROUND: + return this.background != null; + } + return super.eIsSet(featureID); + } + +} // DiagramStyleDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramAdapterFactory.java b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramAdapterFactory.java index 7a699632cd..9c0957d18b 100644 --- a/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-diagram/src/main/java/org/eclipse/sirius/components/view/diagram/util/DiagramAdapterFactory.java @@ -21,6 +21,7 @@ import org.eclipse.sirius.components.view.Operation; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.diagram.BorderStyle; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle; import org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle; import org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle; @@ -32,6 +33,7 @@ import org.eclipse.sirius.components.view.diagram.DiagramElementDescription; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.DiagramPalette; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.DiagramToolSection; import org.eclipse.sirius.components.view.diagram.DialogDescription; import org.eclipse.sirius.components.view.diagram.DropNodeTool; @@ -72,8 +74,8 @@ * The Adapter Factory for the model. It provides an adapter createXXX * method for each class of the model. * - * @see org.eclipse.sirius.components.view.diagram.DiagramPackage * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPackage */ public class DiagramAdapterFactory extends AdapterFactoryImpl { @@ -170,11 +172,21 @@ public Adapter caseNodeStyleDescription(NodeStyleDescription object) { return DiagramAdapterFactory.this.createNodeStyleDescriptionAdapter(); } + @Override + public Adapter caseDiagramStyleDescription(DiagramStyleDescription object) { + return DiagramAdapterFactory.this.createDiagramStyleDescriptionAdapter(); + } + @Override public Adapter caseConditionalNodeStyle(ConditionalNodeStyle object) { return DiagramAdapterFactory.this.createConditionalNodeStyleAdapter(); } + @Override + public Adapter caseConditionalDiagramStyle(ConditionalDiagramStyle object) { + return DiagramAdapterFactory.this.createConditionalDiagramStyleAdapter(); + } + @Override public Adapter caseConditionalInsideLabelStyle(ConditionalInsideLabelStyle object) { return DiagramAdapterFactory.this.createConditionalInsideLabelStyleAdapter(); @@ -380,7 +392,7 @@ public boolean isFactoryForType(Object object) { * Creates an adapter for the target. * * @param target - * the object to adapt. + * the object to adapt. * @return the adapter for the target. * @generated */ @@ -396,8 +408,8 @@ public Adapter createAdapter(Notifier target) { * when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.DiagramDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramDescription */ public Adapter createDiagramDescriptionAdapter() { return null; @@ -424,8 +436,8 @@ public Adapter createDiagramElementDescriptionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.NodeDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeDescription */ public Adapter createNodeDescriptionAdapter() { return null; @@ -438,8 +450,8 @@ public Adapter createNodeDescriptionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.EdgeDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeDescription */ public Adapter createEdgeDescriptionAdapter() { return null; @@ -452,8 +464,8 @@ public Adapter createEdgeDescriptionAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.LayoutStrategyDescription */ public Adapter createLayoutStrategyDescriptionAdapter() { return null; @@ -466,8 +478,8 @@ public Adapter createLayoutStrategyDescriptionAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription */ public Adapter createListLayoutStrategyDescriptionAdapter() { return null; @@ -481,8 +493,8 @@ public Adapter createListLayoutStrategyDescriptionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.FreeFormLayoutStrategyDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.FreeFormLayoutStrategyDescription */ public Adapter createFreeFormLayoutStrategyDescriptionAdapter() { return null; @@ -495,8 +507,8 @@ public Adapter createFreeFormLayoutStrategyDescriptionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.LabelDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.LabelDescription */ public Adapter createLabelDescriptionAdapter() { return null; @@ -509,8 +521,8 @@ public Adapter createLabelDescriptionAdapter() { * to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.InsideLabelDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.InsideLabelDescription */ public Adapter createInsideLabelDescriptionAdapter() { return null; @@ -523,8 +535,8 @@ public Adapter createInsideLabelDescriptionAdapter() { * to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.OutsideLabelDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.OutsideLabelDescription */ public Adapter createOutsideLabelDescriptionAdapter() { return null; @@ -536,8 +548,8 @@ public Adapter createOutsideLabelDescriptionAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.Style * @generated + * @see org.eclipse.sirius.components.view.diagram.Style */ public Adapter createStyleAdapter() { return null; @@ -564,8 +576,8 @@ public Adapter createBorderStyleAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.InsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.InsideLabelStyle */ public Adapter createInsideLabelStyleAdapter() { return null; @@ -578,8 +590,8 @@ public Adapter createInsideLabelStyleAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.OutsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.OutsideLabelStyle */ public Adapter createOutsideLabelStyleAdapter() { return null; @@ -592,8 +604,8 @@ public Adapter createOutsideLabelStyleAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeLabelStyle */ public Adapter createNodeLabelStyleAdapter() { return null; @@ -613,6 +625,20 @@ public Adapter createNodeStyleDescriptionAdapter() { return null; } + /** + * Creates a new adapter for an object of class + * '{@link org.eclipse.sirius.components.view.diagram.DiagramStyleDescription Style Description}'. This default implementation returns null so that we can easily ignore cases; it's useful to + * ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramStyleDescription + */ + public Adapter createDiagramStyleDescriptionAdapter() { + return null; + } + /** * Creates a new adapter for an object of class * '{@link org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle Conditional Node Style}'. This default implementation returns null so that we can easily ignore cases; it's useful + * to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle + */ + public Adapter createConditionalDiagramStyleAdapter() { + return null; + } + /** * Creates a new adapter for an object of class * '{@link org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle Conditional Inside Label @@ -634,8 +674,8 @@ public Adapter createConditionalNodeStyleAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle */ public Adapter createConditionalInsideLabelStyleAdapter() { return null; @@ -648,8 +688,8 @@ public Adapter createConditionalInsideLabelStyleAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.ConditionalOutsideLabelStyle * @generated + * @see org.eclipse.sirius.components.view.diagram.ConditionalOutsideLabelStyle */ public Adapter createConditionalOutsideLabelStyleAdapter() { return null; @@ -662,8 +702,8 @@ public Adapter createConditionalOutsideLabelStyleAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.RectangularNodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.RectangularNodeStyleDescription */ public Adapter createRectangularNodeStyleDescriptionAdapter() { return null; @@ -676,8 +716,8 @@ public Adapter createRectangularNodeStyleDescriptionAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.ImageNodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.ImageNodeStyleDescription */ public Adapter createImageNodeStyleDescriptionAdapter() { return null; @@ -690,8 +730,8 @@ public Adapter createImageNodeStyleDescriptionAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription */ public Adapter createIconLabelNodeStyleDescriptionAdapter() { return null; @@ -731,8 +771,8 @@ public Adapter createConditionalEdgeStyleAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.DiagramPalette * @generated + * @see org.eclipse.sirius.components.view.diagram.DiagramPalette */ public Adapter createDiagramPaletteAdapter() { return null; @@ -772,8 +812,8 @@ public Adapter createEdgePaletteAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.Tool * @generated + * @see org.eclipse.sirius.components.view.diagram.Tool */ public Adapter createToolAdapter() { return null; @@ -799,8 +839,8 @@ public Adapter createDeleteToolAdapter() { * it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.DropTool * @generated + * @see org.eclipse.sirius.components.view.diagram.DropTool */ public Adapter createDropToolAdapter() { return null; @@ -812,8 +852,8 @@ public Adapter createDropToolAdapter() { * it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.EdgeTool * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeTool */ public Adapter createEdgeToolAdapter() { return null; @@ -840,8 +880,8 @@ public Adapter createEdgeReconnectionToolAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.LabelEditTool * @generated + * @see org.eclipse.sirius.components.view.diagram.LabelEditTool */ public Adapter createLabelEditToolAdapter() { return null; @@ -853,8 +893,8 @@ public Adapter createLabelEditToolAdapter() { * it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.NodeTool * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeTool */ public Adapter createNodeToolAdapter() { return null; @@ -867,8 +907,8 @@ public Adapter createNodeToolAdapter() { * it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.SourceEdgeEndReconnectionTool * @generated + * @see org.eclipse.sirius.components.view.diagram.SourceEdgeEndReconnectionTool */ public Adapter createSourceEdgeEndReconnectionToolAdapter() { return null; @@ -881,8 +921,8 @@ public Adapter createSourceEdgeEndReconnectionToolAdapter() { * it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.TargetEdgeEndReconnectionTool * @generated + * @see org.eclipse.sirius.components.view.diagram.TargetEdgeEndReconnectionTool */ public Adapter createTargetEdgeEndReconnectionToolAdapter() { return null; @@ -923,8 +963,8 @@ public Adapter createDeleteViewAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.SelectionDialogDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.SelectionDialogDescription */ public Adapter createSelectionDialogDescriptionAdapter() { return null; @@ -965,8 +1005,8 @@ public Adapter createDiagramToolSectionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.NodeToolSection * @generated + * @see org.eclipse.sirius.components.view.diagram.NodeToolSection */ public Adapter createNodeToolSectionAdapter() { return null; @@ -979,8 +1019,8 @@ public Adapter createNodeToolSectionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.EdgeToolSection * @generated + * @see org.eclipse.sirius.components.view.diagram.EdgeToolSection */ public Adapter createEdgeToolSectionAdapter() { return null; @@ -1007,8 +1047,8 @@ public Adapter createDropNodeToolAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.diagram.DialogDescription * @generated + * @see org.eclipse.sirius.components.view.diagram.DialogDescription */ public Adapter createDialogDescriptionAdapter() { return null; @@ -1035,8 +1075,8 @@ public Adapter createSelectionDialogTreeDescriptionAdapter() { * end-user-doc --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.RepresentationDescription * @generated + * @see org.eclipse.sirius.components.view.RepresentationDescription */ public Adapter createRepresentationDescriptionAdapter() { return null; @@ -1048,8 +1088,8 @@ public Adapter createRepresentationDescriptionAdapter() { * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @return the new adapter. - * @see org.eclipse.sirius.components.view.LabelStyle * @generated + * @see org.eclipse.sirius.components.view.LabelStyle */ public Adapter createLabelStyleAdapter() { return null; 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 6e37ca721d..cf04d387a9 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 @@ -20,6 +20,7 @@ import org.eclipse.sirius.components.view.Operation; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.diagram.BorderStyle; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.ConditionalEdgeStyle; import org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle; import org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle; @@ -31,6 +32,7 @@ import org.eclipse.sirius.components.view.diagram.DiagramElementDescription; import org.eclipse.sirius.components.view.diagram.DiagramPackage; import org.eclipse.sirius.components.view.diagram.DiagramPalette; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.DiagramToolSection; import org.eclipse.sirius.components.view.diagram.DialogDescription; import org.eclipse.sirius.components.view.diagram.DropNodeTool; @@ -73,8 +75,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 { @@ -100,7 +102,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 */ @@ -263,6 +265,13 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } + case DiagramPackage.DIAGRAM_STYLE_DESCRIPTION: { + DiagramStyleDescription diagramStyleDescription = (DiagramStyleDescription) theEObject; + T result = this.caseDiagramStyleDescription(diagramStyleDescription); + if (result == null) + result = this.defaultCase(theEObject); + return result; + } case DiagramPackage.CONDITIONAL_NODE_STYLE: { ConditionalNodeStyle conditionalNodeStyle = (ConditionalNodeStyle) theEObject; T result = this.caseConditionalNodeStyle(conditionalNodeStyle); @@ -272,6 +281,15 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } + case DiagramPackage.CONDITIONAL_DIAGRAM_STYLE: { + ConditionalDiagramStyle conditionalDiagramStyle = (ConditionalDiagramStyle) theEObject; + T result = this.caseConditionalDiagramStyle(conditionalDiagramStyle); + if (result == null) + result = this.caseConditional(conditionalDiagramStyle); + if (result == null) + result = this.defaultCase(theEObject); + return result; + } case DiagramPackage.CONDITIONAL_INSIDE_LABEL_STYLE: { ConditionalInsideLabelStyle conditionalInsideLabelStyle = (ConditionalInsideLabelStyle) theEObject; T result = this.caseConditionalInsideLabelStyle(conditionalInsideLabelStyle); @@ -551,10 +569,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; @@ -566,7 +584,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) @@ -581,7 +599,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) @@ -596,7 +614,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) @@ -611,7 +629,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) @@ -626,7 +644,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) @@ -641,10 +659,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; @@ -656,7 +674,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) @@ -671,7 +689,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) @@ -686,7 +704,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) @@ -700,10 +718,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; @@ -714,10 +732,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; @@ -729,7 +747,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) @@ -744,7 +762,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) @@ -759,7 +777,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) @@ -774,7 +792,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) @@ -783,13 +801,28 @@ public T caseNodeStyleDescription(NodeStyleDescription object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Style Description'. This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Style Description'. + * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + */ + public T caseDiagramStyleDescription(DiagramStyleDescription object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Conditional Node Style'. 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 Node Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -798,13 +831,28 @@ public T caseConditionalNodeStyle(ConditionalNodeStyle object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Conditional Diagram Style'. This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Conditional Diagram Style'. + * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + */ + public T caseConditionalDiagramStyle(ConditionalDiagramStyle object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Conditional Inside Label Style'. 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 Inside Label Style'. * @generated * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -819,7 +867,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) @@ -834,10 +882,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; @@ -849,7 +897,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) @@ -864,10 +912,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; @@ -878,10 +926,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; @@ -893,7 +941,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) @@ -907,10 +955,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; @@ -921,10 +969,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; @@ -935,10 +983,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; @@ -949,10 +997,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; @@ -963,10 +1011,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; @@ -977,10 +1025,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; @@ -991,10 +1039,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; @@ -1006,7 +1054,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) @@ -1021,7 +1069,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) @@ -1035,10 +1083,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; @@ -1050,10 +1098,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; @@ -1065,10 +1113,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; @@ -1079,10 +1127,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; @@ -1093,10 +1141,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; @@ -1108,13 +1156,13 @@ public T caseDeleteView(DeleteView object) { * end-user-doc --> * * @param object - * the target of the switch. <<<<<<< HEAD + * the target of the switch. <<<<<<< HEAD * @return the result of interpreting the object as an instance of 'Selection Description'. - * @generated ======= * @return the result of interpreting the object as an instance of 'Selection Dialog Description'. >>>>>>> - * e444ba2ad ([2759] Reactivate the SelectionDialog) - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * e444ba2ad ([2759] Reactivate the SelectionDialog) + * @generated ======= * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseSelectionDialogDescription(SelectionDialogDescription object) { return null; @@ -1125,10 +1173,10 @@ public T caseSelectionDialogDescription(SelectionDialogDescription 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; @@ -1139,10 +1187,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; @@ -1154,7 +1202,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) @@ -1169,7 +1217,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) @@ -1184,7 +1232,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) @@ -1199,10 +1247,10 @@ 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 'Dialog Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseDialogDescription(DialogDescription object) { return null; @@ -1214,10 +1262,10 @@ public T caseDialogDescription(DialogDescription object) { * * * @param object - * the target of the switch. + * the target of the switch. * @return the result of interpreting the object as an instance of 'Selection Dialog Tree Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) */ public T caseSelectionDialogTreeDescription(SelectionDialogTreeDescription object) { return null; @@ -1229,7 +1277,7 @@ public T caseSelectionDialogTreeDescription(SelectionDialogTreeDescription objec * 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) @@ -1243,10 +1291,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; @@ -1257,10 +1305,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; @@ -1271,10 +1319,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; @@ -1286,10 +1334,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 d0cacb92a7..495458c2b5 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 @@ -85,6 +85,10 @@ eType="#//EdgeDescription" containment="true" eKeys="#//DiagramElementDescription/name"/> + + + + + + + + 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 b9f9d1de55..8dfc636e90 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 @@ -93,6 +93,8 @@ + + @@ -179,9 +181,15 @@ + + + + + + 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 ac5600eb6b..fa39ec34cd 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 @@ -18,6 +18,7 @@ import org.eclipse.sirius.components.core.api.IObjectService; import org.eclipse.sirius.components.diagrams.ArrowStyle; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.INodeStyle; import org.eclipse.sirius.components.diagrams.IconLabelNodeStyle; @@ -31,6 +32,7 @@ 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.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.IconLabelNodeStyleDescription; import org.eclipse.sirius.components.view.diagram.InsideLabelStyle; import org.eclipse.sirius.components.view.diagram.NodeStyleDescription; @@ -117,11 +119,23 @@ public String getNodeType(NodeStyleDescription nodeStyleDescription) { return type.orElse(NodeType.NODE_RECTANGLE); } + public DiagramStyle createDiagramStyle(DiagramStyleDescription diagramStyleDescription) { + return DiagramStyle.newDiagramStyle() + .background(Optional.ofNullable(diagramStyleDescription.getBackground()) + .filter(FixedColor.class::isInstance) + .map(FixedColor.class::cast) + .map(FixedColor::getValue) + .orElse(DEFAULT_TRANSPARENT_COLOR)) + .build(); + } + public INodeStyle createNodeStyle(NodeStyleDescription nodeStyle, Optional optionalEditingContextId) { INodeStyle result = null; switch (this.getNodeType(nodeStyle)) { case NodeType.NODE_ICON_LABEL: - result = IconLabelNodeStyle.newIconLabelNodeStyle().background("transparent").build(); + result = IconLabelNodeStyle.newIconLabelNodeStyle() + .background(DEFAULT_TRANSPARENT_COLOR) + .build(); break; case NodeType.NODE_RECTANGLE: result = RectangularNodeStyle.newRectangularNodeStyle() diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/ViewDiagramDescriptionConverter.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/ViewDiagramDescriptionConverter.java index a23d1c5f8b..efcb117d9d 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/ViewDiagramDescriptionConverter.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/ViewDiagramDescriptionConverter.java @@ -32,6 +32,7 @@ import org.eclipse.sirius.components.core.api.IFeedbackMessageService; import org.eclipse.sirius.components.core.api.IObjectService; import org.eclipse.sirius.components.diagrams.ArrangeLayoutDirection; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Edge; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; @@ -69,11 +70,13 @@ import org.eclipse.sirius.components.representations.Success; import org.eclipse.sirius.components.representations.VariableManager; import org.eclipse.sirius.components.view.RepresentationDescription; +import org.eclipse.sirius.components.view.diagram.ConditionalDiagramStyle; import org.eclipse.sirius.components.view.diagram.ConditionalInsideLabelStyle; import org.eclipse.sirius.components.view.diagram.ConditionalNodeStyle; import org.eclipse.sirius.components.view.diagram.ConditionalOutsideLabelStyle; import org.eclipse.sirius.components.view.diagram.DiagramElementDescription; import org.eclipse.sirius.components.view.diagram.DiagramPackage; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.DropNodeTool; import org.eclipse.sirius.components.view.diagram.DropTool; import org.eclipse.sirius.components.view.diagram.FreeFormLayoutStrategyDescription; @@ -145,6 +148,11 @@ public IRepresentationDescription convert(RepresentationDescription viewRepresen List edgeDescriptions = viewDiagramDescription.getEdgeDescriptions().stream().map(edge -> this.convert(edge, converterContext, stylesFactory)).toList(); var toolConverter = new ToolConverter(this.objectService, this.editService, this.viewToolImageProvider, this.feedbackMessageService, this.diagramIdProvider); + Function styleProvider = variableManager -> { + var effectiveStyle = this.findEffectiveDiagramStyle(viewDiagramDescription, interpreter, variableManager); + return stylesFactory.createDiagramStyle(effectiveStyle); + }; + var builder = DiagramDescription.newDiagramDescription(this.diagramIdProvider.getId(viewDiagramDescription)) .label(Optional.ofNullable(viewDiagramDescription.getName()).orElse(DEFAULT_DIAGRAM_LABEL)) .labelProvider(variableManager -> this.computeDiagramLabel(viewDiagramDescription, variableManager, interpreter)) @@ -165,7 +173,8 @@ public org.eclipse.sirius.components.view.diagram.DiagramDescription getSourceDi .nodeDescriptions(nodeDescriptions) .edgeDescriptions(edgeDescriptions) .palettes(toolConverter.createPaletteBasedToolSections(viewDiagramDescription, converterContext)) - .dropHandler(this.createDiagramDropHandler(viewDiagramDescription, converterContext)); + .dropHandler(this.createDiagramDropHandler(viewDiagramDescription, converterContext)) + .styleProvider(styleProvider); new ToolFinder().findDropNodeTool(viewDiagramDescription).ifPresent(dropNoteTool -> { builder.dropNodeHandler(this.createDropNodeHandler(dropNoteTool, converterContext)); @@ -230,12 +239,12 @@ private NodeDescription convert(org.eclipse.sirius.components.view.diagram.NodeD AQLInterpreter interpreter = converterContext.getInterpreter(); Function typeProvider = variableManager -> { - var effectiveStyle = this.findEffectiveStyle(viewNodeDescription, interpreter, variableManager); + var effectiveStyle = this.findEffectiveNodeStyle(viewNodeDescription, interpreter, variableManager); return stylesFactory.getNodeType(effectiveStyle); }; Function styleProvider = variableManager -> { - var effectiveStyle = this.findEffectiveStyle(viewNodeDescription, interpreter, variableManager); + var effectiveStyle = this.findEffectiveNodeStyle(viewNodeDescription, interpreter, variableManager); Optional optionalEditingContextId = variableManager.get(IEditingContext.EDITING_CONTEXT, IEditingContext.class).map(IEditingContext::getId); return stylesFactory.createNodeStyle(effectiveStyle, optionalEditingContextId); }; @@ -352,12 +361,19 @@ private Integer computeDefaultSizeProvider(String defaultSizeExpression, AQLInte return null; } - private NodeStyleDescription findEffectiveStyle(org.eclipse.sirius.components.view.diagram.NodeDescription viewNodeDescription, AQLInterpreter interpreter, VariableManager variableManager) { + private NodeStyleDescription findEffectiveNodeStyle(org.eclipse.sirius.components.view.diagram.NodeDescription viewNodeDescription, AQLInterpreter interpreter, VariableManager variableManager) { return viewNodeDescription.getConditionalStyles().stream().filter(style -> this.matches(interpreter, style.getCondition(), variableManager)) .map(ConditionalNodeStyle::getStyle).findFirst() .orElseGet(viewNodeDescription::getStyle); } + private DiagramStyleDescription findEffectiveDiagramStyle(org.eclipse.sirius.components.view.diagram.DiagramDescription viewDiagramDescription, AQLInterpreter interpreter, + VariableManager variableManager) { + return viewDiagramDescription.getConditionalStyles().stream().filter(style -> this.matches(interpreter, style.getCondition(), variableManager)) + .map(ConditionalDiagramStyle::getStyle).findFirst() + .orElseGet(viewDiagramDescription::getStyle); + } + private Size computeSize(org.eclipse.sirius.components.view.diagram.NodeDescription viewNodeDescription, AQLInterpreter interpreter, VariableManager variableManager) { double computedWidth = Size.UNDEFINED.getWidth(); if (viewNodeDescription.eIsSet(DiagramPackage.Literals.NODE_DESCRIPTION__DEFAULT_WIDTH_EXPRESSION) && !viewNodeDescription.getDefaultWidthExpression().isBlank()) { 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 2b948495f3..452994597c 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 @@ -19,6 +19,7 @@ import org.eclipse.sirius.components.diagrams.ArrowStyle; import org.eclipse.sirius.components.diagrams.CollapsingState; import org.eclipse.sirius.components.diagrams.Diagram; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.Edge; import org.eclipse.sirius.components.diagrams.EdgeStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; @@ -61,6 +62,7 @@ public Diagram getDiagram(String id) { .size(Size.UNDEFINED) .nodes(List.of()) .edges(List.of()) + .style(DiagramStyle.newDiagramStyle().build()) .build(); } 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 5b249669ad..cffee7ce2f 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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.components.collaborative.diagrams.dto.SingleClickOnTwoDiagramElementsTool; import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.core.api.IURLParser; +import org.eclipse.sirius.components.diagrams.DiagramStyle; import org.eclipse.sirius.components.diagrams.FreeFormLayoutStrategy; import org.eclipse.sirius.components.diagrams.InsideLabelLocation; import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy; @@ -230,6 +231,7 @@ private DiagramDescription createDiagramDescription() { .nodeDescriptions(List.of()) .edgeDescriptions(List.of()) .dropHandler(variableManager -> new Failure("")) + .styleProvider(variableManager -> DiagramStyle.newDiagramStyle().build()) .build(); } diff --git a/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/view/DynamicDiagramsTests.java b/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/view/DynamicDiagramsTests.java index 380634761c..a47b2a0173 100644 --- a/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/view/DynamicDiagramsTests.java +++ b/packages/view/backend/sirius-components-view-emf/src/test/java/org/eclipse/sirius/components/view/emf/view/DynamicDiagramsTests.java @@ -39,6 +39,7 @@ import org.eclipse.sirius.components.view.ViewFactory; import org.eclipse.sirius.components.view.diagram.DiagramDescription; import org.eclipse.sirius.components.view.diagram.DiagramFactory; +import org.eclipse.sirius.components.view.diagram.DiagramStyleDescription; import org.eclipse.sirius.components.view.diagram.InsideLabelDescription; import org.eclipse.sirius.components.view.diagram.InsideLabelPosition; import org.eclipse.sirius.components.view.diagram.NodeDescription; @@ -88,11 +89,18 @@ private void setBasicNodeStyle(NodeDescription nodeDescription, String color) { @Test void testRenderSynchronizedEcoreDiagram() throws Exception { + var diagramBackgroundColor = ViewFactory.eINSTANCE.createFixedColor(); + diagramBackgroundColor.setName("color"); + diagramBackgroundColor.setValue("#FFFFFF"); + DiagramStyleDescription diagramStyle = DiagramFactory.eINSTANCE.createDiagramStyleDescription(); + diagramStyle.setBackground(diagramBackgroundColor); + DiagramDescription diagramDescription = DiagramFactory.eINSTANCE.createDiagramDescription(); diagramDescription.setName("Simple Ecore Diagram"); diagramDescription.setTitleExpression(NAME_EXPRESSION); diagramDescription.setAutoLayout(false); diagramDescription.setDomainType("ecore::EPackage"); + diagramDescription.setStyle(diagramStyle); InsideLabelDescription insideLabelDescription = DiagramFactory.eINSTANCE.createInsideLabelDescription(); insideLabelDescription.setLabelExpression(NAME_EXPRESSION); @@ -124,6 +132,7 @@ void testRenderUnsynchronizedEcoreDiagram() throws Exception { diagramDescription.setTitleExpression(NAME_EXPRESSION); diagramDescription.setAutoLayout(false); diagramDescription.setDomainType("ecore::EPackage"); + diagramDescription.setStyle(DiagramFactory.eINSTANCE.createDiagramStyleDescription()); NodeDescription eClassNode = DiagramFactory.eINSTANCE.createNodeDescription(); eClassNode.setName("EClass Node");