Class DefaultLayoutMergeStrategy

java.lang.Object
com.structurizr.view.DefaultLayoutMergeStrategy
All Implemented Interfaces:
LayoutMergeStrategy

public class DefaultLayoutMergeStrategy extends Object implements LayoutMergeStrategy
A default implementation of a LayoutMergeStrategy that: - Sets the paper size (if not set). - Copies element x,y positions. - Copies relationship vertices. Elements are matched using the following properties, in order: - the element's full canonical name - the element's name - the element's description
  • Constructor Details

    • DefaultLayoutMergeStrategy

      public DefaultLayoutMergeStrategy()
  • Method Details

    • copyLayoutInformation

      public void copyLayoutInformation(@Nonnull ModelView viewWithLayoutInformation, @Nonnull ModelView viewWithoutLayoutInformation)
      Attempts to copy the visual layout information (e.g. x,y coordinates) of elements and relationships from the specified source view into the specified destination view.
      Specified by:
      copyLayoutInformation in interface LayoutMergeStrategy
      Parameters:
      viewWithLayoutInformation - the source view (e.g. the version stored by the Structurizr service)
      viewWithoutLayoutInformation - the destination View (e.g. the new version, created locally with code)
    • findElementView

      protected ElementView findElementView(ModelView viewWithLayoutInformation, Element elementWithoutLayoutInformation)
      Finds an element. Override this to change the behaviour.
      Parameters:
      viewWithLayoutInformation - the view to search
      elementWithoutLayoutInformation - the Element to find
      Returns:
      an ElementView