C# Class Smrf.WpfGraphicsLib.Axis

Draws a linear axis with major and minor gridlines, major gridline values, and an axis label.
This can be used as either a horizontal x-axis (the default) or a vertical y-axis. For the latter, set IsXAxis to false.

The axis is meant to be docked below or to the left of the control to which the axis applies. If you set the to the render transform of the docked control, the axis will adjust itself as the docked control is zoomed or translated.

Call SetRange to set the range of values in the axis.

Inheritance: System.Windows.FrameworkElement
Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Свойство Type Description
m_bIsXAxis System.Boolean
m_bValuesAreLogarithmic System.Boolean
m_dFarOffset Double
m_dFarValue Double
m_dLabelFontSizeEm Double
m_dNearOffset Double
m_dNearValue Double
m_oDockedControlRenderTransform System.Windows.Media.Transform
m_oTypeface System.Windows.Media.Typeface
m_sLabel String

Méthodes publiques

Méthode Description
Axis ( ) : System

Initializes a new instance of the Axis class.

SetFont ( System.Windows.Media.Typeface typeface, Double labelEmSize ) : void
SetRange ( Double nearValue, Double nearOffset, Double farValue, Double farOffset, System.Boolean valuesAreLogarithmic ) : void

Méthodes protégées

Méthode Description
DrawAxisLine ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen ) : void
DrawBackground ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, Double dAdjustedNearOffset, Double dAdjustedFarOffset ) : void
DrawGridline ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen, Double dGridlineOffset, Double dGridlineLength ) : void
DrawLabel ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle ) : void
DrawMajorGridlineAndValue ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen, Double dMajorGridlineValue, Double dMajorGridlineOffset, String sFormatSpecifier ) : void
DrawMajorGridlineValue ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, Double dMajorGridlineValue, Double dMajorGridlineOffset, String sFormatSpecifier ) : void
DrawMinorGridlines ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen, Double dMajorGridline2Offset, Double dMajorGridline1Offset ) : void
DrawOffsetBackground ( System.Windows.Media.DrawingContext oDrawingContext, Rect oOffsetRectangle ) : void
DrawRotatedText ( System.Windows.Media.DrawingContext oDrawingContext, System.Windows.Media.FormattedText oFormattedText, Double dCenterX, Double dCenterY ) : void
GetCenteredFormattedText ( String sText, System.Windows.Media.Typeface oTypeface, Double dFontSizeEm ) : System.Windows.Media.FormattedText
GetFormatSpecifier ( Double adMajorGridlineValues, Int32 iDecimalPlacesToShow ) : String
GetLogIfRequired ( Double dNumber ) : Double
GetPowIfRequired ( Double dNumber ) : Double
GetRotatedTextTransform ( Double dCenterX, Double dCenterY ) : Transform
MeasureOverride ( Size availableSize ) : Size
OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void
OnRender ( System.Windows.Media.DrawingContext oDrawingContext, Double dAdjustedNearValue, Double dAdjustedNearOffset, Double dAdjustedFarValue, Double dAdjustedFarOffset ) : void

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

Axis() public méthode

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

DrawAxisLine() protected méthode

protected DrawAxisLine ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
oPen System.Windows.Media.Pen
Résultat void

DrawBackground() protected méthode

protected DrawBackground ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, Double dAdjustedNearOffset, Double dAdjustedFarOffset ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
dAdjustedNearOffset Double
dAdjustedFarOffset Double
Résultat void

DrawGridline() protected méthode

protected DrawGridline ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen, Double dGridlineOffset, Double dGridlineLength ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
oPen System.Windows.Media.Pen
dGridlineOffset Double
dGridlineLength Double
Résultat void

DrawLabel() protected méthode

protected DrawLabel ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
Résultat void

DrawMajorGridlineAndValue() protected méthode

protected DrawMajorGridlineAndValue ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen, Double dMajorGridlineValue, Double dMajorGridlineOffset, String sFormatSpecifier ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
oPen System.Windows.Media.Pen
dMajorGridlineValue Double
dMajorGridlineOffset Double
sFormatSpecifier String
Résultat void

DrawMajorGridlineValue() protected méthode

protected DrawMajorGridlineValue ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, Double dMajorGridlineValue, Double dMajorGridlineOffset, String sFormatSpecifier ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
dMajorGridlineValue Double
dMajorGridlineOffset Double
sFormatSpecifier String
Résultat void

DrawMinorGridlines() protected méthode

