Class ConnectorDrawingController
Represents a specialized controller that manages the interactive drawing and creation of connectors in a SfDiagramComponent.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class ConnectorDrawingController : ConnectionController
Remarks
The ConnectorDrawingController extends ConnectionController to provide functionality for drawing new connectors by handling mouse interactions during the connector creation process.
This controller manages the entire lifecycle of connector drawing, from initial mouse down events through mouse movement tracking to final connector placement and connection establishment.
Constructors
ConnectorDrawingController(SfDiagramComponent, DiagramElementAction)
Initializes a new instance of the ConnectorDrawingController class for managing connector drawing operations.
Declaration
public ConnectorDrawingController(SfDiagramComponent diagram, DiagramElementAction endPoint)
Parameters
Type | Name | Description |
---|---|---|
SfDiagramComponent | diagram | The SfDiagramComponent instance that this controller will manage for connector drawing operations. |
DiagramElementAction | endPoint | The DiagramElementAction that specifies the initial action or endpoint configuration for connector creation. |
Remarks
The ConnectorDrawingController extends ConnectionController to handle mouse interactions during connector creation.
This controller manages the connector drawing lifecycle from mouse events to final placement and connection establishment.
Methods
OnMouseDown(DiagramMouseEventArgs)
Handles the mouse down event when the mouse pointer is moved over the diagram and a mouse button is pressed during connector drawing operations.
Declaration
public override void OnMouseDown(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing information about the mouse event, including position coordinates, button state, and target elements. |
Overrides
Remarks
Sets the InAction property to true to initiate connector drawing and calls the base implementation for proper event handling.
OnMouseMove(DiagramMouseEventArgs)
Handles mouse movement events during connector drawing operations when the connector end thumb is being dragged.
Declaration
public override bool OnMouseMove(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing mouse event information including position, button state, and target elements. Can be null if no event data is available. |
Returns
Type | Description |
---|---|
System.Boolean | A System.Boolean value indicating whether the mouse move event was handled. |
Overrides
Remarks
This method is called continuously during connector drawing when the end thumb is dragged, providing real-time visual feedback and maintaining drawing state.
Performance consideration: Called frequently during mouse movement.
OnMouseUp(DiagramMouseEventArgs)
Handles the mouse up event when the mouse pointer is moved over the connector and a mouse button is released during connector drawing operations.
Declaration
public override void OnMouseUp(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing the mouse event data, including position coordinates and button information. Can be null if no event data is available. |
Overrides
Remarks
This method completes the connector drawing workflow by controlling the action lifecycle and adding the drawn connector to the diagram.