Class Adornment

GoDiagram®
v10.0.11
by Northwoods Software®

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

Inheritance
Adornment
Namespace: Northwoods.Go
Assembly: Northwoods.GoDiagram.WinForms.dll
Syntax
public class Adornment : Part, IHasContextMenu, IHasToolTip, IShowHidable
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.

Declaration
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.

Declaration
public Adornment(PanelLayout type)
Parameters
Type Name Description
PanelLayout type

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.

Declaration
public Adornment(string type)
Parameters
Type Name Description
string type

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

Properties

AdornedElement

Gets or sets the GraphObject that is adorned.

Declaration
public GraphObject AdornedElement { get; set; }
Property Value
Type Description
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.

Declaration
public Part AdornedPart { get; }
Property Value
Type Description
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.

Declaration
public Placeholder Placeholder { get; }
Property Value
Type Description
Placeholder
Remarks

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

Methods

Hide(Diagram, Tool)

Declaration
public void Hide(Diagram d, Tool t)
Parameters
Type Name Description
Diagram d
Tool t

Show(GraphObject, Diagram, Tool)

Declaration
public void Show(GraphObject g, Diagram d, Tool t)
Parameters
Type Name Description
GraphObject g
Diagram d
Tool t

Implements