Class LinkShiftingTool

GoDiagram®
v10.0.11
by Northwoods Software®

The LinkShiftingTool class lets the user shift the end of a link to be anywhere along the edges of the port.

Inheritance
LinkShiftingTool
Namespace: Northwoods.Go.Tools.Extensions
Assembly: LinkShiftingAvalonia.dll
Syntax
public class LinkShiftingTool : Tool
Remarks

This tool may be installed as a mouse down tool:

myDiagram.ToolManager.MouseDownTools.Add(new LinkShiftingTool());

Constructors

LinkShiftingTool()

Constructs a LinkShiftingTool and sets the handles and name of the tool.

Declaration
public LinkShiftingTool()

Properties

FromHandleArchetype

A small GraphObject used as a shifting handle.

Declaration
public GraphObject FromHandleArchetype { get; set; }
Property Value
Type Description
GraphObject

ToHandleArchetype

A small GraphObject used as a shifting handle.

Declaration
public GraphObject ToHandleArchetype { get; set; }
Property Value
Type Description
GraphObject

Methods

CanStart()

This tool may run when there is a mouse-down event on a reshaping handle.

Declaration
public override bool CanStart()
Returns
Type Description
bool
Overrides

DoActivate()

Start shifting, if FindToolHandleAt(Point, string) finds a reshaping handle at the mouse down point.

Declaration
public override void DoActivate()
Overrides
Remarks

If successful this sets the handle to be the reshape handle that it finds. It also remembers the original points in case this tool is cancelled. And it starts a transaction.

DoCancel()

Restore the link route to be the original points and stop this tool.

Declaration
public override void DoCancel()
Overrides

DoDeactivate()

This stops the current shifting operation with the link as it is.

Declaration
public override void DoDeactivate()
Overrides

DoMouseMove()

Call DoReshape(Point) with a new point determined by the mouse to change the end point of the link.

Declaration
public override void DoMouseMove()
Overrides

DoMouseUp()

Reshape the link's end with a point based on the most recent mouse point by calling DoReshape(Point), and then stop this tool.

Declaration
public override void DoMouseUp()
Overrides

DoReshape(Point)

Find the closest point along the edge of the link's port and shift the end of the link to that point.

Declaration
public void DoReshape(Point pt)
Parameters
Type Name Description
Point pt

DoStop()

Perform cleanup of tool state.

Declaration
public override void DoStop()
Overrides

UpdateAdornments(Part)

Show an Adornment with a reshape handle at each end of the link which allows for shifting of the end points.

Declaration
public override void UpdateAdornments(Part part)
Parameters
Type Name Description
Part part
Overrides