Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic getOriginAnchor() problem (Read 4318 times)
cpmjones
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
getOriginAnchor() problem
Mar 31st, 2011 at 10:23am
Print Post  
Hi,

I use getOriginAnchor() to determine where a link is connected to it's origin node.

After applying a layout algorythm (e.g. Flowchart) the link's origin changes but getOriginAnchor() returns the same index as before.

Is this correct?

Thanks,

Chris
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: getOriginAnchor() problem
Reply #1 - Mar 31st, 2011 at 10:52am
Print Post  
Set Layout.Anchoring to Reassign if the layout code should align links to anchor points. The Ignore option ignores the anchor point positions but does not remove their association with the links.

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


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
Re: getOriginAnchor() problem
Reply #2 - Mar 31st, 2011 at 12:39pm
Print Post  
Hi Stoyo,

thanks again for your quick response.

Unfortunately it appears to ignore whichever anchoring value I set.

Is there any other setting which may be affecting this?

Thanks,

Chris
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: getOriginAnchor() problem
Reply #3 - Mar 31st, 2011 at 2:11pm
Print Post  
Hi,

Are you calling routeAllLinks() after arrange()? The routing function considers the RoutingOptions.Anchoring value.

Stoyan
  
Back to top
 
IP Logged
 
cpmjones
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
Re: getOriginAnchor() problem
Reply #4 - Mar 31st, 2011 at 2:19pm
Print Post  
Hi Stoyo,

here is my code:

[code]
FlowchartLayout fl = new FlowchartLayout();

fl.setIgnoreRepeatingLinks(false);
fl.setOrientation(Orientation.Auto);

fl.setAnchoring(Anchoring.Reassign);

fl.arrange(diagram);

diagram.routeAllLinks();
[/code]

Thanks,

Chris
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: getOriginAnchor() problem
Reply #5 - Mar 31st, 2011 at 5:45pm
Print Post  
Hi Chris,

Set it on the RoutingOptions object too and routeAll will align the links to anchor points:

diagram.getRoutingOptions().setAnchoring(Anchoring.Reassign);
diagram.routeAllLinks();

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


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
Re: getOriginAnchor() problem
Reply #6 - Apr 4th, 2011 at 9:17am
Print Post  
That worked, thanks!  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint