Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • LayoutContext.DOMAIN_MODEL – The domain model element linked to the current diagram part.
  • LayoutContext.CONTAINER_DIAGRAM_PART – The diagram part that corresponds to the graph or subgraph that contains the current diagram part. This is called the container. If The current diagram part is already the top-level element of the diagram, then there is no container and null should be returned.
  • LayoutContext.CONTAINER_DOMAIN_MODEL – The domain model element linked to the container.
  • LayoutContext.OPT_TARGETS – A set containing the kind of graph element that corresponds to the current diagram part, referenced with the enumeration LayoutOptionData.Target. If the diagram part is a node, for example, the set should contain the value NODES. If the node is also a container for a subgraph, the set should additionally contain the value PARENTS.
  • DefaultLayoutConfig.HAS_PORTS – If the current diagram part is a node, the returned value for this property should be true or false depending on whether the node has any ports or not. Ports are explicit connection points for edges; they occur frequently in data flow diagrams.
  • DefaultLayoutConfig.CONTENT_HINT – If the diagram contains an annotation about which layout algorithm to use for the content of the current diagram part, the returned value for this property should be the identifier of that algorithm. This is the same kind of annotation that is accessed through getOptionValue(), i.e. a value set by the user with the Layout View.
  • DefaultLayoutConfig.CONTAINER_HINT – The same as for CONTENT_HINT, but referring to the container.

Step 2: Add the Configurator to the Layout Mapping

This is simple. In the buildLayoutGraph() method of your diagram layout manager, add an instance of your self-made configurator to the list of configurators of the created LayoutMapping. This makes sure that the options configured in the layout view are actually applied in the layout process.

Step 3: Implement the Adapter Factory Pattern

IDiagramLayoutManager is a subinterface of IAdapterFactory, an interface provided by Eclipse. As such, your diagram layout manager must implement getAdapter(Object, Class).