protected DrawMinorGridlines ( System.Windows.Media.DrawingContext oDrawingContext, Rect oClientRectangle, System.Windows.Media.Pen oPen, Double dMajorGridline2Offset, Double dMajorGridline1Offset ) : void
oDrawingContext System.Windows.Media.DrawingContext
oClientRectangle System.Windows.Rect
oPen System.Windows.Media.Pen
dMajorGridline2Offset Double
dMajorGridline1Offset Double
Résultat void

DrawOffsetBackground() protected méthode

protected DrawOffsetBackground ( System.Windows.Media.DrawingContext oDrawingContext, Rect oOffsetRectangle ) : void
oDrawingContext System.Windows.Media.DrawingContext
oOffsetRectangle System.Windows.Rect
Résultat void

DrawRotatedText() protected méthode

protected DrawRotatedText ( System.Windows.Media.DrawingContext oDrawingContext, System.Windows.Media.FormattedText oFormattedText, Double dCenterX, Double dCenterY ) : void
oDrawingContext System.Windows.Media.DrawingContext
oFormattedText System.Windows.Media.FormattedText
dCenterX Double
dCenterY Double
Résultat void

GetCenteredFormattedText() protected méthode

protected GetCenteredFormattedText ( String sText, System.Windows.Media.Typeface oTypeface, Double dFontSizeEm ) : System.Windows.Media.FormattedText
sText String
oTypeface System.Windows.Media.Typeface
dFontSizeEm Double
Résultat System.Windows.Media.FormattedText

GetFormatSpecifier() protected méthode

protected GetFormatSpecifier ( Double adMajorGridlineValues, Int32 iDecimalPlacesToShow ) : String
adMajorGridlineValues Double
iDecimalPlacesToShow System.Int32
Résultat String

GetLogIfRequired() protected méthode

protected GetLogIfRequired ( Double dNumber ) : Double
dNumber Double
Résultat Double

GetPowIfRequired() protected méthode

protected GetPowIfRequired ( Double dNumber ) : Double
dNumber Double
Résultat Double

GetRotatedTextTransform() protected méthode

protected GetRotatedTextTransform ( Double dCenterX, Double dCenterY ) : Transform
dCenterX Double
dCenterY Double
Résultat System.Windows.Media.Transform

MeasureOverride() protected méthode

protected MeasureOverride ( Size availableSize ) : Size
availableSize System.Windows.Size
Résultat System.Windows.Size

OnRender() protected méthode

protected OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void
drawingContext System.Windows.Media.DrawingContext
Résultat void

OnRender() protected méthode

protected OnRender ( System.Windows.Media.DrawingContext oDrawingContext, Double dAdjustedNearValue, Double dAdjustedNearOffset, Double dAdjustedFarValue, Double dAdjustedFarOffset ) : void
oDrawingContext System.Windows.Media.DrawingContext
dAdjustedNearValue Double
dAdjustedNearOffset Double
dAdjustedFarValue Double
dAdjustedFarOffset Double
Résultat void

SetFont() public méthode

public SetFont ( System.Windows.Media.Typeface typeface, Double labelEmSize ) : void
typeface System.Windows.Media.Typeface
labelEmSize Double
Résultat void

SetRange() public méthode

public SetRange ( Double nearValue, Double nearOffset, Double farValue, Double farOffset, System.Boolean valuesAreLogarithmic ) : void
nearValue Double
nearOffset Double
farValue Double
farOffset Double
valuesAreLogarithmic System.Boolean
Résultat void

Property Details

m_bIsXAxis protected_oe property

protected Boolean,System m_bIsXAxis
Résultat System.Boolean

m_bValuesAreLogarithmic protected_oe property

protected Boolean,System m_bValuesAreLogarithmic
Résultat System.Boolean

m_dFarOffset protected_oe property

protected Double m_dFarOffset
Résultat Double

m_dFarValue protected_oe property

protected Double m_dFarValue
Résultat Double

m_dLabelFontSizeEm protected_oe property

protected Double m_dLabelFontSizeEm
Résultat Double

m_dNearOffset protected_oe property

protected Double m_dNearOffset
Résultat Double

m_dNearValue protected_oe property

protected Double m_dNearValue
Résultat Double

m_oDockedControlRenderTransform protected_oe property

protected Transform,System.Windows.Media m_oDockedControlRenderTransform
Résultat System.Windows.Media.Transform

m_oTypeface protected_oe property

protected Typeface,System.Windows.Media m_oTypeface
Résultat System.Windows.Media.Typeface

m_sLabel protected_oe property

protected String m_sLabel
Résultat String