Hi,
I create Nshape's for nodes and then perform the following snippet of code:
batchGroup.Build(groupNodes);
batchGroup.Group(DrawingDocument.ActiveLayer,
false, out grnooups[parentCounter]);if (groups[parentCounter] != null){
groups[parentCounter].CreateShapeElements(
ShapeElementsMask.Decorators);NFrameDecorator frameDecorator = new NFrameDecorator();frameDecorator.ShapeHitTestable =
true;frameDecorator.Header.Style =
new NStyle {FillStyle = new NGradientFillStyle(GradientStyle.Horizontal,GradientVariant.Variant1,Color.White,Color.White)};frameDecorator.Background.Style =
new NStyle { FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.LightGray, Color.LightGray) };NAbilities headerProtection = frameDecorator.Header.Protection;headerProtection.Delete =
true;headerProtection.InplaceEdit =
true;headerProtection.Select =
true;frameDecorator.Header.Protection = headerProtection;
frameDecorator.Background.Style =
new NStyle();groups[parentCounter].Decorators.AddChild(frameDecorator);
NExpandCollapseDecorator expandCollapseDecorator = new NExpandCollapseDecorator();groups[parentCounter].Decorators.AddChild(expandCollapseDecorator);
groups[parentCounter].Padding =
new NMargins(5);groups[parentCounter].Padding =
new NMargins(5, 5, 30, 5);groups[parentCounter].UpdateModelBounds();
groups[parentCounter].AutoUpdateModelBounds =
true;Abilities protection = groups[parentCounter].Protection;protection.Delete =
true;groups[parentCounter].Protection = protection;
expandCollapseDecorator.ToggleState();
}
I then draw appropriate NLineShapes connecting nodes and then applied the table layout.. to layout the groups properly. I followed the examples in the documentation for the expand collapse decorator. It works perfectly for table layout. But when i apply any other, the nodes are just stacked on top of each other. For example :
I instantiate the NCompactDepthTreeLayout and then call the layout method
_nLayout.Layout(shapes, layoutContext);
This doesnt seem to work. Please let me know what i'm doing wrong.
Thanks,
Gauri