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

Draws a graph's vertices.
This class is responsible for drawing a graph's vertices. The default vertex appearance is determined by this class's properties. The appearance of an individual vertex can be overridden by adding appropriate metadata to the vertex. The following metadata keys are honored: ReservedMetadataKeys.Visibility ReservedMetadataKeys.IsSelected ReservedMetadataKeys.PerColor ReservedMetadataKeys.PerAlpha ReservedMetadataKeys.PerVertexShape ReservedMetadataKeys.PerVertexRadius ReservedMetadataKeys.PerVertexLabel ReservedMetadataKeys.PerVertexLabelFillColor ReservedMetadataKeys.PerVertexLabelPosition ReservedMetadataKeys.PerVertexImage

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

If a vertex has the shape VertexShape.Label and has the ReservedMetadataKeys.PerVertexLabel key, the vertex is drawn as a rectangle containing the text specified by the key's value. The default color of the text and the rectangle's outline is , but can be overridden with the ReservedMetadataKeys.PerColor key. The default fill color of the rectangle is LabelFillColor, but can be overridden with the ReservedMetadataKeys.PerVertexLabelFillColor key.

If a vertex has a shape other than VertexShape.Label and has the ReservedMetadataKeys.PerVertexLabel key, the vertex is drawn as the specified shape, and the text specified by the key's value is drawn next to the vertex as an annotation at the position determined by .

If a vertex has the shape VertexShape.Image and has the key, the vertex is drawn as the image specified by the key's value.

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

When drawing the graph, call TryDrawVertex for each of the graph's vertices.

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

Méthodes publiques

Свойство Type Description
MaximumRadius Double
MaximumRelativeOuterGlowSize Double
MinimumRadius Double
MinimumRelativeOuterGlowSize Double

Protected Properties

Свойство Type Description
m_bLabelWrapText System.Boolean
m_bLimitVerticesToBounds System.Boolean
m_btBackgroundAlpha Byte
m_dLabelWrapMaxTextWidth Double
m_dRadius Double
m_dRelativeOuterGlowSize Double
m_eEffect VertexEffect
m_eLabelPosition VertexLabelPosition
m_eShape VertexShape
m_oLabelFillColor Color

Méthodes publiques

Méthode Description
AssertValid ( ) : void
TryDrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext, VertexDrawingHistory &vertexDrawingHistory ) : System.Boolean
VertexDrawer ( ) : System

Initializes a new instance of the VertexDrawer class.

Méthodes protégées

Méthode Description
CheckDrawVertexArguments ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext ) : void
CreateFormattedTextWithWrap ( String sText, Color oColor, Double dFontSize ) : System.Windows.Media.FormattedText
DrawImageShape ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, DrawingVisualPlus oDrawingVisual, VisibilityKeyValue eVisibility, System.Boolean bDrawAsSelected, String sAnnotation, System.Windows.Media.ImageSource oImageSource, VertexLabelDrawer oVertexLabelDrawer, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager ) : VertexDrawingHistory
DrawLabelShape ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, DrawingVisualPlus oDrawingVisual, VisibilityKeyValue eVisibility, System.Boolean bDrawAsSelected, String sLabel, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager ) : VertexDrawingHistory
DrawSimpleShape ( IVertex oVertex, VertexShape eShape, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, DrawingVisualPlus oDrawingVisual, VisibilityKeyValue eVisibility, System.Boolean bDrawAsSelected, String sAnnotation, VertexLabelDrawer oVertexLabelDrawer, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager ) : VertexDrawingHistory
GetDropShadowEffect ( Color oColor, Double dShadowDepth, Double dBlurRadius, Double dOpacity ) : System.Windows.Media.Effects.DropShadowEffect
GetEffectForDropShadow ( GraphDrawingContext oGraphDrawingContext, Double dShadowDepth, Double dOpacity ) : System.Windows.Media.Effects.Effect
GetEffectForOuterGlow ( Color oColor, Double dGlowSize, Double dOpacity ) : System.Windows.Media.Effects.Effect
GetLabelFontSize ( IVertex oVertex ) : Double
GetLabelPadding ( Double dLabelFontSize ) : Double
GetRadius ( IVertex oVertex ) : Double
GetRectangleEffect ( GraphDrawingContext oGraphDrawingContext, Color oColor ) : System.Windows.Media.Effects.Effect
GetShape ( IVertex oVertex ) : VertexShape
GetSimpleShapeEffect ( GraphDrawingContext oGraphDrawingContext, Double dRadius, Color oColor ) : System.Windows.Media.Effects.Effect
GetVertexLocation ( IVertex oVertex ) : Point
GetVertexRectangle ( Point oLocation, Double dWidth, Double dHeight ) : Rect
MoveVertexIfNecessary ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager, Rect &oVertexBounds ) : void

