Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to keep arrows seperated between two nodes. (Read 1909 times)
isteele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Mar 12th, 2007
How to keep arrows seperated between two nodes.
Aug 9th, 2007 at 11:22am
Print Post  
Hi,

I've been trying to get the behaviour shown in the FCNet demo "Layered Layout" whereby if two nodes are connected by more than one arrow the arrows do not overlap.  Despite scanning the code in the demo source I can't find what enables this behaviour.  Can someone tell me what it is I need to do to get this behaviour ?

I am initialising the flowchart object and LayeredLayout objects like this...

           fc.AllowInplaceEdit = false;
           fc.AllowLinksRepeat = false;
           fc.AllowUnconnectedArrows = false;

           // The following was taken from the FC Demo...
           fc.AllowLinksRepeat = true;
           fc.ArrowCascadeOrientation = MindFusion.Diagramming.WinForms.Orientation.Horizontal;
           fc.ArrowCrossings = ArrowCrossings.BreakOff;
           fc.BkgrImagePos = ImageAlign.Center;
           fc.CellFrameStyle = CellFrameStyle.None;
           fc.CrossingRadius = 2;
           fc.HostedCtrlMouseAction = HostMouseAction.PassToControl;
           fc.RoundedArrows = true;
           fc.RoundedArrowsRadius = 10;
           fc.ShadowsStyle = ShadowsStyle.None;

           m_LayeredLayout.LayerDistance = 10;
           m_LayeredLayout.NodeDistance = 20;
           m_LayeredLayout.XGap = 5;
           m_LayeredLayout.YGap = 5;
           m_LayeredLayout.SplitLayers = true;

Thanks in advance,


Ian.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to keep arrows seperated between two nodes
Reply #1 - Aug 9th, 2007 at 12:17pm
Print Post  
Hi,

The layout class does that for arrows that pass through more than one layers in the graph. If boxes connected by multiple arrows are in adjacent layers, the arrows won't be pulled apart automatically.

You can implement that yourself as shown here:
http://mindfusion.org/cgi/Forum/YaBB.pl?board=fcnet_disc;action=display;num=1154...

Stoyan
  
Back to top
 
IP Logged
 
isteele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Mar 12th, 2007
Re: How to keep arrows seperated between two nodes
Reply #2 - Aug 13th, 2007 at 2:45pm
Print Post  
Hi Stoyan,

Thanks for the pointer.  I can get this to work no problem if the arrows are added by a user, however I need to get this functionality to work programatically. 

The problem I have is that I need to use an auto-layout control because the diagram is being generated from stored data, not created by a user.  From what I can tell the arrows are set by the Arrange() method of any auto-arrange control I might use.  The only method I can think of to apply to the solution you referred me to is to do this:

1. Call the auto-layout Arrange() method to position the nodes.
2. Scan through the node collection to create a list of uniquely connected node pairs.
3. Scan through the list of uniquely connected node pairs and then...
   (a) Disconnect all the arrows that connect the two nodes.
   (b) Reconnected the arrows using the algorithm you referred me to originally.


This seems like a long-winded way of going about things, so I wondered if there was a better way of doing this ?

Thanks in advance,


Ian.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to keep arrows seperated between two nodes
Reply #3 - Aug 13th, 2007 at 4:16pm
Print Post  
Hello Ian,

I can't think of any other way to do that. Actually you don't have to disconnect and reconnect the arrows. Just move the code that processes the commonArrows array in ArrowCreated to your own method, then run that method for each pair of boxes that are connected with more than one arrows.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint