Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic State machine diagram (Read 3073 times)
Pong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 3rd, 2009
State machine diagram
Jun 4th, 2009 at 8:46am
Print Post  
We are currently evaluating your tool and I'd like to say first that it's very impressive. It seems very powerful and it should be able to fit our requirements but after having played around a bit with it, we still have some questions. Here they are.

With your tool, we want to draw a state machine without spending to much time on it.
So we need:
- To draw very customized nodes to figure the states.
- The ability of embedding nested states into states without any depth limit (state hierarchy).
- The ability of linking a state to another state even if they don't have the same super-state (father). In other word, we want to be able to link a state of arbirtary level to any other state.
- Allow the user to collapse or expand sub-states.

Last but not least, all the components of the state machine diagram must be fully stylable and templatable. So they must be WPF controls.

We found three ways of achieving that.
1) Embed diagram for the sub-states in the template of our custom state node.
2) Using a customized ContainerNode.
3) Using grouping features.

The first solution seemed to be the most straightforward. Thus We have created a custom node class that is a subclass of DiagramNodeadapter. This class wraps a custom control with a sub diagram in it. But we cannot link nested states to other states outside the super-state.

It seems that the second solution is more expansive because we will probably have to override the draw method of the container and deal with arranging and sizing concerns that can quickly become a little bit complicated. That is true for the third one also.

To this regard, it would be much easier to do such customization if the container node was a real WPF control. Why is it not?

Could you just give us some advices about those concerns and the best way for achieving what we want to do?

Thanx in advance.
« Last Edit: Jun 4th, 2009 at 12:48pm by Pong »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: State machine diagram
Reply #1 - Jun 4th, 2009 at 10:23am
Print Post  
Hi,

In its initial versions the control used FrameworkElement as the base of DiagramItem, but rendering was too slow for some reason so we changed the base to UIElement. We'll check if we can add some support for templates even if using UIElement. That doesn't look too complex, given the ControlTemplate.LoadContent method which returns a visual tree - ContainerNode could render this tree instead of running its standard drawing code. If that does not work, we could add a CustomDraw property and let you handle the DrawNode event to render the container using DrawingContext calls.

Stoyan
  
Back to top
 
IP Logged
 
Pong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 3rd, 2009
Re: State machine diagram
Reply #2 - Jun 4th, 2009 at 12:43pm
Print Post  
Hi Stoyo,

Thank you for your answer. We will try to use a template in the way you discribe for the rendering of the container.

But what about the first solution we have imagined ? More precisely, is it possible to create a link from a node - say in the main diagram - to another in a nested-diagram ? When I try to do that using the Factory.CreateLink method, I don't get any error but the link is just not added to the target diagram (I tried to add this link both to the main diagram and the nested diagram). I can create it with the Link Constructor but i can't add it.

Is it the normal behavior in this case and is there any workaround to achieve that or is it definitely a wrong way ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: State machine diagram
Reply #3 - Jun 4th, 2009 at 1:33pm
Print Post  
Hi Pong,

At this time the link's UIElement is a part of the  visual tree of the diagram, and since WPF does not support a UIElement to be a child of more than one parent, you can't have a link going between two diagrams. In order to implement this, we would have to change a lot of code so that links are added as children of the common parent of the two diagrams, and that's not likely to happen soon.

Stoyan
  
Back to top
 
IP Logged
 
Pong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 3rd, 2009
Re: State machine diagram
Reply #4 - Jun 5th, 2009 at 11:13am
Print Post  
I was expecting your answer. So we gonna try first with the grouping solution. It can be a little bit tricky with positionning concerns but probably technically simplier than the template approach.

Thanx again.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: State machine diagram
Reply #5 - Jun 5th, 2009 at 11:34am
Print Post  
If you email us a drawing showing what you'd like the containers to look like, we could add some property to enable that if there is no too great difference form their current appearance.

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