Method Details

AssertValid() public méthode

public AssertValid ( ) : void
Résultat void

CheckDrawVertexArguments() protected méthode

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

CreateFormattedTextWithWrap() protected méthode

protected CreateFormattedTextWithWrap ( String sText, Color oColor, Double dFontSize ) : System.Windows.Media.FormattedText
sText String
oColor Color
dFontSize Double
Résultat System.Windows.Media.FormattedText

DrawImageShape() protected méthode

protected DrawImageShape ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, DrawingVisualPlus oDrawingVisual, VisibilityKeyValue eVisibility, System.Boolean bDrawAsSelected, String sAnnotation, System.Windows.Media.ImageSource oImageSource, VertexLabelDrawer oVertexLabelDrawer, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager ) : VertexDrawingHistory
oVertex IVertex
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oDrawingVisual Smrf.WpfGraphicsLib.DrawingVisualPlus
eVisibility VisibilityKeyValue
bDrawAsSelected System.Boolean
sAnnotation String
oImageSource System.Windows.Media.ImageSource
oVertexLabelDrawer VertexLabelDrawer
oCollapsedGroupDrawingManager CollapsedGroupDrawingManager
Résultat VertexDrawingHistory

DrawLabelShape() protected méthode

protected DrawLabelShape ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, DrawingVisualPlus oDrawingVisual, VisibilityKeyValue eVisibility, System.Boolean bDrawAsSelected, String sLabel, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager ) : VertexDrawingHistory
oVertex IVertex
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oDrawingVisual Smrf.WpfGraphicsLib.DrawingVisualPlus
eVisibility VisibilityKeyValue
bDrawAsSelected System.Boolean
sLabel String
oCollapsedGroupDrawingManager CollapsedGroupDrawingManager
Résultat VertexDrawingHistory

DrawSimpleShape() protected méthode

protected DrawSimpleShape ( IVertex oVertex, VertexShape eShape, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, DrawingVisualPlus oDrawingVisual, VisibilityKeyValue eVisibility, System.Boolean bDrawAsSelected, String sAnnotation, VertexLabelDrawer oVertexLabelDrawer, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager ) : VertexDrawingHistory
oVertex IVertex
eShape VertexShape
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oDrawingVisual Smrf.WpfGraphicsLib.DrawingVisualPlus
eVisibility VisibilityKeyValue
bDrawAsSelected System.Boolean
sAnnotation String
oVertexLabelDrawer VertexLabelDrawer
oCollapsedGroupDrawingManager CollapsedGroupDrawingManager
Résultat VertexDrawingHistory

GetDropShadowEffect() protected méthode

protected GetDropShadowEffect ( Color oColor, Double dShadowDepth, Double dBlurRadius, Double dOpacity ) : System.Windows.Media.Effects.DropShadowEffect
oColor Color
dShadowDepth Double
dBlurRadius Double
dOpacity Double
Résultat System.Windows.Media.Effects.DropShadowEffect

GetEffectForDropShadow() protected méthode

protected GetEffectForDropShadow ( GraphDrawingContext oGraphDrawingContext, Double dShadowDepth, Double dOpacity ) : System.Windows.Media.Effects.Effect
oGraphDrawingContext GraphDrawingContext
dShadowDepth Double
dOpacity Double
Résultat System.Windows.Media.Effects.Effect

GetEffectForOuterGlow() protected méthode

protected GetEffectForOuterGlow ( Color oColor, Double dGlowSize, Double dOpacity ) : System.Windows.Media.Effects.Effect
oColor Color
dGlowSize Double
dOpacity Double
Résultat System.Windows.Media.Effects.Effect

