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

Draws a graph's edges.
This class is responsible for drawing a graph's edges. The default edge appearance is determined by this class's properties. The appearance of an individual edge can be overridden by adding appropriate metadata to the edge. The following metadata keys are honored: ReservedMetadataKeys.Visibility ReservedMetadataKeys.PerColor ReservedMetadataKeys.PerAlpha ReservedMetadataKeys.PerEdgeWidth ReservedMetadataKeys.PerEdgeStyle ReservedMetadataKeys.PerEdgeLabel ReservedMetadataKeys.PerEdgeLabelTextColor ReservedMetadataKeys.IsSelected

The values of the ReservedMetadataKeys.PerColor and ReservedMetadataKeys.PerEdgeLabelTextColor keys can be of type System.Windows.Media.Color or System.Drawing.Color.

If VertexAndEdgeDrawerBase.UseSelection is true, an edge is drawn using VertexAndEdgeDrawerBase.Color or , depending on whether the edge has been marked as selected. If is false, is used regardless of whether the edge has been marked as selected.

When drawing the graph, call TryDrawEdge for each of the graph's edges.

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

Méthodes publiques

Свойство Type Description
MaximumRelativeArrowSize Double
MaximumWidth Double
MinimumRelativeArrowSize Double
MinimumWidth Double

Protected Properties

Свойство Type Description
m_bDrawArrowOnDirectedEdge System.Boolean
m_dBezierDisplacementFactor Double
m_dRelativeArrowSize Double
m_dWidth Double
m_eCurveStyle EdgeCurveStyle
m_oLabelTextColor Color

Méthodes publiques

Méthode Description
AssertValid ( ) : void
EdgeDrawer ( ) : System

Initializes a new instance of the EdgeDrawer class.

TryDrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext, EdgeDrawingHistory &edgeDrawingHistory ) : System.Boolean

Méthodes protégées

Méthode Description
DrawArrow ( System.Windows.Media.DrawingContext oDrawingContext, Point oArrowTipLocation, Double dArrowAngle, Color oColor, Double dEdgeWidth ) : Point
DrawBezierCurve ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Boolean bDrawAsSelected, System.Boolean bDrawArrow, System.Windows.Media.Pen oPen, Color oColor, Double dWidth, VisibilityKeyValue eVisibility, String sLabel ) : void
DrawBezierLabel ( System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.FormattedText oFormattedText, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Windows.Media.PathGeometry oBezierCurve, Double dLabelOriginAsFractionOfEdgeLength, Double dEdgeLength, Double dBufferWidth, Color oLabelTextColor, Color oTranslucentRectangleColor, Double dFontSize ) : void
DrawCurveThroughIntermediatePoints ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, VertexDrawingHistory oVertex1DrawingHistory, VertexDrawingHistory oVertex2DrawingHistory, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Windows.Media.Pen oPen ) : void
DrawLabel ( IEdge oEdge, System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, System.Boolean bDrawAsSelected, Color oEdgeColor, VisibilityKeyValue eVisibility, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Windows.Media.PathGeometry oBezierCurve, Point oBezierControlPoint, String sLabel ) : void
DrawSelfLoopAt ( System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, Color oColor, Double dWidth, Point oSelfLoopEndpoint, RectangleEdge eFarthestGraphRectangleEdge, System.Boolean bDrawArrow ) : void
DrawStraightEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Boolean bDrawAsSelected, System.Boolean bDrawArrow, System.Windows.Media.Pen oPen, Color oColor, Double dWidth, VisibilityKeyValue eVisibility, String sLabel ) : void
DrawStraightLabel ( System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.FormattedText oFormattedText, Point oEdgeEndpoint1, Point oEdgeEndpoint2, Double dLabelOriginAsFractionOfEdgeLength, Double dEdgeLength, Double dBufferWidth, Color oTranslucentRectangleColor ) : void
DrawTranslucentRectangle ( System.Windows.Media.DrawingContext oDrawingContext, Rect oRectangle, Color oColor ) : void
FilterIntermediatePoints ( IEdge oEdge, VertexDrawingHistory oVertex1DrawingHistory, VertexDrawingHistory oVertex2DrawingHistory ) : List
GetDashStyle ( IEdge oEdge, Double dWidth, System.Boolean bDrawAsSelected ) : System.Windows.Media.DashStyle
GetLabelFontSize ( IEdge oEdge ) : Double
GetLabelTextColor ( IEdge oEdge, System.Boolean bDrawAsSelected, Color oEdgeColor, VisibilityKeyValue eVisibility ) : Color
GetWidth ( IEdge oEdge ) : Double
TryDrawSelfLoop ( IVertex oVertex, System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, Color oColor, Double dWidth, System.Boolean bDrawArrow ) : System.Boolean
TryGetVertexInformation ( IVertex oVertex1, IVertex oVertex2, VertexDrawingHistory &oVertex1DrawingHistory, VertexDrawingHistory &oVertex2DrawingHistory, Point &oEdgeEndpoint1, Point &oEdgeEndpoint2 ) : System.Boolean

