Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) rect to ellipse (Read 5928 times)
taxi00driver
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 19th, 2010
rect to ellipse
May 3rd, 2010 at 10:29am
Print Post  
Hi !

I want change drawing item from rect to ellipse.
But i have big trouble with that. Can You help me ??

Bartek,
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: rect to ellipse
Reply #1 - May 3rd, 2010 at 10:48am
Print Post  
Hi,

If you are using ShapeNodes, set node.Shape = Shapes.Ellipse, or set diagram.DefaultShape to set it for all new nodes. For other types of nodes you will have to modify their ControlTemplate.

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


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 19th, 2010
Re: rect to ellipse
Reply #2 - May 3rd, 2010 at 11:12am
Print Post  
        
           Dictionary<string, DiagramNode> nodeMap = new Dictionary<string, DiagramNode>();

          Rect bounds = new Rect(0, 0, 60, 20);

           foreach (ItemList x in query12)
           {
               ShapeNode diagramNode = diagram.Factory.CreateShapeNode(bounds);
               nodeMap[x.AtributeID] = diagramNode;
               diagramNode.Text = x.AtributeTITLE;
               peersDict.Add(x.AtributeID, x.AtributePEERS);
           }
           foreach (string itemID in peersDict.Keys)
           {
               string peers = peersDict[itemID];
               string[] peersArr = peers.Split(new string[] { ";#" }, StringSplitOptions.RemoveEmptyEntries);
               for (int i = 0; i < peersArr.Length; i=i+2)
               {
                   diagram.Factory.CreateDiagramLink(
                             nodeMap[itemID],
                             nodeMap[peersArr[i]]);
                 
               }
           }
           LayeredLayout layout = new LayeredLayout();
           layout.Arrange(diagram);


That is my program. End hier i must change rect to somethink like ellipse and add silverlight animiation to nodes and connect lines.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: rect to ellipse
Reply #3 - May 3rd, 2010 at 12:04pm
Print Post  
This should create an ellipse:
diagram.Factory.CreateShapeNode(bounds, Shapes.Ellipse)

What kind of animations do you need?

Stoyan
  
Back to top
 
IP Logged
 
taxi00driver
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 19th, 2010
Re: rect to ellipse
Reply #4 - May 3rd, 2010 at 12:13pm
Print Post  
I wants to add a graphic (change background, add grandian) to change the appearance of nodes and lines (pretty arrows) and then do everything so that flew Cheesy
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: rect to ellipse
Reply #5 - May 3rd, 2010 at 12:48pm
Print Post  
This fills a node with a gradient:

Code
Select All
var brush = new LinearGradientBrush();
brush.GradientStops.Add(new GradientStop { Color = Color.FromArgb(255, 255, 255, 255), Offset = 0.0 });
brush.GradientStops.Add(new GradientStop { Color = Color.FromArgb(255, 255, 220, 200), Offset = 0.2 });
brush.GradientStops.Add(new GradientStop { Color = Color.FromArgb(255, 255, 200, 150), Offset = 1.0 });
brush.StartPoint = new Point(0, 0);
brush.EndPoint = new Point(0.7, 1);
e.Node.Brush = brush; 



Do you need to animate the nodes' fill color?
  
Back to top
 
IP Logged
 
taxi00driver
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 19th, 2010
Re: rect to ellipse
Reply #6 - May 3rd, 2010 at 12:58pm
Print Post  
I want animated all somethink like this: http://quince.infragistics.com/#/ByTag

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: rect to ellipse
Reply #7 - May 3rd, 2010 at 1:50pm
Print Post  
Currently you can do the color animations by handling the nodes' MouseEnter/Leave events and changing the brush from the handlers.

For version 1.5 we have added some visual states such as Selected / Unselected / MouseOver / MouseOut for which you could define animation storyboards in the nodes' Xaml templates through the VisualStateManager feature of Silverlight. If you wish to try that, you can use this beta build:
https://mindfusion.eu/_beta/diaglite15_states.zip

Position animation can be done by calling SpringLayout.Iterate from a timer. This method is not available for LayeredLayout. If you prefer the latter, you can record the positions of nodes from before and after applying the layout, and then animate the nodes by moving the linearly from the initial to final positions.

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


I love YaBB 1G - SP1!

Posts: 11
Joined: Apr 19th, 2010
Re: rect to ellipse
Reply #8 - May 3rd, 2010 at 2:02pm
Print Post  
And one more question. How to do a nod to everyone had their specific size? When I trying to change anything goes at it with the same lines are displayed.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: rect to ellipse
Reply #9 - May 3rd, 2010 at 2:30pm
Print Post  
You can change the size of nodes through their Bounds property if that's what you are asking.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: rect to ellipse
Reply #10 - May 25th, 2010 at 8:29pm
Print Post  
Btw. here's a layout animation sample we are preparing for the next release:
https://mindfusion.eu/_samples/AnimatedLayout.zip

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