internal UndoRedoAction InsertToListAndSetTheBoxBefore(UndoRedoAction action)
 {
     UndoRedoActionsList.AddAction(action);
     action.GraphBoundingBoxBefore = action.Graph.BoundingBox;
     RaiseChangeInUndoList();
     return(action);
 }
 /// <summary>
 ///     clear the editor
 /// </summary>
 public void Clear()
 {
     objectsToDrag = new Set <GeometryObject>();
     edgesDraggedWithSource.Clear();
     edgesDraggedWithTarget.Clear();
     UndoRedoActionsList = new UndoRedoActionsList();
     EditedEdge          = null;
 }
 /// <summary>
 /// clear the editor
 /// </summary>
 public void Clear()
 {
     this.objectsToDrag = new Set <GeometryObject>();
     this.edgesDraggedForTheSource.Clear();
     this.edgesDraggedForTheTarget.Clear();
     this.undoRedoActionsList = new UndoRedoActionsList();
     this.EditedEdge          = null;
 }
        /// <summary>
        ///     creates a "tight" bounding box
        /// </summary>
        /// <param name="affectedEntity">the object corresponding to the graph</param>
        /// <param name="geometryGraph"></param>
        public void FitGraphBoundingBox(IViewerObject affectedEntity, GeometryGraph geometryGraph)
        {
            if (geometryGraph != null)
            {
                var uAction = new UndoRedoAction(geometryGraph)
                {
                    Graph = geometryGraph
                };
                UndoRedoActionsList.AddAction(uAction);
                var r = new Rectangle();
                foreach (GeomNode n in geometryGraph.Nodes)
                {
                    r = n.BoundingBox;
                    break;
                }
                foreach (GeomNode n in geometryGraph.Nodes)
                {
                    r.Add(n.BoundingBox);
                }
                foreach (GeomEdge e in geometryGraph.Edges)
                {
                    r.Add(e.BoundingBox);
                    if (e.Label != null)
                    {
                        r.Add(e.Label.BoundingBox);
                    }
                }


                r.Left   -= geometryGraph.Margins;
                r.Top    += geometryGraph.Margins;
                r.Bottom -= geometryGraph.Margins;
                r.Right  += geometryGraph.Margins;
                uAction.ClearAffectedObjects();
                uAction.AddAffectedObject(affectedEntity);
                uAction.GraphBoundingBoxAfter = geometryGraph.BoundingBox = r;
            }
        }
 /// <summary>
 ///     clear the editor
 /// </summary>
 public void Clear() {
     objectsToDrag = new Set<GeometryObject>();
     edgesDraggedWithSource.Clear();
     edgesDraggedWithTarget.Clear();
     UndoRedoActionsList = new UndoRedoActionsList();
     EditedEdge = null;
 }