Method Details

AssertValid() public méthode

public AssertValid ( ) : void
Résultat void

DrawArrow() protected méthode

protected DrawArrow ( System.Windows.Media.DrawingContext oDrawingContext, Point oArrowTipLocation, Double dArrowAngle, Color oColor, Double dEdgeWidth ) : Point
oDrawingContext System.Windows.Media.DrawingContext
oArrowTipLocation Point
dArrowAngle Double
oColor Color
dEdgeWidth Double
Résultat Point

DrawBezierCurve() protected méthode

protected DrawBezierCurve ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Boolean bDrawAsSelected, System.Boolean bDrawArrow, System.Windows.Media.Pen oPen, Color oColor, Double dWidth, VisibilityKeyValue eVisibility, String sLabel ) : void
oEdge IEdge
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
bDrawAsSelected System.Boolean
bDrawArrow System.Boolean
oPen System.Windows.Media.Pen
oColor Color
dWidth Double
eVisibility VisibilityKeyValue
sLabel String
Résultat void

DrawBezierLabel() protected méthode

protected DrawBezierLabel ( System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.FormattedText oFormattedText, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Windows.Media.PathGeometry oBezierCurve, Double dLabelOriginAsFractionOfEdgeLength, Double dEdgeLength, Double dBufferWidth, Color oLabelTextColor, Color oTranslucentRectangleColor, Double dFontSize ) : void
oDrawingContext System.Windows.Media.DrawingContext
oGraphDrawingContext GraphDrawingContext
oFormattedText System.Windows.Media.FormattedText
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
oBezierCurve System.Windows.Media.PathGeometry
dLabelOriginAsFractionOfEdgeLength Double
dEdgeLength Double
dBufferWidth Double
oLabelTextColor Color
oTranslucentRectangleColor Color
dFontSize Double
Résultat void

DrawCurveThroughIntermediatePoints() protected méthode

protected DrawCurveThroughIntermediatePoints ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, VertexDrawingHistory oVertex1DrawingHistory, VertexDrawingHistory oVertex2DrawingHistory, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Windows.Media.Pen oPen ) : void
oEdge IEdge
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oVertex1DrawingHistory VertexDrawingHistory
oVertex2DrawingHistory VertexDrawingHistory
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
oPen System.Windows.Media.Pen
Résultat void

DrawLabel() protected méthode

protected DrawLabel ( IEdge oEdge, System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, System.Boolean bDrawAsSelected, Color oEdgeColor, VisibilityKeyValue eVisibility, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Windows.Media.PathGeometry oBezierCurve, Point oBezierControlPoint, String sLabel ) : void
oEdge IEdge
oDrawingContext System.Windows.Media.DrawingContext
oGraphDrawingContext GraphDrawingContext
bDrawAsSelected System.Boolean
oEdgeColor Color
eVisibility VisibilityKeyValue
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
oBezierCurve System.Windows.Media.PathGeometry
oBezierControlPoint Point
sLabel String
Résultat void

DrawSelfLoopAt() protected méthode

protected DrawSelfLoopAt ( System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, Color oColor, Double dWidth, Point oSelfLoopEndpoint, RectangleEdge eFarthestGraphRectangleEdge, System.Boolean bDrawArrow ) : void
oDrawingContext System.Windows.Media.DrawingContext
oGraphDrawingContext GraphDrawingContext
oColor Color
dWidth Double
oSelfLoopEndpoint Point
eFarthestGraphRectangleEdge RectangleEdge
bDrawArrow System.Boolean
Résultat void

DrawStraightEdge() protected méthode

protected DrawStraightEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Boolean bDrawAsSelected, System.Boolean bDrawArrow, System.Windows.Media.Pen oPen, Color oColor, Double dWidth, VisibilityKeyValue eVisibility, String sLabel ) : void
oEdge IEdge
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
bDrawAsSelected System.Boolean
bDrawArrow System.Boolean
oPen System.Windows.Media.Pen
oColor Color
dWidth Double
eVisibility VisibilityKeyValue
sLabel String
Résultat void

DrawStraightLabel() protected méthode

protected DrawStraightLabel ( System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.FormattedText oFormattedText, Point oEdgeEndpoint1, Point oEdgeEndpoint2, Double dLabelOriginAsFractionOfEdgeLength, Double dEdgeLength, Double dBufferWidth, Color oTranslucentRectangleColor ) : void
oDrawingContext System.Windows.Media.DrawingContext
oGraphDrawingContext GraphDrawingContext
oFormattedText System.Windows.Media.FormattedText
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
dLabelOriginAsFractionOfEdgeLength Double
dEdgeLength Double
dBufferWidth Double
oTranslucentRectangleColor Color
Résultat void