GetLabelFontSize() protected méthode

protected GetLabelFontSize ( IVertex oVertex ) : Double
oVertex IVertex
Résultat Double

GetLabelPadding() protected méthode

protected GetLabelPadding ( Double dLabelFontSize ) : Double
dLabelFontSize Double
Résultat Double

GetRadius() protected méthode

protected GetRadius ( IVertex oVertex ) : Double
oVertex IVertex
Résultat Double

GetRectangleEffect() protected méthode

protected GetRectangleEffect ( GraphDrawingContext oGraphDrawingContext, Color oColor ) : System.Windows.Media.Effects.Effect
oGraphDrawingContext GraphDrawingContext
oColor Color
Résultat System.Windows.Media.Effects.Effect

GetShape() protected méthode

protected GetShape ( IVertex oVertex ) : VertexShape
oVertex IVertex
Résultat VertexShape

GetSimpleShapeEffect() protected méthode

protected GetSimpleShapeEffect ( GraphDrawingContext oGraphDrawingContext, Double dRadius, Color oColor ) : System.Windows.Media.Effects.Effect
oGraphDrawingContext GraphDrawingContext
dRadius Double
oColor Color
Résultat System.Windows.Media.Effects.Effect

GetVertexLocation() protected méthode

protected GetVertexLocation ( IVertex oVertex ) : Point
oVertex IVertex
Résultat Point

GetVertexRectangle() protected méthode

protected GetVertexRectangle ( Point oLocation, Double dWidth, Double dHeight ) : Rect
oLocation Point
dWidth Double
dHeight Double
Résultat System.Windows.Rect

MoveVertexIfNecessary() protected méthode

protected MoveVertexIfNecessary ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext, CollapsedGroupDrawingManager oCollapsedGroupDrawingManager, Rect &oVertexBounds ) : void
oVertex IVertex
oGraphDrawingContext GraphDrawingContext
oCollapsedGroupDrawingManager CollapsedGroupDrawingManager
oVertexBounds System.Windows.Rect
Résultat void

TryDrawVertex() public méthode

public TryDrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext, VertexDrawingHistory &vertexDrawingHistory ) : System.Boolean
vertex IVertex
graphDrawingContext GraphDrawingContext
vertexDrawingHistory VertexDrawingHistory
Résultat System.Boolean

VertexDrawer() public méthode

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

Property Details

MaximumRadius public_oe static_oe property

Maximum value of the Radius property. The value is 549.0.
public static Double MaximumRadius
Résultat Double

MaximumRelativeOuterGlowSize public_oe static_oe property

Maximum value of the RelativeOuterGlowSize property. The value is 10.0.
public static Double MaximumRelativeOuterGlowSize
Résultat Double

MinimumRadius public_oe static_oe property

Minimum value of the Radius property. The value is 0.1.
public static Double MinimumRadius
Résultat Double

MinimumRelativeOuterGlowSize public_oe static_oe property

Minimum value of the RelativeOuterGlowSize property. The value is 1.0.
public static Double MinimumRelativeOuterGlowSize
Résultat Double

m_bLabelWrapText protected_oe property

protected Boolean,System m_bLabelWrapText
Résultat System.Boolean

m_bLimitVerticesToBounds protected_oe property

protected Boolean,System m_bLimitVerticesToBounds
Résultat System.Boolean

m_btBackgroundAlpha protected_oe property

protected Byte m_btBackgroundAlpha
Résultat Byte

m_dLabelWrapMaxTextWidth protected_oe property

protected Double m_dLabelWrapMaxTextWidth
Résultat Double

m_dRadius protected_oe property

protected Double m_dRadius
Résultat Double

m_dRelativeOuterGlowSize protected_oe property

protected Double m_dRelativeOuterGlowSize
Résultat Double

m_eEffect protected_oe property

protected VertexEffect m_eEffect
Résultat VertexEffect

m_eLabelPosition protected_oe property

protected VertexLabelPosition m_eLabelPosition
Résultat VertexLabelPosition

m_eShape protected_oe property

protected VertexShape m_eShape
Résultat VertexShape

m_oLabelFillColor protected_oe property

protected Color m_oLabelFillColor
Résultat Color