Class LinkShiftingTool
- Namespace
- Northwoods.Go.Tools.Extensions
- Assembly
- LinkShiftingWinForms.dll
The LinkShiftingTool class lets the user shift the end of a link to be anywhere along the edges of the port.
public class LinkShiftingTool : Tool
- Inheritance
-
LinkShiftingTool
- Inherited Members
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.
public LinkShiftingTool()
Properties
FromHandleArchetype
A small GraphObject used as a shifting handle.
public GraphObject FromHandleArchetype { get; set; }
Property Value
ToHandleArchetype
A small GraphObject used as a shifting handle.
public GraphObject ToHandleArchetype { get; set; }
Property Value
Methods
CanStart()
This tool may run when there is a mouse-down event on a reshaping handle.
public override bool CanStart()
Returns
DoActivate()
Start shifting, if FindToolHandleAt(Point, string) finds a reshaping handle at the mouse down point.
public override void DoActivate()
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.
public override void DoCancel()
DoDeactivate()
This stops the current shifting operation with the link as it is.
public override void DoDeactivate()
DoMouseMove()
Call DoReshape(Point) with a new point determined by the mouse to change the end point of the link.
public override void DoMouseMove()
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.
public override void DoMouseUp()
DoReshape(Point)
Find the closest point along the edge of the link's port and shift the end of the link to that point.
public void DoReshape(Point pt)
Parameters
pt
Point
DoStop()
Perform cleanup of tool state.
public override void DoStop()
UpdateAdornments(Part)
Show an Adornment with a reshape handle at each end of the link which allows for shifting of the end points.
public override void UpdateAdornments(Part part)
Parameters
part
Part