Search in sources :

Example 1 with DiagramDescription

use of org.eclipse.sirius.components.diagrams.description.DiagramDescription in project sirius-components by eclipse-sirius.

the class ViewToolSectionsProvider method getNodeToolSections.

private List<ToolSection> getNodeToolSections(DiagramDescription diagramDescription, NodeDescription nodeDescription) {
    List<ToolSection> toolSections = new ArrayList<>();
    for (ToolSection toolSection : diagramDescription.getToolSections()) {
        List<ITool> tools = toolSection.getTools().stream().filter(tool -> this.isValidTool(tool, nodeDescription)).collect(Collectors.toList());
        if (!tools.isEmpty()) {
            ToolSection filteredToolSection = ToolSection.newToolSection(toolSection).tools(tools).build();
            toolSections.add(filteredToolSection);
        }
    }
    return toolSections;
}
Also used : Node(org.eclipse.sirius.components.diagrams.Node) SynchronizationPolicy(org.eclipse.sirius.components.diagrams.description.SynchronizationPolicy) Success(org.eclipse.sirius.components.representations.Success) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) NodeDescription(org.eclipse.sirius.components.diagrams.description.NodeDescription) ArrayList(java.util.ArrayList) IToolSectionsProvider(org.eclipse.sirius.components.collaborative.diagrams.api.IToolSectionsProvider) Objects(java.util.Objects) List(java.util.List) EdgeDescription(org.eclipse.sirius.components.diagrams.description.EdgeDescription) ToolSection(org.eclipse.sirius.components.diagrams.tools.ToolSection) Diagram(org.eclipse.sirius.components.diagrams.Diagram) IStatus(org.eclipse.sirius.components.representations.IStatus) ITool(org.eclipse.sirius.components.diagrams.tools.ITool) SingleClickOnDiagramElementTool(org.eclipse.sirius.components.diagrams.tools.SingleClickOnDiagramElementTool) Service(org.springframework.stereotype.Service) DiagramImageConstants(org.eclipse.sirius.components.collaborative.diagrams.api.DiagramImageConstants) VariableManager(org.eclipse.sirius.components.representations.VariableManager) SingleClickOnTwoDiagramElementsTool(org.eclipse.sirius.components.diagrams.tools.SingleClickOnTwoDiagramElementsTool) IIdentifierProvider(org.eclipse.sirius.components.compatibility.api.IIdentifierProvider) ToolSection(org.eclipse.sirius.components.diagrams.tools.ToolSection) ArrayList(java.util.ArrayList) ITool(org.eclipse.sirius.components.diagrams.tools.ITool)

Example 2 with DiagramDescription

use of org.eclipse.sirius.components.diagrams.description.DiagramDescription in project sirius-components by eclipse-sirius.

the class CreateViewOperationHandlerTests method initialize.

