eclipse-sirius / sirius-web

Sirius Web: open-source low-code platform to define custom web applications supporting your specific visual languages
https://eclipse.dev/sirius/sirius-web.html
Eclipse Public License 2.0
79 stars 52 forks source link

Add support for tools on multiple diagram elements (group tool for example) #2450

Open sbegaudeau opened 1 year ago

sbegaudeau commented 1 year ago

A couple of things to consider in a shape:

Let's consider the following pseudo-code of a diagram description:

DiagramDescription {
  name: 'Class Diagram'
  domainClass: 'code::Package'

  nodeDescriptions: [
    NodeDescription {
      name: 'Package Node Description'
      domainClass: 'code::Package',
      reusedChildNodeDescriptions: [
        'Package Node Description',
        'Class Node Description',
        'Interface Node Description'
      ]
    },
    NodeDescription {
      name: 'Class Node Description'
      domainClass: 'code::Class'
    },
    NodeDescription {
      name: 'Interface Node Description'
      domainClass 'code::Interface'
    }
  ]
  edgeDescriptions: [
    EdgeDescription {
      name: 'Relation Edge Description'
      from: ['Class Node Description', 'Interface Node Description']
      to: ['Class Node Description', 'Interface Node Description']
    },
    EdgeDescription {
      name: 'Extends Edge Description'
      from: ['Class Node Description']
      to: ['Class Node Description']
    },
    EdgeDescription {
      name: 'Implements Edge Description'
      from: ['Class Node Description']
      to: ['Interface Node Description']
    }
  ]
}

This description is for a class diagram like representation with packages, classes and interfaces on the background of the diagram. You can also have subpackages, classes and interfaces inside of packages. You can also have a class extending another class or implementing an interface. A very basic use case for a Sirius Web diagram.

We want to define tools that can act on multiple diagram elements. Here are a couple of use cases that we want to support:

Now that we have our use cases, here are a couple of questions that needs to be answered:

pcdavid commented 8 months ago

Also: how to tell the end-user which tools are not available just because his selection does not exactly match the tool's criterion. In the example above, assume we have 10 classes on the diagrams and one interface in the middle (that he may not notice). The user selected all the classes with a zone/rectangle selection tool, but just because there is a single interface in the selection, the tool he wanted to use (which only handles classes) is nowhere to be seen in the palette, with no feedback about why. That could be confusing.