DrawTranslucentRectangle() protected méthode

protected DrawTranslucentRectangle ( System.Windows.Media.DrawingContext oDrawingContext, Rect oRectangle, Color oColor ) : void
oDrawingContext System.Windows.Media.DrawingContext
oRectangle System.Windows.Rect
oColor Color
Résultat void

EdgeDrawer() public méthode

Initializes a new instance of the EdgeDrawer class.
public EdgeDrawer ( ) : System
Résultat System

FilterIntermediatePoints() protected méthode

protected FilterIntermediatePoints ( IEdge oEdge, VertexDrawingHistory oVertex1DrawingHistory, VertexDrawingHistory oVertex2DrawingHistory ) : List
oEdge IEdge
oVertex1DrawingHistory VertexDrawingHistory
oVertex2DrawingHistory VertexDrawingHistory
Résultat List

GetDashStyle() protected méthode

protected GetDashStyle ( IEdge oEdge, Double dWidth, System.Boolean bDrawAsSelected ) : System.Windows.Media.DashStyle
oEdge IEdge
dWidth Double
bDrawAsSelected System.Boolean
Résultat System.Windows.Media.DashStyle

GetLabelFontSize() protected méthode

protected GetLabelFontSize ( IEdge oEdge ) : Double
oEdge IEdge
Résultat Double

GetLabelTextColor() protected méthode

protected GetLabelTextColor ( IEdge oEdge, System.Boolean bDrawAsSelected, Color oEdgeColor, VisibilityKeyValue eVisibility ) : Color
oEdge IEdge
bDrawAsSelected System.Boolean
oEdgeColor Color
eVisibility VisibilityKeyValue
Résultat Color

GetWidth() protected méthode

protected GetWidth ( IEdge oEdge ) : Double
oEdge IEdge
Résultat Double

TryDrawEdge() public méthode

public TryDrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext, EdgeDrawingHistory &edgeDrawingHistory ) : System.Boolean
edge IEdge
graphDrawingContext GraphDrawingContext
edgeDrawingHistory EdgeDrawingHistory
Résultat System.Boolean

TryDrawSelfLoop() protected méthode

protected TryDrawSelfLoop ( IVertex oVertex, System.Windows.Media.DrawingContext oDrawingContext, GraphDrawingContext oGraphDrawingContext, Color oColor, Double dWidth, System.Boolean bDrawArrow ) : System.Boolean
oVertex IVertex
oDrawingContext System.Windows.Media.DrawingContext
oGraphDrawingContext GraphDrawingContext
oColor Color
dWidth Double
bDrawArrow System.Boolean
Résultat System.Boolean

TryGetVertexInformation() protected méthode

protected TryGetVertexInformation ( IVertex oVertex1, IVertex oVertex2, VertexDrawingHistory &oVertex1DrawingHistory, VertexDrawingHistory &oVertex2DrawingHistory, Point &oEdgeEndpoint1, Point &oEdgeEndpoint2 ) : System.Boolean
oVertex1 IVertex
oVertex2 IVertex
oVertex1DrawingHistory VertexDrawingHistory
oVertex2DrawingHistory VertexDrawingHistory
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
Résultat System.Boolean

Property Details

MaximumRelativeArrowSize public_oe static_oe property

Maximum value of the RelativeArrowSize property. The value is 20.
public static Double MaximumRelativeArrowSize
Résultat Double

MaximumWidth public_oe static_oe property

Maximum value of the Width property. The value is 20.
public static Double MaximumWidth
Résultat Double

MinimumRelativeArrowSize public_oe static_oe property

Minimum value of the RelativeArrowSize property. The value is 0.
public static Double MinimumRelativeArrowSize
Résultat Double

MinimumWidth public_oe static_oe property

Minimum value of the Width property. The value is 1.
public static Double MinimumWidth
Résultat Double

m_bDrawArrowOnDirectedEdge protected_oe property

protected Boolean,System m_bDrawArrowOnDirectedEdge
Résultat System.Boolean

m_dBezierDisplacementFactor protected_oe property

protected Double m_dBezierDisplacementFactor
Résultat Double

m_dRelativeArrowSize protected_oe property

protected Double m_dRelativeArrowSize
Résultat Double

m_dWidth protected_oe property

protected Double m_dWidth
Résultat Double

m_eCurveStyle protected_oe property

protected EdgeCurveStyle m_eCurveStyle
Résultat EdgeCurveStyle

m_oLabelTextColor protected_oe property

protected Color m_oLabelTextColor
Résultat Color