Example #1
0
 public IDiagram Clear() => CreateInstance(RootLayoutGroup.Clear(), _crossLayoutGroupConnectors.Clear());
Example #2
0
        //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));
        }
Example #3
0
 public IDiagram RemoveConnector(ModelRelationshipId connectorId)
 {
     return(CrossLayoutGroupConnectors.Any(i => i.Id == connectorId)
         ? CreateInstance(RootLayoutGroup, _crossLayoutGroupConnectors.Remove(connectorId))
         : CreateInstance(RootLayoutGroup.RemoveConnector(connectorId), _crossLayoutGroupConnectors));
 }
Example #4
0
 public IDiagram UpdateConnector(IDiagramConnector updatedConnector)
 {
     return(IsCrossingLayoutGroups(updatedConnector.Id)
         ? CreateInstance(RootLayoutGroup, _crossLayoutGroupConnectors.SetItem(updatedConnector.Id, updatedConnector))
         : CreateInstance(RootLayoutGroup.UpdateConnector(updatedConnector), _crossLayoutGroupConnectors));
 }
Example #5
0
 public IDiagram AddConnector(IDiagramConnector connector)
 {
     return(IsCrossingLayoutGroups(connector.Id)
         ? CreateInstance(RootLayoutGroup, _crossLayoutGroupConnectors.Add(connector.Id, connector))
         : CreateInstance(RootLayoutGroup.AddConnector(connector), _crossLayoutGroupConnectors));
 }
Example #6
0
 public IDiagram RemoveNode(ModelNodeId nodeId)
 {
     return(CreateInstance(RootLayoutGroup.RemoveNode(nodeId), _crossLayoutGroupConnectors));
 }
Example #7
0
 public IDiagram UpdateNode(IDiagramNode updatedNode)
 {
     return(CreateInstance(RootLayoutGroup.UpdateNode(updatedNode), _crossLayoutGroupConnectors));
 }