@BeforeEach
public void initialize() {
    this.operationTestContext = new OperationTestContext();
    // @formatter:off
    DiagramDescription diagramDescription = DiagramDescription.newDiagramDescription(UUID.randomUUID()).label(// $NON-NLS-1$
    "DiagramDescriptionTest").targetObjectIdProvider(// $NON-NLS-1$
    variableManager -> "diagramTargetObjectId").canCreatePredicate(variableManager -> true).labelProvider(// $NON-NLS-1$
    variableManager -> "Diagram").toolSections(List.of()).nodeDescriptions(List.of(this.getNodeDescription(UUID.randomUUID()))).edgeDescriptions(List.of()).dropHandler(// $NON-NLS-1$
    variableManager -> new Failure("")).build();
    Diagram diagram = Diagram.newDiagram(UUID.randomUUID().toString()).descriptionId(diagramDescription.getId()).targetObjectId(UUID.randomUUID().toString()).label(// $NON-NLS-1$
    "DiagramTest").position(Position.at(0, 0)).size(Size.of(100, 100)).nodes(new ArrayList<>()).edges(List.of()).build();
    IDiagramContext diagramContext = new IDiagramContext.NoOp() {

        @Override
        public List<ViewCreationRequest> getViewCreationRequests() {
            return new ArrayList<>();
        }
    };
    this.operationTestContext.getVariables().put(IDiagramContext.DIAGRAM_CONTEXT, diagramContext);
    // @formatter:on
    AdapterFactoryEditingDomain editingDomain = new EditingDomainFactory().create();
    EditingContext editingContext = new EditingContext(UUID.randomUUID().toString(), editingDomain);
    this.operationTestContext.getVariables().put(IEditingContext.EDITING_CONTEXT, editingContext);
    this.operationTestContext.getVariables().put(CONTAINER_VIEW, diagram);
    this.createViewOperation = org.eclipse.sirius.diagram.description.tool.ToolFactory.eINSTANCE.createCreateView();
    this.createViewOperationHandler = new CreateViewOperationHandler(this.operationTestContext.getObjectService(), this.operationTestContext.getRepresentationMetadataSearchService(), this.operationTestContext.getIdentifierProvider(), this.operationTestContext.getInterpreter(), new ChildModelOperationHandler(List.of()), this.createViewOperation);
}
Also used : LabelDescription(org.eclipse.sirius.components.diagrams.description.LabelDescription) BeforeEach(org.junit.jupiter.api.BeforeEach) Size(org.eclipse.sirius.components.diagrams.Size) ChildModelOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.ChildModelOperationHandler) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) ToolFactory(org.eclipse.sirius.viewpoint.description.tool.ToolFactory) SynchronizationPolicy(org.eclipse.sirius.components.diagrams.description.SynchronizationPolicy) Position(org.eclipse.sirius.components.diagrams.Position) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) INodeStyle(org.eclipse.sirius.components.diagrams.INodeStyle) Function(java.util.function.Function) NodeDescription(org.eclipse.sirius.components.diagrams.description.NodeDescription) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) CreateViewOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.CreateViewOperationHandler) RectangularNodeStyle(org.eclipse.sirius.components.diagrams.RectangularNodeStyle) EditingDomainFactory(org.eclipse.sirius.components.emf.services.EditingDomainFactory) NodeMapping(org.eclipse.sirius.diagram.description.NodeMapping) Diagram(org.eclipse.sirius.components.diagrams.Diagram) EditingContext(org.eclipse.sirius.components.emf.services.EditingContext) IStatus(org.eclipse.sirius.components.representations.IStatus) LineStyle(org.eclipse.sirius.components.diagrams.LineStyle) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) IDiagramContext(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramContext) Failure(org.eclipse.sirius.components.representations.Failure) Success(org.eclipse.sirius.components.representations.Success) ENamedElement(org.eclipse.emf.ecore.ENamedElement) LabelStyleDescription(org.eclipse.sirius.components.diagrams.description.LabelStyleDescription) UUID(java.util.UUID) DescriptionFactory(org.eclipse.sirius.diagram.description.DescriptionFactory) Test(org.junit.jupiter.api.Test) List(java.util.List) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) CreateView(org.eclipse.sirius.diagram.description.tool.CreateView) VariableManager(org.eclipse.sirius.components.representations.VariableManager) ViewCreationRequest(org.eclipse.sirius.components.diagrams.ViewCreationRequest) ChangeContext(org.eclipse.sirius.viewpoint.description.tool.ChangeContext) AdapterFactoryEditingDomain(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) AdapterFactoryEditingDomain(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) ViewCreationRequest(org.eclipse.sirius.components.diagrams.ViewCreationRequest) ArrayList(java.util.ArrayList) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) ChildModelOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.ChildModelOperationHandler) Diagram(org.eclipse.sirius.components.diagrams.Diagram) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) EditingContext(org.eclipse.sirius.components.emf.services.EditingContext) CreateViewOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.CreateViewOperationHandler) IDiagramContext(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramContext) EditingDomainFactory(org.eclipse.sirius.components.emf.services.EditingDomainFactory) Failure(org.eclipse.sirius.components.representations.Failure) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with DiagramDescription

