public void AddDiagramNode(IDiagramNode diagramNode) { if (_diagramNodeToLayoutVertexMap.Contains(diagramNode)) { throw new InvalidOperationException($"Diagram node {diagramNode} already added."); } var diagramNodeLayoutPriority = _layoutPriorityProvider.GetPriority(diagramNode); var diagramNodeLayoutVertex = new DiagramNodeLayoutVertex(diagramNode, diagramNode.Name, diagramNodeLayoutPriority); _diagramNodeToLayoutVertexMap.Set(diagramNode, diagramNodeLayoutVertex); _relativeLayoutCalculator.OnDiagramNodeAdded(diagramNodeLayoutVertex); }
private DiagramNodeLayoutVertex CreateLayoutVertex(IDiagramNode diagramNode, Map <ModelNodeId, DiagramNodeLayoutVertex> diagramNodeToLayoutVertexMap) { if (diagramNodeToLayoutVertexMap.Contains(diagramNode.Id)) { throw new InvalidOperationException($"Diagram node {diagramNode} already added."); } var diagramNodeLayoutPriority = _layoutPriorityProvider.GetPriority(diagramNode); var diagramNodeLayoutVertex = new DiagramNodeLayoutVertex(diagramNode, diagramNode.Name, diagramNodeLayoutPriority); diagramNodeToLayoutVertexMap.Set(diagramNode.Id, diagramNodeLayoutVertex); return(diagramNodeLayoutVertex); }