Package com.structurizr.view
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 by the full canonical name. The downside of this approach is that if an element is renamed
between versions of a workspace, it won't be possible to find/copy the layout information associated with an element.
-
Constructor Summary
Constructors Constructor Description DefaultLayoutMergeStrategy()
-
Method Summary
Modifier and Type Method Description void
copyLayoutInformation(View sourceView, View destinationView)
Attempts to copy the visual layout information (e.g.protected ElementView
findElementView(View view, Element element)
Finds an element by canonical name.protected RelationshipView
findRelationshipView(View view, Relationship relationship)
protected RelationshipView
findRelationshipView(View view, RelationshipView relationshipView)
-
Constructor Details
-
DefaultLayoutMergeStrategy
public DefaultLayoutMergeStrategy()
-
-
Method Details
-
copyLayoutInformation
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 interfaceLayoutMergeStrategy
- Parameters:
sourceView
- the source view (e.g. the version stored by the Structurizr service)destinationView
- the destination View (e.g. the new version, created locally with code)
-
findElementView
Finds an element by canonical name. Override this to change the behaviour.- Parameters:
view
- the view to searchelement
- the Element to find- Returns:
- an ElementView
-
findRelationshipView
-
findRelationshipView
-