Class Group
A group is a node that acts as a transparent container for other nodes.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public class Group : Node, IUnitIndependent, IDispatchNodeEvents, ISerializable, INode, ICloneable, IServiceProvider, IServiceReferenceHolder, IServiceReferenceProvider, IPropertyObserver, IPropertyContainer, IGraphNode, IDeserializationCallback, IDisposable, ICompositeNode, IZOrderContainer
Remarks
A group is a composite node that controls a set of child nodes. The bounding rectangle of a group is the union of the bounds of its children. The group renders itself by iterating through its children and rendering them.
Members of the group are added and removed through the ICompositeNode interface.
ICompositeNodeConstructors
Group()
Initializes a new instance of the Group class.
Declaration
public Group()
Group(Group)
Initializes a new instance of the Group class.
Declaration
public Group(Group src)
Parameters
| Type | Name | Description |
|---|---|---|
| Group | src | The source instance. |
Group(NodeCollection)
Initializes a new instance of the Group class.
Declaration
public Group(NodeCollection nodesChildren)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | nodesChildren | The nodes children. |
Group(SerializationInfo, StreamingContext)
Initializes a new instance of the Group class.
Declaration
protected Group(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | The serialization info. |
| System.Runtime.Serialization.StreamingContext | context | The streaming context. |
Fields
m_bmpCache
Cached Group visual representation
Declaration
protected Image m_bmpCache
Field Value
| Type |
|---|
| System.Drawing.Image |
m_nodesChildren
Collection of children nodes
Declaration
protected NodeCollection m_nodesChildren
Field Value
| Type |
|---|
| NodeCollection |
Properties
CanUngroup
Gets or sets a value indicating whether composite node can be ungrouped.
Declaration
public bool CanUngroup { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ChildCount
Gets the number of child nodes contained by this group.
Declaration
public int ChildCount { get; }
Property Value
| Type |
|---|
| System.Int32 |
DrawPorts
Gets or sets a value indicating whether ports is drawed.
Declaration
public override bool DrawPorts { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Overrides
GroupNodePosition
Gets or sets the child nodes position.
Declaration
public GroupNodePositions GroupNodePosition { get; set; }
Property Value
| Type |
|---|
| GroupNodePositions |
Labels
Gets the collection of Label items.
Declaration
public LabelCollection Labels { get; }
Property Value
| Type | Description |
|---|---|
| LabelCollection | The collection of Label items. |
LockUpdate
Gets or sets a value indicating whether update is locked.
Declaration
public bool LockUpdate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
LogicalGraphicsPath
Get's node logical GraphicsPath without scale transformations.
Declaration
protected override GraphicsPath LogicalGraphicsPath { get; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Drawing2D.GraphicsPath | The logical graphics path. |
Overrides
NameTable
Gets names hash where key - node name, value - available node index. Using for generate unique name with indexing.
Declaration
protected Hashtable NameTable { get; }
Property Value
| Type |
|---|
| System.Collections.Hashtable |
Nodes
Gets the group children collection.
Declaration
public NodeCollection Nodes { get; }
Property Value
| Type |
|---|
| NodeCollection |
Visible
Gets or sets node's visibility.
Declaration
public override bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Set to |
Overrides
Remarks
This flag can be changed to True only is one of its owner layer are visible.
ZOrderDepth
Gets number of items in the Z-order for this container.
Declaration
public int ZOrderDepth { get; }
Property Value
| Type |
|---|
| System.Int32 |
Methods
AccumulateRefreshRect(ref RectangleF)
Accumulates the refresh rect.
Declaration
protected override void AccumulateRefreshRect(ref RectangleF rcRefresh)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | rcRefresh | The refresh rectangle. |
Overrides
AppendChild(Node)
Appends the given node to the collection of child nodes.
Declaration
public int AppendChild(Node child)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | child | Node to append. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Zero-based index at which the node was added to the collection or -1 for failure. |
AppendChildren(NodeCollection, out Int32)
Appends the given collection of nodes as child nodes.
Declaration
public int AppendChildren(NodeCollection children, out int startIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | children | Nodes to append. |
| System.Int32 | startIdx | Zero-based index at which the first node was added to the collection of child nodes. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of child nodes appended. |
BringForward(Node)
Visually brings the selected shapes one step forward over the nearest overlapping shape based on z-order value.
Declaration
public int BringForward(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to move forward. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
BringToFront(Node)
Visually brings the selected shapes front over all the other overlapped shapes based on z-order value.
Declaration
public int BringToFront(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to bring to the front. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
CanAppendChild(ICompositeNode, Node)
Determines whether this instance can append child the specified parent.
Declaration
public bool CanAppendChild(ICompositeNode parent, Node nodeAppending)
Parameters
| Type | Name | Description |
|---|---|---|
| ICompositeNode | parent | The parent. |
| Node | nodeAppending | The node appending. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
CheckConstrainingRegion(Node)
Tests to see if the given node falls within the constraining region of the composite node.
Declaration
public bool CheckConstrainingRegion(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if node falls within the constraining region; False if it does not. |
Clone()
Clones this instance.
Declaration
public override object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new object that is a copy of this instance. |
Overrides
ContainsPoint(PointF)
Performs given point hit test.
Declaration
public override bool ContainsPoint(PointF ptTest)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF | ptTest | Point to test |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if contains the point. |
Overrides
Remarks
Point must be in pixel units.
DoMoveRelatedActions(Single, Single)
Performs additional changes on pin position changed.
Declaration
protected override void DoMoveRelatedActions(float fX, float fY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | fX | The pin offset by x axis. |
| System.Single | fY | The pin offset by y axis. |
Overrides
DoSizeRelatedActions(SizeF, SizeF)
Used to update child nodes sizes.
Declaration
protected override void DoSizeRelatedActions(SizeF szOldSize, SizeF szNewSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.SizeF | szOldSize | Old size value. |
| System.Drawing.SizeF | szNewSize | New size value. |
Overrides
EventSink_PropertyChanged(PropertyChangedEventArgs)
Raise when group property changed.
Declaration
protected override void EventSink_PropertyChanged(PropertyChangedEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyChangedEventArgs | evtArgs | The PropertyChangedEventArgs instance containing the event data. |
Overrides
GetBoundingRect(NodeCollection)
Gets the bounding rect in local coordinates.
Declaration
protected virtual RectangleF GetBoundingRect(NodeCollection nodes)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | nodes | The nodes. |
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | The bounding rect. |
GetChild(Int32)
Returns the child node at the given index position.
Declaration
public Node GetChild(int childIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | childIndex | Zero-based index into the collection of child nodes. |
Returns
| Type | Description |
|---|---|
| Node | Child node at the given position or NULL if the index is out of range. |
GetChildByName(String)
Returns the child node matching the given name.
Declaration
public Node GetChildByName(string childName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | childName | Name of node to return. |
Returns
| Type | Description |
|---|---|
| Node | Node matching the given name. |
GetChildIndex(Node)
Returns the index position of the given child node.
Declaration
public int GetChildIndex(Node child)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | child | Child node to query. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Zero-based index into the collection of child nodes. |
GetChildrenAtPoint(NodeCollection, PointF)
Returns all children that are intersected by the given point.
Declaration
public int GetChildrenAtPoint(NodeCollection childNodes, PointF ptModel)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | childNodes | Collection in which to add the children hit by the given point. |
| System.Drawing.PointF | ptModel | Point to test. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of child nodes that intersect the given point. |
GetChildrenContainedBy(NodeCollection, RectangleF)
Returns all children inside the given rectangle.
Declaration
public int GetChildrenContainedBy(NodeCollection childNodes, RectangleF rcModel)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | childNodes | Collection in which to add the children inside the specified rectangle. |
| System.Drawing.RectangleF | rcModel | Rectangle to test. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of child nodes added to the collection. |
GetChildrenIntersecting(NodeCollection, RectangleF)
Returns all children that intersect the given rectangle.
Declaration
public int GetChildrenIntersecting(NodeCollection childNodes, RectangleF rcModel)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | childNodes | Collection in which to add the children hit by the given point. |
| System.Drawing.RectangleF | rcModel | Rectangle to test. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of child nodes that intersect the given rectangle. |
GetObjectData(SerializationInfo, StreamingContext)
Gets the object data.
Declaration
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | The serialization Info. |
| System.Runtime.Serialization.StreamingContext | context | The streaming context. |
Overrides
GetPathBounds()
Methods used to get node's GraphicsPath
Declaration
protected override RectangleF GetPathBounds()
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | node's GraphicsPath |
Overrides
Remarks
Used primarily for Group node to get all children paths union with transformations.
GetRectBounds(Boolean, Boolean)
Return the path bounds of the node
Declaration
protected override RectangleF GetRectBounds(bool excludeLabel, bool excludePort)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | excludeLabel | if true, include the label bounds, otherwise exclude |
| System.Boolean | excludePort | if true, include the Port bounds, otherwise exclude |
Returns
| Type |
|---|
| System.Drawing.RectangleF |
Overrides
GetZOrder(Node)
Returns the Z-order value of the given node.
Declaration
public int GetZOrder(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to get Z-order for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Zero-based Z-order value of the node or -1 if the node does not exist. |
InsertChild(Node, Int32)
Insert the given node in local coordinates into the collection of child nodes at a specific position.
Declaration
public void InsertChild(Node child, int childIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | child | Node to insert. |
| System.Int32 | childIndex | Zero-based index at which to insert the node. |
OnDeserialized()
Called when node deserialized.
Declaration
protected override void OnDeserialized()
Overrides
OnParentChanged()
Called when parent changed.
Declaration
protected override void OnParentChanged()
Overrides
OnZOrderChanged(Node, ZOrderUpdate, Int32)
Called when Z order changed.
Declaration
protected virtual void OnZOrderChanged(Node node, ZOrderUpdate changeType, int nNewZOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| ZOrderUpdate | changeType | Type of the change. |
| System.Int32 | nNewZOrder | The n new Z order. |
OnZOrderChanging(Node, ZOrderUpdate, Int32)
Called when Z order changing.
Declaration
protected virtual bool OnZOrderChanging(Node node, ZOrderUpdate changeType, int nNewZOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| ZOrderUpdate | changeType | Type of the change. |
| System.Int32 | nNewZOrder | The new Z order. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if Z order is changing. |
QuiteResetEditStyle(Node)
Quites the reset move locking.
Declaration
protected EditStyle QuiteResetEditStyle(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
Returns
| Type | Description |
|---|---|
| EditStyle | The edit style. |
QuiteRestoreEditStyle(Node, EditStyle)
Quites the restore move locking.
Declaration
protected void QuiteRestoreEditStyle(Node node, EditStyle editStyle)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| EditStyle | editStyle | The edit style. |
RecordZOrderChanged(Node, ZOrderUpdate)
Records the Z order changed.
Declaration
protected void RecordZOrderChanged(Node node, ZOrderUpdate changeType)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| ZOrderUpdate | changeType | Type of the change. |
RemoveAllChildren()
Removes all child nodes from the node.
Declaration
public void RemoveAllChildren()
RemoveChild(Node)
Removes the child.
Declaration
public bool RemoveChild(Node nodeToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | nodeToRemove | The node to remove. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if remove child. |
RemoveChild(Int32)
Removes the child node at the given position.
Declaration
public bool RemoveChild(int childIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | childIndex | Zero-based index into the collection of child nodes. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the node was successfully removed; otherwise False. |
Render(Graphics)
Renders shapes visual representation. on given graphics
Declaration
protected override void Render(Graphics gfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | gfx | Graphics to draw on |
Overrides
RenderCachedImage(Graphics)
Renders the cached image.
Declaration
protected virtual void RenderCachedImage(Graphics gfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | gfx | Graphics to draw on. |
RenderChildren(Graphics)
Renders the children.
Declaration
protected virtual void RenderChildren(Graphics gfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | gfx | Graphics to draw on. |
RenderContiguousData(Graphics)
methods used to draw contiguous date. Such as labels or ports
Declaration
protected override void RenderContiguousData(Graphics gfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | gfx | Graphics to draw on |
Overrides
ResetRenderCache()
Resets the render cache.
Declaration
protected void ResetRenderCache()
RestoreConnections(ArrayList)
Restores the connections.
Declaration
protected void RestoreConnections(ArrayList portConnections)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.ArrayList | portConnections | The port connections. |
SaveConnections(NodeCollection)
Saves the connections.
Declaration
protected ArrayList SaveConnections(NodeCollection nodes)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | nodes | The nodes. |
Returns
| Type | Description |
|---|---|
| System.Collections.ArrayList | Connections list. |
SendBackward(Node)
Visually brings the selected shapes one step backward over the nearest overlapping shape based on z-order value.
Declaration
public int SendBackward(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to move backward. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
SendToBack(Node)
Visually brings the selected shapes back over all the other overlapped shapes based on z-order value.
Declaration
public int SendToBack(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to send to the back. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
SetZOrder(Node, Int32)
Sets the Z-order of the given node.
Declaration
public int SetZOrder(Node node, int zOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to set Z-order for. |
| System.Int32 | zOrder | Zero-based Z-order value. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
UpdateBoundsInfo(RectangleF)
Update group pin position, pin offset and size.
Declaration
protected virtual void UpdateBoundsInfo(RectangleF rcBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | rcBounds | Nodes bounds in group coordinates, |
UpdateChildrenParents()
Updates the children parents.
Declaration
protected virtual void UpdateChildrenParents()
UpdateCompositeBounds()
Update bounds size to content size.
Declaration
public void UpdateCompositeBounds()
UpdateGroupInfo()
Update group pin position and size to children, without visual transformation and history recording.
Declaration
protected virtual void UpdateGroupInfo()
UpdateHelperRegion()
Creates region used for hit testing.
Declaration
protected override void UpdateHelperRegion()
Overrides
UpdateReferences(IServiceReferenceProvider)
Updates the references.
Declaration
public override void UpdateReferences(IServiceReferenceProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceReferenceProvider | provider | The provider. |