Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Creating a line and attaching it to a group? (Read 2105 times)
lenix
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 31
Joined: Apr 6th, 2011
Creating a line and attaching it to a group?
Apr 23rd, 2011 at 7:03am
Print Post  
Hello,

In my diagrams I need to draw a line from a Origin point (x,y) to destination point (x,y).
I tried to do something like this:
Code
Select All
Shape lineShape = new Shape(new ElementTemplate[]
		   {
		   new LineTemplate(originX, originY, destX, destY)
		   },
		   FillMode.Winding, "test");


		ShapeNode lineNode = new ShapeNode(diagram);
		RectangleF rect = new RectangleF(originX, originY, 10, 10);
		lineNode.Bounds = rect; 



That creates a line but doesn't draw it exactly where I want it, because apparently the 2 points I set are used for the node and not the line itself.

I tried to use Factory.CreateDiagramLink with the (PointF origin,PointF dest) parameters, it works fine, but the problem is that I can't attach it to a group ( which I have to do ).
Code
Select All
group.AttachToCorner(diagramLink, 2) 



Basically I need to create a line using PointF origin, PointF destination and be able to attach it to a group that already exists.

Is that possible?

Thanks and sorry for the long thread
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Creating a line and attaching it to a group?
Reply #1 - Apr 25th, 2011 at 7:43am
Print Post  
Hi,

You cannot attach links to groups. If you need that line drawn over a node, set node.CustomDraw = Additional and handle the DrawNode event by calling e.Graphics.DrawLine.

If you have version 5.6.2 of the control, you could use the new 'formula shapes' to define the line as part of a Shape at fixed points by setting DecorationsFormula to "MoveTo(originX, originY); LineTo(destX, destY);"

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
lenix
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 31
Joined: Apr 6th, 2011
Re: Creating a line and attaching it to a group?
Reply #2 - Apr 25th, 2011 at 9:06am
Print Post  
Option one won't work because I need to reposition the nodes after I draw the lines.

I'm going to try option two although I'm currently using 5.6.1.

Do I just delete my current references from my project and add the 5.6.2 ones?

Thanks

edit: Where can I download 5.6.2 from?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Creating a line and attaching it to a group?
Reply #3 - Apr 25th, 2011 at 9:40am
Print Post  
The line will move with the nodes in both cases, isn't that what you need? You can download the latest version from https://www.mindfusion.eu/FCNetDemo.zip.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint