C# Class Smrf.NodeXL.Visualization.Wpf.GraphDrawer

Draws a NodeXL graph onto a collection of Visual objects.
This is used to draw a NodeXL graph in a WPF application. It contains a collection of Visual objects that represent the graph's vertices and edges. Call DrawGraph to draw a laid-out NodeXL graph onto the contained GraphDrawer.VisualCollection.

GraphDrawer does not lay out the graph. You should lay out the graph using one of the provided layout classes before calling .

A GraphDrawer cannot be directly rendered and is typically not used directly by an application. Applications typically use one of two other NodeXL graph-drawing classes:

NodeXLControl, which is a FrameworkElement that wraps a and hosts its . NodeXLControl is meant for use in WPF desktop applications. It automatically lays out the graph before drawing it. NodeXLVisual, which is a Visual that wraps a and hosts its . This is a lower-level alternative to NodeXLControl and can be used anywhere a Visual is more appropriate than a FrameworkElement. Like GraphDrawer, does not lay out the graph before drawing it.

If you do use GraphDrawer directly, rendering the graph requires a custom wrapper that hosts the GraphDrawer. object.

Inheritance: DrawerBase
Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Свойство Type Description
m_oAllVertexDrawingVisuals System.Windows.Media.DrawingVisual
m_oBackColor Color
m_oBackgroundImage ImageSource
m_oEdgeDrawer EdgeDrawer
m_oGroupDrawer GroupDrawer
m_oSelectedEdgeDrawingVisuals DrawingVisual
m_oUnselectedEdgeDrawingVisuals DrawingVisual
m_oVertexDrawer VertexDrawer
m_oVisualCollection VisualCollection

Méthodes publiques

Méthode Description
AddVisualOnTopOfGraph ( Visual visual ) : void
AssertValid ( ) : void
DrawGraph ( IGraph graph, GraphDrawingContext graphDrawingContext ) : void
DrawNewEdge ( IEdge newEdge, GraphDrawingContext graphDrawingContext ) : void
DrawNewVertex ( IVertex newVertex, GraphDrawingContext graphDrawingContext ) : void
GetVerticesFromRectangle ( Rect rectangle ) : ICollection
GraphDrawer ( Visual parentVisual ) : System

Initializes a new instance of the GraphDrawer class.

RedrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
RedrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void
RemoveVisualFromTopOfGraph ( Visual visual ) : void
TryGetVertexFromPoint ( Point point, IVertex &vertex ) : System.Boolean
UndrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
UndrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void

Méthodes protégées

Méthode Description
DrawBackground ( IGraph oGraph, GraphDrawingContext oGraphDrawingContext ) : void
DrawEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext ) : void
DrawVertex ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext ) : void
GetEdgeDrawingVisuals ( EdgeDrawingHistory oEdgeDrawingHistory ) : System.Windows.Media.DrawingVisual
GetVerticesToDraw ( IGraph oGraph ) : ICollection
RetrieveVertexFromDrawingVisual ( System.Windows.Media.DrawingVisual oDrawingVisual ) : IVertex
SaveVertexOnDrawingVisual ( IVertex oVertex, System.Windows.Media.DrawingVisual oDrawingVisual ) : void

Method Details

AddVisualOnTopOfGraph() public méthode

public AddVisualOnTopOfGraph ( Visual visual ) : void
visual Visual
Résultat void

AssertValid() public méthode

public AssertValid ( ) : void
Résultat void

DrawBackground() protected méthode

protected DrawBackground ( IGraph oGraph, GraphDrawingContext oGraphDrawingContext ) : void
oGraph IGraph
oGraphDrawingContext GraphDrawingContext
Résultat void

DrawEdge() protected méthode

protected DrawEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext ) : void
oEdge IEdge
oGraphDrawingContext GraphDrawingContext
Résultat void

DrawGraph() public méthode

public DrawGraph ( IGraph graph, GraphDrawingContext graphDrawingContext ) : void
graph IGraph
graphDrawingContext GraphDrawingContext
Résultat void

DrawNewEdge() public méthode

public DrawNewEdge ( IEdge newEdge, GraphDrawingContext graphDrawingContext ) : void
newEdge IEdge
graphDrawingContext GraphDrawingContext
Résultat void

DrawNewVertex() public méthode

public DrawNewVertex ( IVertex newVertex, GraphDrawingContext graphDrawingContext ) : void
newVertex IVertex
graphDrawingContext GraphDrawingContext
Résultat void

DrawVertex() protected méthode

protected DrawVertex ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext ) : void
oVertex IVertex
oGraphDrawingContext GraphDrawingContext
Résultat void

GetEdgeDrawingVisuals() protected méthode

protected GetEdgeDrawingVisuals ( EdgeDrawingHistory oEdgeDrawingHistory ) : System.Windows.Media.DrawingVisual
oEdgeDrawingHistory EdgeDrawingHistory
Résultat System.Windows.Media.DrawingVisual

GetVerticesFromRectangle() public méthode

public GetVerticesFromRectangle ( Rect rectangle ) : ICollection
rectangle System.Windows.Rect
Résultat ICollection

GetVerticesToDraw() protected méthode

protected GetVerticesToDraw ( IGraph oGraph ) : ICollection
oGraph IGraph
Résultat ICollection

GraphDrawer() public méthode

Initializes a new instance of the GraphDrawer class.
public GraphDrawer ( Visual parentVisual ) : System
parentVisual Visual /// The parent of the contained . This is usually a /// FrameworkElement that is hosting the collection. ///
Résultat System

RedrawEdge() public méthode

public RedrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
edge IEdge
graphDrawingContext GraphDrawingContext
Résultat void

RedrawVertex() public méthode

public RedrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void
vertex IVertex
graphDrawingContext GraphDrawingContext
Résultat void

RemoveVisualFromTopOfGraph() public méthode

public RemoveVisualFromTopOfGraph ( Visual visual ) : void
visual Visual
Résultat void

RetrieveVertexFromDrawingVisual() protected méthode

protected RetrieveVertexFromDrawingVisual ( System.Windows.Media.DrawingVisual oDrawingVisual ) : IVertex
oDrawingVisual System.Windows.Media.DrawingVisual
Résultat IVertex

SaveVertexOnDrawingVisual() protected méthode

protected SaveVertexOnDrawingVisual ( IVertex oVertex, System.Windows.Media.DrawingVisual oDrawingVisual ) : void
oVertex IVertex
oDrawingVisual System.Windows.Media.DrawingVisual
Résultat void

TryGetVertexFromPoint() public méthode

public TryGetVertexFromPoint ( Point point, IVertex &vertex ) : System.Boolean
point Point
vertex IVertex
Résultat System.Boolean

UndrawEdge() public méthode

public UndrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
edge IEdge
graphDrawingContext GraphDrawingContext
Résultat void

UndrawVertex() public méthode

public UndrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void
vertex IVertex
graphDrawingContext GraphDrawingContext
Résultat void

Property Details

m_oAllVertexDrawingVisuals protected_oe property

protected DrawingVisual,System.Windows.Media m_oAllVertexDrawingVisuals
Résultat System.Windows.Media.DrawingVisual

m_oBackColor protected_oe property

protected Color m_oBackColor
Résultat Color

m_oBackgroundImage protected_oe property

protected ImageSource m_oBackgroundImage
Résultat ImageSource

m_oEdgeDrawer protected_oe property

protected EdgeDrawer m_oEdgeDrawer
Résultat EdgeDrawer

m_oGroupDrawer protected_oe property

protected GroupDrawer m_oGroupDrawer
Résultat GroupDrawer

m_oSelectedEdgeDrawingVisuals protected_oe property

protected DrawingVisual m_oSelectedEdgeDrawingVisuals
Résultat DrawingVisual

m_oUnselectedEdgeDrawingVisuals protected_oe property

protected DrawingVisual m_oUnselectedEdgeDrawingVisuals
Résultat DrawingVisual

m_oVertexDrawer protected_oe property

protected VertexDrawer m_oVertexDrawer
Résultat VertexDrawer

m_oVisualCollection protected_oe property

protected VisualCollection m_oVisualCollection
Résultat VisualCollection