use of org.eclipse.sirius.components.diagrams.description.DiagramDescription in project sirius-components by eclipse-sirius.

the class DeleteViewOperationHandlerTests method initialize.

@BeforeEach
public void initialize() {
    this.operationTestContext = new OperationTestContext();
    // @formatter:off
    DiagramDescription diagramDescription = DiagramDescription.newDiagramDescription(UUID.randomUUID()).label(// $NON-NLS-1$
    "DiagramDescriptionTest").targetObjectIdProvider(// $NON-NLS-1$
    variableManager -> "diagramTargetObjectId").canCreatePredicate(variableManager -> true).labelProvider(// $NON-NLS-1$
    variableManager -> "Diagram").toolSections(List.of()).nodeDescriptions(List.of(this.getNodeDescription(UUID.randomUUID()))).edgeDescriptions(List.of()).dropHandler(// $NON-NLS-1$
    variableManager -> new Failure("")).build();
    Node node = Node.newNode(UUID.randomUUID().toString()).descriptionId(UUID.randomUUID()).type(// $NON-NLS-1$
    "Node").targetObjectId(UUID.randomUUID().toString()).targetObjectKind(// $NON-NLS-1$
    "ecore::EPackage").targetObjectLabel(OperationTestContext.ROOT_PACKAGE_NAME).label(Label.newLabel(UUID.randomUUID().toString()).type(// $NON-NLS-1$
    "Label").text(OperationTestContext.ROOT_PACKAGE_NAME).position(Position.at(0, 0)).size(Size.of(10, 10)).alignment(Position.at(0, 0)).style(// $NON-NLS-1$ //$NON-NLS-2$
    LabelStyle.newLabelStyle().color("").fontSize(0).iconURL("").build()).build()).style(// $NON-NLS-1$
    ImageNodeStyle.newImageNodeStyle().imageURL("").scalingFactor(0).build()).position(Position.at(0, 0)).size(Size.of(10, 10)).borderNodes(List.of()).childNodes(List.of()).build();
    Diagram diagram = Diagram.newDiagram(UUID.randomUUID().toString()).descriptionId(diagramDescription.getId()).targetObjectId(UUID.randomUUID().toString()).label(// $NON-NLS-1$
    "DiagramTest").position(Position.at(0, 0)).size(Size.of(100, 100)).nodes(List.of(node)).edges(List.of()).build();
    IDiagramContext diagramContext = new IDiagramContext.NoOp() {

        @Override
        public List<ViewDeletionRequest> getViewDeletionRequests() {
            return new ArrayList<>();
        }
    };
    this.operationTestContext.getVariables().put(IDiagramContext.DIAGRAM_CONTEXT, diagramContext);
    // @formatter:on
    AdapterFactoryEditingDomain editingDomain = new EditingDomainFactory().create();
    EditingContext editingContext = new EditingContext(UUID.randomUUID().toString(), editingDomain);
    this.operationTestContext.getVariables().put(IEditingContext.EDITING_CONTEXT, editingContext);
    this.operationTestContext.getVariables().put(CONTAINER_VIEW, diagram);
    this.operationTestContext.getVariables().put(VariableManager.SELF, diagram.getNodes().get(0));
    this.deleteViewOperation = ToolFactory.eINSTANCE.createDeleteView();
    this.deleteViewOperationHandler = new DeleteViewOperationHandler(this.operationTestContext.getObjectService(), this.operationTestContext.getRepresentationMetadataSearchService(), this.operationTestContext.getIdentifierProvider(), this.operationTestContext.getInterpreter(), new ChildModelOperationHandler(List.of()), this.deleteViewOperation);
}
Also used : LabelDescription(org.eclipse.sirius.components.diagrams.description.LabelDescription) BeforeEach(org.junit.jupiter.api.BeforeEach) Node(org.eclipse.sirius.components.diagrams.Node) Size(org.eclipse.sirius.components.diagrams.Size) ChildModelOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.ChildModelOperationHandler) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) ToolFactory(org.eclipse.sirius.viewpoint.description.tool.ToolFactory) ViewDeletionRequest(org.eclipse.sirius.components.diagrams.ViewDeletionRequest) SynchronizationPolicy(org.eclipse.sirius.components.diagrams.description.SynchronizationPolicy) Position(org.eclipse.sirius.components.diagrams.Position) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) INodeStyle(org.eclipse.sirius.components.diagrams.INodeStyle) Function(java.util.function.Function) NodeDescription(org.eclipse.sirius.components.diagrams.description.NodeDescription) ArrayList(java.util.ArrayList) RectangularNodeStyle(org.eclipse.sirius.components.diagrams.RectangularNodeStyle) EditingDomainFactory(org.eclipse.sirius.components.emf.services.EditingDomainFactory) DeleteView(org.eclipse.sirius.viewpoint.description.tool.DeleteView) Diagram(org.eclipse.sirius.components.diagrams.Diagram) EditingContext(org.eclipse.sirius.components.emf.services.EditingContext) IStatus(org.eclipse.sirius.components.representations.IStatus) LineStyle(org.eclipse.sirius.components.diagrams.LineStyle) Label(org.eclipse.sirius.components.diagrams.Label) LabelStyle(org.eclipse.sirius.components.diagrams.LabelStyle) IDiagramContext(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramContext) Failure(org.eclipse.sirius.components.representations.Failure) ImageNodeStyle(org.eclipse.sirius.components.diagrams.ImageNodeStyle) Success(org.eclipse.sirius.components.representations.Success) LabelStyleDescription(org.eclipse.sirius.components.diagrams.description.LabelStyleDescription) UUID(java.util.UUID) Test(org.junit.jupiter.api.Test) List(java.util.List) DeleteViewOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.DeleteViewOperationHandler) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) VariableManager(org.eclipse.sirius.components.representations.VariableManager) ChangeContext(org.eclipse.sirius.viewpoint.description.tool.ChangeContext) AdapterFactoryEditingDomain(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) AdapterFactoryEditingDomain(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) Node(org.eclipse.sirius.components.diagrams.Node) DeleteViewOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.DeleteViewOperationHandler) ArrayList(java.util.ArrayList) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) ChildModelOperationHandler(org.eclipse.sirius.components.emf.compatibility.modeloperations.ChildModelOperationHandler) Diagram(org.eclipse.sirius.components.diagrams.Diagram) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) EditingContext(org.eclipse.sirius.components.emf.services.EditingContext) IDiagramContext(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramContext) ViewDeletionRequest(org.eclipse.sirius.components.diagrams.ViewDeletionRequest) EditingDomainFactory(org.eclipse.sirius.components.emf.services.EditingDomainFactory) Failure(org.eclipse.sirius.components.representations.Failure) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with DiagramDescription

