Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with DoubleAnimation (Read 2597 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Problem with DoubleAnimation
Apr 25th, 2009 at 9:03am
Print Post  
Hi,

I have applied DoubleAnimation on Nodes for zooming. This is working fine but have two little issues.

1. When I zoom-In on node and node grows then Attached link should be decreased (i.e. link should be Auto Adjusted with zooming).

2. This node has a childNode which is attached at the bottom of this node and displays some text. This child node should also be auto adjusted.

Any suggestion?

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with DoubleAnimation
Reply #1 - Apr 26th, 2009 at 10:14am
Print Post  
Hi,

1. You will have to revert to the RectAnimation over node.Bounds you were using before. Another option is to create a PointAnimation for each link, but the point positions might be tricky to calculate.

2. If you need the text to zoom as well, run separate DoubleAnimation over the child node's RenderTransform.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Problem with DoubleAnimation
Reply #2 - May 6th, 2009 at 10:54am
Print Post  
Hi I have tried to apply reverse double animation while mouse leave.But its not working as expected.
Could you plz send a code example to show how can I reverse the double animation.
Code for Straight double animation is here:

Code
Select All
node123 = e.Source as ShapeNode;
		ScaleTransform scale = new ScaleTransform();

		node123.AllowIncomingLinks = true;
		node123.AllowOutgoingLinks = true;

		scale.CenterX = node123.Bounds.X + node123.Bounds.Width / 2;
		scale.CenterY = node123.Bounds.Y + node123.Bounds.Height / 2;

		originalTransform = node123.RenderTransform;
		TransformGroup tg = new TransformGroup();
		tg.Children.Add(originalTransform);
		tg.Children.Add(scale);
		node123.RenderTransform = tg;

		var xa = new DoubleAnimation(1, 2, new Duration(new TimeSpan(0, 0, 0, 0, 300)));
		var ya = new DoubleAnimation(1, 2, new Duration(new TimeSpan(0, 0, 0, 0, 300)));

		if (diagram.FindName("mouseEnter") != null)
		    diagram.UnregisterName("mouseEnter");
		diagram.RegisterName("mouseEnter", scale);

		Storyboard.SetTargetName(xa, "mouseEnter");
		Storyboard.SetTargetProperty(xa, new PropertyPath("ScaleX"));
		Storyboard.SetTargetName(ya, "mouseEnter");
		Storyboard.SetTargetProperty(ya, new PropertyPath("ScaleY"));

		var sb = new Storyboard();
		sb.AutoReverse = false;
		sb.Children.Add(xa);
		sb.Children.Add(ya);
		sb.Begin(diagram);
		sb.Stop(); 

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