ConnectionLine class
Beep.Skia (core) — class
Represents a visual connection line between two connection points that can be drawn on a Skia canvas. This class implements the IConnectionLine interface and provides functionality for drawing lines, arrows, labels, animations, and user interaction handling.
Members
| Member | Kind | Description |
|---|---|---|
ConnectionLine(Action invalidateVisualAction) | Method | Initializes a new instance of the ConnectionLine class with an invalidate visual action. The action to call when the visual needs to be invalidated. |
IConnectionPoint Start | Property | Gets or sets the starting connection point of this line. |
IConnectionPoint End | Property | Gets or sets the ending connection point of this line. |
SKPoint EndPoint | Property | Gets or sets the end point coordinates when not connected to an end connection point. |
bool IsConnected | Property | Gets or sets a value indicating whether this connection line is connected. |
bool IsSelected | Property | Gets or sets a value indicating whether this connection line is selected. |
bool IsVisible | Property | Gets or sets whether this line is visible. Hidden lines are skipped by the renderer. |
bool IsAnimated | Property | Gets or sets a value indicating whether this connection line should be animated. |
bool IsDataFlowAnimated | Property | Gets or sets a value indicating whether data flow animation is enabled. |
float DataFlowSpeed | Property | Gets or sets the speed of the data flow animation (pixels per second). |
float DataFlowParticleSize | Property | Gets or sets the size of the data flow particles. |
SKColor DataFlowColor | Property | Gets or sets the color of the data flow particles. |
bool ShowStartArrow | Property | Gets or sets a value indicating whether to show an arrow at the start of the line. |
bool ShowEndArrow | Property | Gets or sets a value indicating whether to show an arrow at the end of the line. |
SKPaint Paint | Property | Gets or sets the paint object used for drawing the connection line. |
string Label1 | Property | Gets or sets the first label text to display on the connection line. |
string Label2 | Property | Gets or sets the second label text to display on the connection line. |
string Label3 | Property | Gets or sets the third label text to display on the connection line. |
string DataTypeLabel | Property | Gets or sets the data type label to display on the connection line. If not set, will automatically use the data type from the start connection point. |
string GuardCondition | Property | Optional guard condition evaluated before a state-machine transition fires. |
string TransitionAction | Property | Optional action executed when a state-machine transition fires. |
string TriggerEvent | Property | Optional trigger event name that causes the transition to fire. |
event EventHandler<ConnectionArgs> StartArrowClicked | Event | Occurs when the start arrow of the connection line is clicked. |
event EventHandler<ConnectionArgs> EndArrowClicked | Event | Occurs when the end arrow of the connection line is clicked. |
event EventHandler<LineArgs> LineClicked | Event | Occurs when the connection line itself is clicked. |
SKColor LineColor | Property | Gets or sets the color of the connection line. |
ConnectionLine(IConnectionPoint start, IConnectionPoint end, Action invalidateVisualAction) | Method | Initializes a new instance of the ConnectionLine class with start and end connection points. The starting connection point. The ending connection point. The action to call when the visual needs to be invalidated. Thrown when start, end, or invalidateVisualAction is null. |
ConnectionLine(IConnectionPoint start, SKPoint end, Action invalidateVisualAction) | Method | Initializes a new instance of the ConnectionLine class with a start connection point and end coordinates. The starting connection point. The ending point coordinates. The action to call when the visual needs to be invalidated. Thrown when start or invalidateVisualAction is null. |
void Draw(SKCanvas canvas) | Method | Draws the connection line on the specified Skia canvas. The canvas to draw on. |
bool LineContainsPoint(SKPoint point) | Method | Determines whether the specified point lies on the connection line within the click threshold. The point to test. true if the point is on the line; otherwise, false. |
bool ArrowContainsPoint(SKPoint point, bool startArrow) | Method | Determines whether the specified point lies within an arrow of the connection line. The point to test. true to test the start arrow; false to test the end arrow. true if the point is within the arrow; otherwise, false. |
void OnClick(SKPoint clickPoint) | Method | Handles click events on the connection line, determining whether an arrow or the line itself was clicked. The point where the click occurred. |
void StartAnimation() | Method | Starts the animation of the connection line if it is set to be animated. |
void StopAnimation() | Method | Stops the animation of the connection line. |
void Dispose() | Method | Releases all resources used by the connection line. |