Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Decision Activity yes/no are not aligning center (Read 2941 times)
praveenbattula
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 22
Joined: Apr 6th, 2010
Decision Activity yes/no are not aligning center
Apr 23rd, 2010 at 9:38am
Print Post  
Hi,
We have decision activities in diagram. They have two outgoing links for yes and no. The problems here is, the yes and no are not aligning correct on connector links. Some times they are overlapping with destination node. So, what could be the problem?

See the below screens.

https://docs.google.com/leaf?id=0B65pqf9wDPxBMWZhMGE5YzMtMmFkNS00MzBiLWFkZDUtMGQ...

https://docs.google.com/leaf?id=0B65pqf9wDPxBZjkzYTFhNGQtYzI2MC00OTBhLWExMzYtYzg...

thanks
  
Back to top
WWW  
IP Logged
 
Chandermani
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 23rd, 2010
Re: Decision Activity yes/no are not aligning cent
Reply #1 - Apr 23rd, 2010 at 11:07am
Print Post  
Hi,
I am working with Praveen on the same issue. Since we have a source code license for SL. I tried to debug the issue in source code. What i realize that the text placement algorithm depends upon the number of control points of a link. Having a different behaviour for even and odd control points. The UpdateTextLayout method on DiagramLink class is performing this task.
In our case 2 or more control points have same value and hence the TextBlock gets dock to either left or right.
For the link under consideration the connected shapes are moved using code and ideally control points should increase\decrease based on the shape position. When the overlapping is occurring the two shapes are in a line but still control point count is 3 instead
Any suggestions on how to proceed from here?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Decision Activity yes/no are not aligning cent
Reply #2 - Apr 23rd, 2010 at 11:59am
Print Post  
Yes, at this time the label is always displayed at the middle segment or point. If by chance you are using a derived link class, you could override UpdateVisuals and place the textblock at a different position. Otherwise you can create a method that gets the textblock for a link through the link.Content canvas and sets the textblock position, and then call this method in response to LinkModifying and NodeModifying events, and also every time you set the link's position from code.
  
Back to top
 
IP Logged
 
Chandermani
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 23rd, 2010
Re: Decision Activity yes/no are not aligning cent
Reply #3 - Apr 23rd, 2010 at 12:15pm
Print Post  
Thanks Stoyo,
I would give it a try.
  
Back to top
 
IP Logged
 
Chandermani
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 23rd, 2010
Re: Decision Activity yes/no are not aligning cent
Reply #4 - Apr 23rd, 2010 at 1:12pm
Print Post  
We are deriving a new class from the DiagramLink class. In case i override the UpdateVisual what all methods i need to call.Would calling base.UpdateVisual be good enough. Also the textblock is not a protected\public property on the DiagramLink class. So do i need to get the instance using link.Canvas?
If we could have the Textblock as protected and the method UpdateTextLayout as overridable we can place the text as expected.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Decision Activity yes/no are not aligning cent
Reply #5 - Apr 23rd, 2010 at 1:42pm
Print Post  
At this time you can get the TextBlock as shown here -
http://mindfusion.eu/Forum/YaBB.pl?board=diaglite_disc;action=display;num=127106...

and update its position after calling base.UpdateVisuals. We'll add some features to make the label position overridable for the next release.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Decision Activity yes/no are not aligning cent
Reply #6 - Apr 28th, 2010 at 2:33pm
Print Post  
This version adds a public TextBlock getter and allows overriding the UpdateTextLayout method, in case you are interested in trying out the beta:

https://mindfusion.eu/_beta/diaglite15.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint