Exemple #1
0
        public void RemoveDiagramLine(DiagramLineBase line)
        {
            Vertex.DeleteEdge(GetLineEdgeFromLineObject(line));

            RemoveFromDiagramLines(line);


            line.ToDiagramItem.RemoveToLine(line);

            line.RemoveFromCanvas();
        }
Exemple #2
0
        IEdge GetLineEdgeFromLineObject(DiagramLineBase line)
        {
            foreach (IEdge e in Vertex.GetAll("DiagramLine:"))
            {
                if (e.To == line.Vertex)
                {
                    return(e);
                }
            }

            return(null);
        }
Exemple #3
0
        public virtual void VertexChange(object sender, VertexChangeEventArgs e)
        {
            if (sender == Vertex.Get(@"BaseEdge:\To:") && e.Type == VertexChangeType.EdgeRemoved)
            {
                DiagramLineBase toRemove = null;

                foreach (DiagramLineBase l in DiagramLines)
                {
                    if (l.Vertex.Get(@"BaseEdge:\Meta:") == e.Edge.Meta &&
                        l.Vertex.Get(@"BaseEdge:\To:") == e.Edge.To)
                    {
                        toRemove = l;
                    }
                }

                if (toRemove != null)
                {
                    RemoveDiagramLine(toRemove);
                }
            }

            if (sender == Vertex.Get(@"BaseEdge:\To:") && e.Type == VertexChangeType.ValueChanged)
            {
                VertexContentChange();
            }

            if (sender == Vertex.Get(@"BaseEdge:\To:") && e.Type == VertexChangeType.EdgeAdded && CanAutomaticallyAddEdges)
            {
                Diagram.CheckAndUpdateDiagramLinesForItem(this);
            }

            if (sender == Vertex.Get(@"LineWidth:") ||
                sender == Vertex.Get(@"BackgroundColor:") || sender == Vertex.Get(@"BackgroundColor:\Red:") || sender == Vertex.Get(@"BackgroundColor:\Green:") || sender == Vertex.Get(@"BackgroundColor:\Blue:") || sender == Vertex.Get(@"BackgroundColor:\Opacity:") ||
                sender == Vertex.Get(@"ForegroundColor:") || sender == Vertex.Get(@"ForegroundColor:\Red:") || sender == Vertex.Get(@"ForegroundColor:\Green:") || sender == Vertex.Get(@"ForegroundColor:\Blue:") || sender == Vertex.Get(@"ForegroundColor:\Opacity:"))
            {
                VisualiserUpdate();
            }

            if (sender == Vertex || e.Type == VertexChangeType.EdgeAdded)
            {
                VisualiserUpdate();
            }
        }
Exemple #4
0
        public void AddDiagramLineObject(DiagramItemBase toItem, IVertex l)
        {
            DiagramLineBase newline = (DiagramLineBase)PlatformClass.CreatePlatformObject(l);

            newline.Diagram = this.Diagram;

            if (newline.Vertex.Get(@"Definition:\DiagramLineVertex:") != null)
            {
                Diagram.AddEdgesFromDefintion(newline.Vertex, newline.Vertex.Get(@"Definition:\DiagramLineVertex:"));
            }

            newline.FromDiagramItem = this;

            newline.ToDiagramItem = toItem;

            newline.AddToCanvas();

            AddToDiagramLines(newline);

            toItem.DiagramToLines.Add(newline);

            UpdateDiagramLines(toItem);
        }
Exemple #5
0
        void RemoveFromDiagramLines(DiagramLineBase toRemove)
        {
            DiagramLines.Remove(toRemove);

            needRebuildDiagramLinesDictionary = true;
        }
Exemple #6
0
        void AddToDiagramLines(DiagramLineBase line)
        {
            DiagramLines.Add(line);

            needRebuildDiagramLinesDictionary = true;
        }
Exemple #7
0
 protected void RemoveToLine(DiagramLineBase line)
 {
     DiagramToLines.Remove(line);
 }
Exemple #8
0
 public void AddAsToMetaLine(DiagramLineBase line)
 {
     DiagramToAsMetaLines.Add(line);
 }