use of org.eclipse.sirius.components.diagrams.description.DiagramDescription in project sirius-components by eclipse-sirius.

the class DropOnDiagramEventHandler method executeTool.

private IStatus executeTool(IEditingContext editingContext, IDiagramContext diagramContext, List<Object> objects, String diagramElementId, double startingPositionX, double startingPositionY) {
    // $NON-NLS-1$
    IStatus result = new Failure("");
    Diagram diagram = diagramContext.getDiagram();
    Optional<Node> node = this.diagramQueryService.findNodeById(diagram, diagramElementId);
    // @formatter:off
    var optionalDropHandler = this.representationDescriptionSearchService.findById(editingContext, diagram.getDescriptionId()).filter(DiagramDescription.class::isInstance).map(DiagramDescription.class::cast).map(DiagramDescription::getDropHandler);
    if (optionalDropHandler.isPresent()) {
        result = new Success();
        var dropHandler = optionalDropHandler.get();
        Position newPosition = Position.at(startingPositionX, startingPositionY);
        diagramContext.setDiagramEvent(new SinglePositionEvent(newPosition));
        for (Object self : objects) {
            VariableManager variableManager = new VariableManager();
            if (node.isPresent()) {
                variableManager.put(Node.SELECTED_NODE, node.get());
            }
            variableManager.put(IEditingContext.EDITING_CONTEXT, editingContext);
            variableManager.put(IDiagramContext.DIAGRAM_CONTEXT, diagramContext);
            variableManager.put(Environment.ENVIRONMENT, new Environment(Environment.SIRIUS_COMPONENTS));
            variableManager.put(VariableManager.SELF, self);
            IStatus dropResult = dropHandler.apply(variableManager);
            if (dropResult instanceof Failure) {
                // Let all drops finished but keep the error state
                result = dropResult;
            }
        }
    }
    return result;
}
Also used : VariableManager(org.eclipse.sirius.components.representations.VariableManager) IStatus(org.eclipse.sirius.components.representations.IStatus) Position(org.eclipse.sirius.components.diagrams.Position) Node(org.eclipse.sirius.components.diagrams.Node) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) Success(org.eclipse.sirius.components.representations.Success) Diagram(org.eclipse.sirius.components.diagrams.Diagram) SinglePositionEvent(org.eclipse.sirius.components.diagrams.events.SinglePositionEvent) Environment(org.eclipse.sirius.components.core.api.Environment) Failure(org.eclipse.sirius.components.representations.Failure)

