Class DefaultLayoutMergeStrategy

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

public class DefaultLayoutMergeStrategy
extends java.lang.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 Summary

    Constructors 
    Constructor Description
    DefaultLayoutMergeStrategy()  
  • Method Summary

    Modifier and Type Method Description
    void copyLayoutInformation​(View viewWithLayoutInformation, View viewWithoutLayoutInformation)
    Attempts to copy the visual layout information (e.g.
    protected ElementView findElementView​(View viewWithLayoutInformation, Element elementWithoutLayoutInformation)
    Finds an element.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • copyLayoutInformation

      public void copyLayoutInformation​(@Nonnull View viewWithLayoutInformation, @Nonnull View 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​(View 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