Search in sources :

Example 1 with IncrementalLayoutedDiagramProvider

use of org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutedDiagramProvider in project sirius-components by eclipse-sirius.

the class DiagramELKLayoutTest method createDiagramCreationService.

private TestDiagramCreationService createDiagramCreationService(Diagram diagram) {
    IRepresentationDescriptionSearchService.NoOp representationDescriptionSearchService = new IRepresentationDescriptionSearchService.NoOp() {

        @Override
        public Optional<IRepresentationDescription> findById(IEditingContext editingContext, UUID representationDescriptionId) {
            DiagramDescription diagramDescription = DiagramELKLayoutTest.this.defaultTestDiagramDescriptionProvider.getDefaultDiagramDescription(diagram);
            return Optional.of(diagramDescription);
        }
    };
    NodeSizeProvider nodeSizeProvider = new NodeSizeProvider(new ImageSizeProvider());
    IncrementalLayoutEngine incrementalLayoutEngine = new IncrementalLayoutEngine(nodeSizeProvider);
    LayoutService layoutService = new LayoutService(new ELKDiagramConverter(new TextBoundsService(), new ImageSizeProvider()), new IncrementalLayoutDiagramConverter(), new LayoutConfiguratorRegistry(List.of()), new ELKLayoutedDiagramProvider(), new IncrementalLayoutedDiagramProvider(), representationDescriptionSearchService, incrementalLayoutEngine);
    return new TestDiagramCreationService(this.objectService, representationDescriptionSearchService, layoutService);
}
Also used : IRepresentationDescriptionSearchService(org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService) DiagramDescription(org.eclipse.sirius.components.diagrams.description.DiagramDescription) ImageSizeProvider(org.eclipse.sirius.components.diagrams.layout.incremental.provider.ImageSizeProvider) IRepresentationDescription(org.eclipse.sirius.components.representations.IRepresentationDescription) ELKDiagramConverter(org.eclipse.sirius.components.diagrams.layout.ELKDiagramConverter) IncrementalLayoutDiagramConverter(org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutDiagramConverter) IEditingContext(org.eclipse.sirius.components.core.api.IEditingContext) IncrementalLayoutedDiagramProvider(org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutedDiagramProvider) TextBoundsService(org.eclipse.sirius.components.diagrams.layout.TextBoundsService) ELKLayoutedDiagramProvider(org.eclipse.sirius.components.diagrams.layout.ELKLayoutedDiagramProvider) NodeSizeProvider(org.eclipse.sirius.components.diagrams.layout.incremental.provider.NodeSizeProvider) LayoutService(org.eclipse.sirius.components.diagrams.layout.LayoutService) UUID(java.util.UUID) LayoutConfiguratorRegistry(org.eclipse.sirius.components.diagrams.layout.LayoutConfiguratorRegistry) IncrementalLayoutEngine(org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutEngine)

Aggregations

UUID (java.util.UUID)1 IEditingContext (org.eclipse.sirius.components.core.api.IEditingContext)1 IRepresentationDescriptionSearchService (org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService)1 DiagramDescription (org.eclipse.sirius.components.diagrams.description.DiagramDescription)1 ELKDiagramConverter (org.eclipse.sirius.components.diagrams.layout.ELKDiagramConverter)1 ELKLayoutedDiagramProvider (org.eclipse.sirius.components.diagrams.layout.ELKLayoutedDiagramProvider)1 LayoutConfiguratorRegistry (org.eclipse.sirius.components.diagrams.layout.LayoutConfiguratorRegistry)1 LayoutService (org.eclipse.sirius.components.diagrams.layout.LayoutService)1 TextBoundsService (org.eclipse.sirius.components.diagrams.layout.TextBoundsService)1 IncrementalLayoutDiagramConverter (org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutDiagramConverter)1 IncrementalLayoutEngine (org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutEngine)1 IncrementalLayoutedDiagramProvider (org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutedDiagramProvider)1 ImageSizeProvider (org.eclipse.sirius.components.diagrams.layout.incremental.provider.ImageSizeProvider)1 NodeSizeProvider (org.eclipse.sirius.components.diagrams.layout.incremental.provider.NodeSizeProvider)1 IRepresentationDescription (org.eclipse.sirius.components.representations.IRepresentationDescription)1