Using ExpandCollapse decorator


Author
Message
Gauri Srinivas
Gauri Srinivas
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1
I tried attaching the file. However it gave me the error "One of the files you have attempted to attach to this post is not a permitted MIME type". I sent it to support@nevron.com instead.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,

Can you send us an .ndx save file of the drawing so that we can check it out.

Best regards,
Nevron Support

Best Regards,
Nevron Support Team


Gauri Srinivas
Gauri Srinivas
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1

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


Ivo Milanov
Ivo Milanov
Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)
Group: Forum Members
Posts: 35, Visits: 32
Hi Gauri,

It is difficult to see what the problem is only by looking at the screenshots - please provide a sample application which demonstrates it so that we can check it out.

Is each expand/collapse group of shape a single tree region, or there are links that span outside the group to other shapes? What is it that you want to actually achieve -> please provide a sample.

Best regards,
Ivo
Gauri Srinivas
Gauri Srinivas
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1

Hi,

I solved this by calling toggle state after initializing padding etc of the group. However, I have another question:

How do I apply layouts to the groups used in the expand collapse decorator once it is toggled?

The example provided in the sample applies the table layout. I tried changing it to NCompactDepthTree but it does nothing and each toggled group just appears one below the other(see attached).  

 

Please let me know how to accomplish this.

Thanks,

Gauri


Attachments
CompactDepthTreeOnGroup.bmp (84 views, 8.00 KB)
Gauri Srinivas
Gauri Srinivas
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1
Hi,

I am currently using the expand collapse decorator on NGroups with a frame header that contain NShapes. I Have a couple of questions

1) how do I initially collapse the groups/ toggle the state of expand decorator so that the NShapes dont show. I tried calling expandCollapseDecorator.ToggleState - (attached image toggledState.png). This works, but when I expand the group after(afterexpand.png), it doesnt resize correctly and the group looks odd.

I would like it to initially look like attachedimage collapsed.png and have the same expand collapse functionality.

2) I would like to apply other layouts (like compact depth tree etc) to these collapsed groups. How can I do this?

Thanks,
Gauri
Attachments
toggledState.png (103 views, 1.00 KB)
afterexpand.png (93 views, 6.00 KB)
collapsed.png (105 views, 783 bytes)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search