Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Routed links all messed up… (Read 6518 times)
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Routed links all messed up…
Apr 2nd, 2009 at 5:20pm
Print Post  
Hi

In my workflow diagram I'm preventing the user from free drawing on the diagram surface.

The workflow XAML looks like that:

<my:Diagram x:Name="wfDiagram" ModificationStart="SelectedOnly" Bounds="0, 0, 2000, 2000" VerticalAlignment="Stretch" ShapeBrush="White"
HorizontalAlignment="Stretch"
AllowInplaceEdit="False" LinkBrush="Green" RouteLinks="True"
LinkSelected="wfDiagram_LinkSelected" LinkDeselected="wfDiagram_LinkDeselected" LinkCreated="wfDiagram_LinkCreated" LinkModified="wfDiagram_LinkModified"
NodeSelected="wfDiagram_NodeSelected" NodeDeselected="wfDiagram_NodeDeselected"
MouseLeftButtonDown="wfDiagram_MouseLeftButtonDown" MouseMove="wfDiagram_MouseMove">
</my:Diagram>


And in the C# I initialize with


////Disable multy select
wfDiagram.Selection.AllowMultipleSelection = false;
wfDiagram.CustomBehavior = new clsNodeCustomBehavior(wfDiagram);
wfDiagram.Behavior = Behavior.Custom;

//Make The routing link better
wfDiagram.RoutingOptions.GridSize = 2;
wfDiagram.RoutingOptions.StartOrientation = MindFusion.Diagramming.Silverlight.Orientation.Horizontal;
wfDiagram.RoutingOptions.EndOrientation = MindFusion.Diagramming.Silverlight.Orientation.Auto;
wfDiagram.RoutingOptions.Anchoring = Anchoring.Keep;

Where clsNodeCustomBehavior Is
public class clsNodeCustomBehavior :BehaviorBase
{

public clsNodeCustomBehavior(Diagram diagram)
: base(diagram)

{

}


public override InteractionState StartDraw(Point point)

{


DiagramNode node = Diagram.GetNodeAt(point);


if (node != null)



return new InteractionState(node, MindFusion.Diagramming.Silverlight.Action.Modify, 8, point);



return null;

}
}


Now, when the user adds a few nodes with routing links and then perform the following action:

1. MouseDown on the diagram in an empty place (no nodes or links).
2. Quick drag, while the mouse button is down through some routed links

What happened is that the routed links get all messed up ???
Any Idea why that happen and is there a fix for that ?

Hope I was clear enough

Many thanks

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routed links all messed up…
Reply #1 - Apr 2nd, 2009 at 5:30pm
Print Post  
What exactly happens in the mouse event handlers attached to the diagram?
  
Back to top
 
IP Logged
 
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Re: Routed links all messed up…
Reply #2 - Apr 2nd, 2009 at 5:36pm
Print Post  
Not much....
If I'm in "drag the entire workflow" mode than I manipulate th cursor

       private void wfDiagram_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
       {
           if (_bDraggingWorkspace == true)
           {
               Cursor = Cursors.Hand;
               wfDiagram.Cursor = Cursors.Hand;
           }
           else
           {
               //wfDiagram.Behavior = Behavior.DoNothing;
           }
       }

       private void wfDiagram_MouseMove(object sender, MouseEventArgs e)
       {
           if (_bDraggingWorkspace == true)
           {
               Cursor = Cursors.Hand;
               wfDiagram.Cursor = Cursors.Hand;
           }
       }

But in the scenario that I've pointed _bDraggingWorkspace = false... so nothing actually

Thx

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routed links all messed up…
Reply #3 - Apr 2nd, 2009 at 5:40pm
Print Post  
Are you sure you are not selecting and moving some links inadvertently? Could you email a small project that reproduces this to our support email address?
  
Back to top
 
IP Logged
 
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Re: Routed links all messed up…
Reply #4 - Apr 2nd, 2009 at 5:48pm
Print Post  
I wish I could, but not at the moment... Our project is Huge... Cheesy
I may be able to do It on sunday... I just though that maybe you can think of something that I do that could create this kind of behavior....

I'm not moving a link or a node... I click on an "Empty" area of the diagram.


It's a bit similar to if I was painting a shape through the routed links so they would have reposition themselves but this is not the case because I do not paint nothing....

Just hoped that you will have something in mind...
(Stoyan is quite farmiliar with what I did with your control along the way... if you are not him, maybe you can consult Roll Eyes )
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routed links all messed up…
Reply #5 - Apr 3rd, 2009 at 7:26am
Print Post  
What happens in the Deselected handlers?
  
Back to top
 
IP Logged
 
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Re: Routed links all messed up…
Reply #6 - Apr 5th, 2009 at 6:59am
Print Post  
I have a property panel that I show hide and update.

       private void wfDiagram_NodeDeselected(object sender, NodeEventArgs e)
       {
           HideProperties();

       }

       private void wfDiagram_LinkDeselected(object sender, LinkEventArgs e)
       {
           _dlnkCur_Sel_Link = null;
           //Clear Properties
           panelProperties.Children.Clear();


       }

       private void HideProperties()
       {
           _dnodeCur_Sel_Node = null;
           //Clear
           panelProperties.Children.Clear();
           grdShoHideProperties.Visibility = Visibility.Collapsed;
       }

Any idea what can cause my srange behaviour ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routed links all messed up…
Reply #7 - Apr 6th, 2009 at 9:43am
Print Post  
Not any. Please email us a project that shows that if you can.
  
Back to top
 
IP Logged
 
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Re: Routed links all messed up…
Reply #8 - Apr 6th, 2009 at 9:45am
Print Post  
Well... thanks for the effort...
I'll do my best to do it soon  Smiley
  
Back to top
 
IP Logged
 
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Re: Routed links all messed up…
Reply #9 - Apr 7th, 2009 at 4:52pm
Print Post  
Hust sent a test project to
support@mindfusion.eu

8)

Thx

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routed links all messed up…
Reply #10 - Apr 8th, 2009 at 8:01am
Print Post  
Our developer will check it today.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routed links all messed up…
Reply #11 - Apr 8th, 2009 at 9:01am
Print Post  
The problem is that your Links button sets wfDiagram.Behavior = Behavior.LinkControls. This means that when users start drawing from a node, there is a link created, otherwise there is a ControlNode created. So when you draw from one corner of the diagram to another, there is a big ControlNode created that triggers rerouting all links, but the path-finding fails since that node is an obstacle.

Note that the ControlNode even contains a Rectangle control, which is set as DefaultControlType, however the rectangle does not have any style attributes set so it's a bit invisible Wink

One way to handle this is to handle NodeCreating and call e.CancelDrag while in draw links mode. Another way is to create a second custom behavior to use for the draw-links mode, that never creates a node.

I hope that helps,
Stoyan
« Last Edit: Apr 8th, 2009 at 11:30am by Stoyo »  
Back to top
 
IP Logged
 
Hai
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 63
Joined: Jan 7th, 2009
Re: Routed links all messed up…
Reply #12 - Apr 13th, 2009 at 7:35am
Print Post  
I've used the second one...
Yooooppppeeeee... it works

Grin

Thx

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