LayOutComponentInBin ( IGraph oGraph, ICollection <IVertex> oVerticesInComponent, Rectangle oBinRectangle ) { Debug.Assert(oGraph != null); Debug.Assert(oVerticesInComponent != null); AssertValid(); oGraph.SetValue(ReservedMetadataKeys.LayOutTheseVerticesOnly, oVerticesInComponent); // Force the FruchtermanReingoldLayout class to randomize the vertices. LayoutMetadataUtil.MarkGraphAsNotLaidOut(oGraph); ILayout oLayout = new FruchtermanReingoldLayout(); oLayout.Margin = BinMargin; LayoutContext oLayoutContext = new LayoutContext(oBinRectangle); oLayout.LayOutGraph(oGraph, oLayoutContext); }
SetUp() { m_oFruchtermanReingoldLayout = new FruchtermanReingoldLayout(); }
LayOutComponentInBin ( IGraph oGraph, ICollection<IVertex> oVerticesInComponent, Rectangle oBinRectangle ) { Debug.Assert(oGraph != null); Debug.Assert(oVerticesInComponent != null); AssertValid(); oGraph.SetValue(ReservedMetadataKeys.LayOutTheseVerticesOnly, oVerticesInComponent); // Force the FruchtermanReingoldLayout class to randomize the vertices. LayoutMetadataUtil.MarkGraphAsNotLaidOut(oGraph); ILayout oLayout = new FruchtermanReingoldLayout(); oLayout.Margin = BinMargin; LayoutContext oLayoutContext = new LayoutContext(oBinRectangle); oLayout.LayOutGraph(oGraph, oLayoutContext); }
//************************************************************************* // Constructor: NodeXLControl() // /// <summary> /// Initializes a new instance of the <see cref="NodeXLControl" /> class. /// </summary> //************************************************************************* public NodeXLControl() { m_oGraph = new Graph(); CreateGraphDrawer(); m_fEdgeBundlerStraightening = 0.15F; m_oLayout = new FruchtermanReingoldLayout(); OnNewLayout(m_oLayout); m_oLastLayoutContext = new LayoutContext(System.Drawing.Rectangle.Empty); m_oLastGraphDrawingContext = null; m_eLayoutState = LayoutState.Stable; m_eMouseMode = MouseMode.Select; m_bMouseAlsoSelectsIncidentEdges = true; m_bAllowVertexDrag = true; m_oVerticesBeingDragged = null; m_oMarqueeBeingDragged = null; m_oTranslationBeingDragged = null; m_oSelectedVertices = new HashSet<IVertex>(); m_oSelectedEdges = new HashSet<IEdge>(); m_oCollapsedGroups = new Dictionary<String, IVertex>(); m_oDoubleClickedVertexInfo = null; m_bShowVertexToolTips = false; m_oLastMouseMoveLocation = new Point(-1, -1); // Create a helper object for displaying vertex tooltips. CreateVertexToolTipTracker(); m_oVertexToolTip = null; m_bGraphZoomCentered = false; this.AddLogicalChild(m_oGraphDrawer.VisualCollection); CreateTransforms(); // Prevent a focus rectangle from being drawn around the control when // it captures keyboard focus. The focus rectangle does not behave // properly when the layout and render transforms are applied -- // sometimes the rectangle disappears, and sometimes it gets magnified // by the render layout. this.FocusVisualStyle = null; // AssertValid(); }