Example 5 with DiagramDescription

use of org.eclipse.sirius.components.diagrams.description.DiagramDescription in project sirius-components by eclipse-sirius.

the class GetToolSectionsEventHandler method handle.

@Override
public void handle(One<IPayload> payloadSink, Many<ChangeDescription> changeDescriptionSink, IEditingContext editingContext, IDiagramContext diagramContext, IDiagramInput diagramInput) {
    this.counter.increment();
    ChangeDescription changeDescription = new ChangeDescription(ChangeKind.NOTHING, editingContext.getId(), diagramInput);
    IPayload payload = null;
    if (diagramInput instanceof GetToolSectionsInput) {
        GetToolSectionsInput toolSectionsInput = (GetToolSectionsInput) diagramInput;
        String diagramElementId = toolSectionsInput.getDiagramElementId();
        Diagram diagram = diagramContext.getDiagram();
        // @formatter:off
        var optionalDiagramDescription = this.representationDescriptionSearchService.findById(editingContext, diagram.getDescriptionId()).filter(DiagramDescription.class::isInstance).map(DiagramDescription.class::cast);
        // @formatter:on
        if (optionalDiagramDescription.isPresent()) {
            DiagramDescription diagramDescription = optionalDiagramDescription.get();
            var optionalToolSectionsProvider = this.toolSectionsProviders.stream().filter(toolSectionProvider -> toolSectionProvider.canHandle(diagramDescription)).findFirst();
            var optionalTargetElement = this.findTargetElement(diagram, diagramElementId, editingContext);
            var optionalDiagramElement = this.findDiagramElement(diagram, diagramElementId);
            var optionalDiagramElementDescription = this.findDiagramElementDescription(diagram, diagramElementId, diagramDescription, optionalDiagramElement.orElse(null));
            if (optionalToolSectionsProvider.isPresent() && optionalTargetElement.isPresent() && optionalDiagramElementDescription.isPresent()) {
                IToolSectionsProvider toolSectionsProvider = optionalToolSectionsProvider.get();
                List<ToolSection> toolSections = toolSectionsProvider.handle(optionalTargetElement.get(), optionalDiagramElement.orElse(null), optionalDiagramElementDescription.get(), diagramDescription);
                payload = new GetToolSectionSuccessPayload(diagramInput.getId(), toolSections);
            }
        } else {
            String message = this.messageService.invalidInput(diagramInput.getClass().getSimpleName(), GetToolSectionsInput.class.getSimpleName());
            payload = new ErrorPayload(diagramInput.getId(), message);
        }
        payloadSink.tryEmitValue(payload);
        changeDescriptionSink.tryEmitNext(changeDescription);
    }
}
Also used : ErrorPayload(org.eclipse.sirius.components.core.api.ErrorPayload) Edge(org.eclipse.sirius.components.diagrams.Edge) Node(org.eclipse.sirius.components.diagrams.Node) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) IDiagramInput(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramInput) IObjectService(org.eclipse.sirius.components.core.api.IObjectService) One(reactor.core.publisher.Sinks.One) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) IToolSectionsProvider(org.eclipse.sirius.components.collaborative.diagrams.api.IToolSectionsProvider) IDiagramDescriptionService(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramDescriptionService) ToolSection(org.eclipse.sirius.components.diagrams.tools.ToolSection) Diagram(org.eclipse.sirius.components.diagrams.Diagram) Monitoring(org.eclipse.sirius.components.collaborative.api.Monitoring) Service(org.springframework.stereotype.Service) ICollaborativeMessageService(org.eclipse.sirius.components.collaborative.messages.ICollaborativeMessageService) IDiagramQueryService(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramQueryService) Counter(io.micrometer.core.instrument.Counter) GetToolSectionsInput(org.eclipse.sirius.components.collaborative.diagrams.dto.GetToolSectionsInput) ChangeKind(org.eclipse.sirius.components.collaborative.api.ChangeKind) IDiagramContext(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramContext) ChangeDescription(org.eclipse.sirius.components.collaborative.api.ChangeDescription) IRepresentationDescriptionSearchService(org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService) UUID(java.util.UUID) Objects(java.util.Objects) List(java.util.List) IPayload(org.eclipse.sirius.components.core.api.IPayload) IDiagramEventHandler(org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramEventHandler) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) GetToolSectionSuccessPayload(org.eclipse.sirius.components.collaborative.diagrams.dto.GetToolSectionSuccessPayload) Many(reactor.core.publisher.Sinks.Many) Optional(java.util.Optional) GetToolSectionSuccessPayload(org.eclipse.sirius.components.collaborative.diagrams.dto.GetToolSectionSuccessPayload) GetToolSectionsInput(org.eclipse.sirius.components.collaborative.diagrams.dto.GetToolSectionsInput) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) IPayload(org.eclipse.sirius.components.core.api.IPayload) Diagram(org.eclipse.sirius.components.diagrams.Diagram) ErrorPayload(org.eclipse.sirius.components.core.api.ErrorPayload) IToolSectionsProvider(org.eclipse.sirius.components.collaborative.diagrams.api.IToolSectionsProvider) ChangeDescription(org.eclipse.sirius.components.collaborative.api.ChangeDescription) ToolSection(org.eclipse.sirius.components.diagrams.tools.ToolSection)

