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

Draws a vertex label as an annotation.
This class draws a label next to a vertex, as an annotation. It does NOT draw vertices that have the shape VertexShape.Label.
Inheritance: DrawerBase
Mostrar archivo Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Property Type Description
m_btBackgroundAlpha Byte
m_eLabelPosition VertexLabelPosition

Public Methods

Method Description
AssertValid ( ) : void
DrawLabel ( System.Windows.Media.DrawingContext drawingContext, GraphDrawingContext graphDrawingContext, VertexDrawingHistory vertexDrawingHistory, System.Windows.Media.FormattedText formattedText, Color formattedTextColor ) : void
DrawLabel ( System.Windows.Media.DrawingContext drawingContext, GraphDrawingContext graphDrawingContext, VertexDrawingHistory vertexDrawingHistory, VertexLabelPosition labelPosition, System.Windows.Media.FormattedText formattedText, Color formattedTextColor, System.Boolean drawBackground ) : void
VertexLabelDrawer ( VertexLabelPosition labelPosition, Byte backgroundAlpha ) : System

Initializes a new instance of the VertexLabelDrawer class.

Protected Methods

Method Description
AdjustForTextAlignment ( Double dLabelWidth, Double dLabelHeight, VertexLabelPosition eLabelPosition, System.Windows.Media.FormattedText oFormattedText, Double &dDrawX, Double &dDrawY, Double &dLabelBoundsLeft, Double &dLabelBoundsRight ) : void
GetLabelPosition ( IVertex oVertex ) : VertexLabelPosition
SetTextAlignment ( System.Windows.Media.FormattedText oFormattedText, VertexLabelPosition eLabelPosition ) : void
StayWithinHorizontalBounds ( Double dX, GraphDrawingContext oGraphDrawingContext, Double dLabelBoundsLeft, Double dLabelBoundsRight ) : Double
StayWithinVerticalBounds ( Double dY, GraphDrawingContext oGraphDrawingContext, Double dLabelBoundsTop, Double dLabelBoundsBottom ) : Double

Method Details

AdjustForTextAlignment() protected method

protected AdjustForTextAlignment ( Double dLabelWidth, Double dLabelHeight, VertexLabelPosition eLabelPosition, System.Windows.Media.FormattedText oFormattedText, Double &dDrawX, Double &dDrawY, Double &dLabelBoundsLeft, Double &dLabelBoundsRight ) : void
dLabelWidth Double
dLabelHeight Double
eLabelPosition VertexLabelPosition
oFormattedText System.Windows.Media.FormattedText
dDrawX Double
dDrawY Double
dLabelBoundsLeft Double
dLabelBoundsRight Double
return void

AssertValid() public method

public AssertValid ( ) : void
return void

DrawLabel() public method

public DrawLabel ( System.Windows.Media.DrawingContext drawingContext, GraphDrawingContext graphDrawingContext, VertexDrawingHistory vertexDrawingHistory, System.Windows.Media.FormattedText formattedText, Color formattedTextColor ) : void
drawingContext System.Windows.Media.DrawingContext
graphDrawingContext GraphDrawingContext
vertexDrawingHistory VertexDrawingHistory
formattedText System.Windows.Media.FormattedText
formattedTextColor Color
return void

DrawLabel() public method

public DrawLabel ( System.Windows.Media.DrawingContext drawingContext, GraphDrawingContext graphDrawingContext, VertexDrawingHistory vertexDrawingHistory, VertexLabelPosition labelPosition, System.Windows.Media.FormattedText formattedText, Color formattedTextColor, System.Boolean drawBackground ) : void
drawingContext System.Windows.Media.DrawingContext
graphDrawingContext GraphDrawingContext
vertexDrawingHistory VertexDrawingHistory
labelPosition VertexLabelPosition
formattedText System.Windows.Media.FormattedText
formattedTextColor Color
drawBackground System.Boolean
return void

GetLabelPosition() protected method

protected GetLabelPosition ( IVertex oVertex ) : VertexLabelPosition
oVertex IVertex
return VertexLabelPosition

SetTextAlignment() protected method

protected SetTextAlignment ( System.Windows.Media.FormattedText oFormattedText, VertexLabelPosition eLabelPosition ) : void
oFormattedText System.Windows.Media.FormattedText
eLabelPosition VertexLabelPosition
return void

StayWithinHorizontalBounds() protected method

protected StayWithinHorizontalBounds ( Double dX, GraphDrawingContext oGraphDrawingContext, Double dLabelBoundsLeft, Double dLabelBoundsRight ) : Double
dX Double
oGraphDrawingContext GraphDrawingContext
dLabelBoundsLeft Double
dLabelBoundsRight Double
return Double

StayWithinVerticalBounds() protected method

protected StayWithinVerticalBounds ( Double dY, GraphDrawingContext oGraphDrawingContext, Double dLabelBoundsTop, Double dLabelBoundsBottom ) : Double
dY Double
oGraphDrawingContext GraphDrawingContext
dLabelBoundsTop Double
dLabelBoundsBottom Double
return Double

VertexLabelDrawer() public method

Initializes a new instance of the VertexLabelDrawer class.
public VertexLabelDrawer ( VertexLabelPosition labelPosition, Byte backgroundAlpha ) : System
labelPosition VertexLabelPosition /// The default position to use for vertex labels. ///
backgroundAlpha Byte /// The alpha of the label's background rectangle, as a Byte. ///
return System

Property Details

m_btBackgroundAlpha protected_oe property

protected Byte m_btBackgroundAlpha
return Byte

m_eLabelPosition protected_oe property

protected VertexLabelPosition m_eLabelPosition
return VertexLabelPosition