C# Class Tutorial.CustomStyles.MySimpleEdgeStyle

This class is an example for a custom edge style based on EdgeStyleBase{TVisual}.
The color of the edge style depends in the selection state of the edge.
Inheritance: EdgeStyleBase
Afficher le fichier Open project: yWorks/yfiles-for-wpf-demos Class Usage Examples

Private Properties

Свойство Type Description
CreateGeometry Geometry
CreateRenderDataCache RenderDataCache
GetLocation PointD
GetPath GeneralPath
Render void
UpdatePath void

Méthodes publiques

Méthode Description
MySimpleEdgeStyle ( ) : System

Initializes a new instance of the MySimpleEdgeStyle class with a custom arrow.

Méthodes protégées

Méthode Description
CreateVisual ( IRenderContext context, IEdge edge ) : VisualGroup

Creates the visual for an edge.

IsHit ( IInputModeContext context, PointD location, IEdge edge ) : bool

Determines whether the visual representation of the edge has been hit at the given location. Overridden method to include the PathThickness and the HitTestRadius specified in the context in the calculation.

Lookup ( IEdge edge, Type type ) : object

This implementation of the look up provides a custom implementation of the ISelectionIndicatorInstaller interface that better suits to this style.

UpdateVisual ( IRenderContext context, oldVisual, IEdge edge ) : VisualGroup

Re-renders the edge using the old visual for performance reasons.

Private Methods

Méthode Description
CreateGeometry ( GeneralPath gp ) : Geometry

Creates the geometry for the path from the given GeneralPath.

CreateRenderDataCache ( IRenderContext context, IEdge edge ) : RenderDataCache

Creates an object containing all necessary data to create an edge visual

GetLocation ( IPort port ) : PointD

In contrast to the GraphExtensions.GetLocation property of IPort, this method returns the static current location of the port.

It is recommended to use this method at performance critical places that require no live view of the port location, like the GetPath method of this class.

GetPath ( IEdge edge ) : GeneralPath
Render ( IRenderContext context, IEdge edge, container, RenderDataCache cache ) : void

Creates the visual appearance of an edge

UpdatePath ( IRenderContext context, IEdge edge, container, RenderDataCache cache ) : void

Updates the edge path data as well as the arrow positions of the visuals stored in .

Method Details

CreateVisual() protected méthode

Creates the visual for an edge.
protected CreateVisual ( IRenderContext context, IEdge edge ) : VisualGroup
context IRenderContext
edge IEdge
Résultat VisualGroup

IsHit() protected méthode

Determines whether the visual representation of the edge has been hit at the given location. Overridden method to include the PathThickness and the HitTestRadius specified in the context in the calculation.
protected IsHit ( IInputModeContext context, PointD location, IEdge edge ) : bool
context IInputModeContext
location PointD
edge IEdge
Résultat bool

Lookup() protected méthode

This implementation of the look up provides a custom implementation of the ISelectionIndicatorInstaller interface that better suits to this style.
protected Lookup ( IEdge edge, Type type ) : object
edge IEdge
type Type
Résultat object

MySimpleEdgeStyle() public méthode

Initializes a new instance of the MySimpleEdgeStyle class with a custom arrow.
public MySimpleEdgeStyle ( ) : System
Résultat System

UpdateVisual() protected méthode

Re-renders the edge using the old visual for performance reasons.
protected UpdateVisual ( IRenderContext context, oldVisual, IEdge edge ) : VisualGroup
context IRenderContext
edge IEdge
Résultat VisualGroup