Exemplo n.º 1
0
        /// <summary>
        /// Inserts the given cell into its parent and terminal cells.
        /// </summary>
        /// <param name="cell"></param>
        public void InsertIntoGraph(mxICell cell)
        {
            mxICell parent = cell.Parent;
            mxICell source = cell.GetTerminal(true);
            mxICell target = cell.GetTerminal(false);

            // Fixes possible inconsistencies during insert into graph
            cell.SetTerminal(null, false);
            cell.SetTerminal(null, true);
            cell.Parent = null;

            if (parent != null)
            {
                parent.Insert(cell);
            }

            if (source != null)
            {
                source.InsertEdge(cell, true);
            }

            if (target != null)
            {
                target.InsertEdge(cell, false);
            }
        }
Exemplo n.º 2
0
        /* (non-Dotnetdoc)
         * see com.mxgraph.mxICell.RemoveEdge(mxICell, bool)
         */
        public mxICell RemoveEdge(mxICell edge, bool isOutgoing)
        {
            if (edge != null)
            {
                if (edge.GetTerminal(!isOutgoing) != this &&
                    edges != null)
                {
                    edges.Remove(edge);
                }

                edge.SetTerminal(null, isOutgoing);
            }
            return(edge);
        }
Exemplo n.º 3
0
        /* (non-Dotnetdoc)
         * see com.mxgraph.mxICell.InsertEdge(mxICell, bool)
         */
        public mxICell InsertEdge(mxICell edge, bool isOutgoing)
        {
            if (edge != null)
            {
                edge.RemoveFromTerminal(isOutgoing);
                edge.SetTerminal(this, isOutgoing);

                if (edges == null ||
                    edge.GetTerminal(!isOutgoing) != this ||
                    !edges.Contains(edge))
                {
                    if (edges == null)
                    {
                        edges = new List <mxICell>();
                    }

                    edges.Add(edge);
                }
            }

            return(edge);
        }
Exemplo n.º 4
0
        /* (non-Dotnetdoc)
         * see com.mxgraph.mxICell.RemoveEdge(mxICell, bool)
         */
        public mxICell RemoveEdge(mxICell edge, bool isOutgoing)
        {
            if (edge != null)
            {
                if (edge.GetTerminal(!isOutgoing) != this &&
                    edges != null)
                {
                    edges.Remove(edge);
                }

                edge.SetTerminal(null, isOutgoing);
            }
            return edge;
        }
Exemplo n.º 5
0
        /* (non-Dotnetdoc)
         * see com.mxgraph.mxICell.InsertEdge(mxICell, bool)
         */
        public mxICell InsertEdge(mxICell edge, bool isOutgoing)
        {
            if (edge != null)
            {
                edge.RemoveFromTerminal(isOutgoing);
                edge.SetTerminal(this, isOutgoing);

                if (edges == null ||
                    edge.GetTerminal(!isOutgoing) != this ||
                    !edges.Contains(edge))
                {
                    if (edges == null)
                    {
                        edges = new List<mxICell>();
                    }

                    edges.Add(edge);
                }
            }

            return edge;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Inserts the given cell into its parent and terminal cells.
        /// </summary>
        /// <param name="cell"></param>
        public void InsertIntoGraph(mxICell cell)
        {
            mxICell parent = cell.Parent;
            mxICell source = cell.GetTerminal(true);
            mxICell target = cell.GetTerminal(false);

            // Fixes possible inconsistencies during insert into graph
            cell.SetTerminal(null, false);
            cell.SetTerminal(null, true);
            cell.Parent = null;

            if (parent != null)
            {
                parent.Insert(cell);
            }

            if (source != null)
            {
                source.InsertEdge(cell, true);
            }

            if (target != null)
            {
                target.InsertEdge(cell, false);
            }
        }