Table of Contents

Class LinkLabelDraggingTool

Namespace
Northwoods.Go.Tools.Extensions
Assembly
LinkLabelDraggingWinForms.dll

The LinkLabelDraggingTool class lets the user move a label on a Link.

public class LinkLabelDraggingTool : Tool
Inheritance
LinkLabelDraggingTool
Inherited Members

Remarks

This tool only works when the Link has a label that is positioned at the MidPoint plus some offset. It does not work for labels that have a particular SegmentIndex.

Constructors

LinkLabelDraggingTool()

Constructs a LinkLabelDraggingTool and sets the name for the tool.

public LinkLabelDraggingTool()

Fields

Label

The label being dragged.

public GraphObject Label

Field Value

GraphObject

Methods

CanStart()

This tool can only start if the mouse has moved enough so that it is not a click, and if the mouse down point is on a GraphObject "label" in a Link Panel, as determined by FindLabel().

public override bool CanStart()

Returns

bool

DoActivate()

Start a transaction, call FindLabel() and remember it as the Label property, and remember the original value for the label's SegmentOffset property.

public override void DoActivate()

DoCancel()

Restore the label's original value for SegmentOffset.

public override void DoCancel()

DoDeactivate()

Stop any ongoing transaction.

public override void DoDeactivate()

DoMouseMove()

During the drag, call UpdateSegmentOffset() in order to set the SegmentOffset of the label.

public override void DoMouseMove()

DoMouseUp()

At the end of the drag, update the segment offset of the label and finish the tool, completing a transaction.

public override void DoMouseUp()

DoStop()

Clear any reference to a label element.

public override void DoStop()

FindLabel()

From the GraphObject at the mouse point, search up the visual tree until we get to an object that is a label of a Link.

public GraphObject FindLabel()

Returns

GraphObject

This returns null if no such label is at the mouse down point.

UpdateSegmentOffset()

Save the label's SegmentOffset as a rotated offset from the midpoint of the Link that the label is in.

public void UpdateSegmentOffset()