public IDiagram Clear() => CreateInstance(RootLayoutGroup.Clear(), _crossLayoutGroupConnectors.Clear());
//public IEnumerable<IDiagramNode> GetAdjacentNodes(ModelNodeId id, DirectedModelRelationshipType? directedModelRelationshipType = null) //{ // IEnumerable<IDiagramNode> result; // if (directedModelRelationshipType != null) // { // result = _allShapesGraph.GetAdjacentVertices( // id, // directedModelRelationshipType.Value.Direction, // e => e.ModelRelationship.Stereotype == directedModelRelationshipType.Value.Stereotype); // } // else // { // result = _allShapesGraph.GetAdjacentVertices(id, EdgeDirection.In) // .Union(_allShapesGraph.GetAdjacentVertices(id, EdgeDirection.Out)); // } // return result; //} public IDiagram AddNode(IDiagramNode node, ModelNodeId?parentNodeId = null) { return(CreateInstance(RootLayoutGroup.AddNode(node, parentNodeId), _crossLayoutGroupConnectors)); }
public IDiagram RemoveConnector(ModelRelationshipId connectorId) { return(CrossLayoutGroupConnectors.Any(i => i.Id == connectorId) ? CreateInstance(RootLayoutGroup, _crossLayoutGroupConnectors.Remove(connectorId)) : CreateInstance(RootLayoutGroup.RemoveConnector(connectorId), _crossLayoutGroupConnectors)); }
public IDiagram UpdateConnector(IDiagramConnector updatedConnector) { return(IsCrossingLayoutGroups(updatedConnector.Id) ? CreateInstance(RootLayoutGroup, _crossLayoutGroupConnectors.SetItem(updatedConnector.Id, updatedConnector)) : CreateInstance(RootLayoutGroup.UpdateConnector(updatedConnector), _crossLayoutGroupConnectors)); }
public IDiagram AddConnector(IDiagramConnector connector) { return(IsCrossingLayoutGroups(connector.Id) ? CreateInstance(RootLayoutGroup, _crossLayoutGroupConnectors.Add(connector.Id, connector)) : CreateInstance(RootLayoutGroup.AddConnector(connector), _crossLayoutGroupConnectors)); }
public IDiagram RemoveNode(ModelNodeId nodeId) { return(CreateInstance(RootLayoutGroup.RemoveNode(nodeId), _crossLayoutGroupConnectors)); }
public IDiagram UpdateNode(IDiagramNode updatedNode) { return(CreateInstance(RootLayoutGroup.UpdateNode(updatedNode), _crossLayoutGroupConnectors)); }