Aggregations

DiagramDescription (org.eclipse.sirius.components.diagrams.description.DiagramDescription)27 Diagram (org.eclipse.sirius.components.diagrams.Diagram)21 UUID (java.util.UUID)16 Test (org.junit.jupiter.api.Test)12 List (java.util.List)10 ArrayList (java.util.ArrayList)9 IEditingContext (org.eclipse.sirius.components.core.api.IEditingContext)9 Node (org.eclipse.sirius.components.diagrams.Node)9 VariableManager (org.eclipse.sirius.components.representations.VariableManager)9 Failure (org.eclipse.sirius.components.representations.Failure)8 Function (java.util.function.Function)7 Size (org.eclipse.sirius.components.diagrams.Size)7 NodeDescription (org.eclipse.sirius.components.diagrams.description.NodeDescription)7 IRepresentationDescriptionSearchService (org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService)6 INodeStyle (org.eclipse.sirius.components.diagrams.INodeStyle)6 LineStyle (org.eclipse.sirius.components.diagrams.LineStyle)6 RectangularNodeStyle (org.eclipse.sirius.components.diagrams.RectangularNodeStyle)6 ViewCreationRequest (org.eclipse.sirius.components.diagrams.ViewCreationRequest)6 LabelDescription (org.eclipse.sirius.components.diagrams.description.LabelDescription)6 LabelStyleDescription (org.eclipse.sirius.components.diagrams.description.LabelStyleDescription)6