Table of Contents

Class Adornment

Namespace
Northwoods.Go
Assembly
Northwoods.GoDiagram.WinForms.dll

An Adornment is a special kind of Part that is associated with another Part, the AdornedPart.

public class Adornment : Part, IHasContextMenu, IHasToolTip, IShowHidable
Inheritance
Adornment
Implements
Inherited Members

Remarks

Adornments are normally associated with a particular GraphObject in the adorned Part -- that is the value of AdornedElement. However, the AdornedElement may be null, in which case the AdornedPart will also be null.

The area occupied by the adorned element is represented in the Adornment's visual tree by a Placeholder. The placeholder is always the LocationElement, although you may specify any Spot as the LocationSpot. An adornment need not have a placeholder, but it may have at most one.

Adornments can be distinguished by their Category. This property can be an arbitrary string value determined by the code creating the adornment, typically a tool that wants to be able to tell various adornments apart from each other. Use the FindAdornment(string) method to find an adornment for a part of a given category.

For example, one of the Adornments created by UpdateAdornments() when the part IsSelected has the Category of "Selection". Those created by UpdateAdornments(Part) have a category of "Resize" and normally contain eight resize handles.

Besides the selection Adornment and tool Adornments, Adornments are also used for context menus and tooltips. The AdornedElement in such cases refers to the GraphObject to which the the context menu or tooltip applies.

There cannot be any links connected to an Adornment, nor can an Adornment have members or be a member of a group.

An Adornment cannot have its own Adornments. An Adornment cannot be selected.

Adornments are not positioned by a Layout because they are normally positioned according to the Part that they adorn.

For more discussion and examples, see Selection, ToolTips, Context Menus, and Tools.

Constructors

Adornment()

Constructs an empty Adornment.

public Adornment()

Remarks

The default Panel type is PanelLayoutPosition.

Adornment(PanelLayout)

Constructs an empty Adornment. The panel type must be one of the values permitted by Type.

public Adornment(PanelLayout type)

Parameters

type PanelLayout

if null, the default Panel is PanelLayoutPosition.

Adornment(string)

Constructs an empty Adornment. The panel type can be a string describing one of the built PanelLayout types.

public Adornment(string type)

Parameters

type string

if the empty string, the default Panel type is PanelLayoutPosition.

Properties

AdornedElement

Gets or sets the GraphObject that is adorned.

public GraphObject AdornedElement { get; set; }

Property Value

GraphObject

Remarks

Setting this property updates the adorned element's Part by calling AddAdornment(string, Adornment). This may be null if the Adornment does not adorn a particular element.

AdornedPart

This read-only property returns the Part that contains the adorned element.

public Part AdornedPart { get; }

Property Value

Part

Remarks

This will be null if the AdornedElement is null.

Placeholder

This read-only property returns a Placeholder that this Adornment may contain in its visual tree.

public Placeholder Placeholder { get; }

Property Value

Placeholder

Remarks

This may be null if there is no such placeholder element.

Methods

Hide(Diagram, Tool)

public void Hide(Diagram d, Tool t)

Parameters

d Diagram
t Tool

Show(GraphObject, Diagram, Tool)

public void Show(GraphObject g, Diagram d, Tool t)

Parameters

g GraphObject
d Diagram
t Tool