Page Index Toggle Pages: 1 [2] 3 4  Send TopicPrint
Very Hot Topic (More than 25 Replies) Parallel Connections in Diagrams (Read 27329 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #15 - Mar 15th, 2010 at 8:47am
Print Post  
1) A collection might not be fully sorted if the IComparer.Compare operation is not fully transitive, i.e. if Compare returns a < b, b < c then it should also return a < c. I am not sure what happens if the comparer returns 0 for some items; instead of returning 0 if the items' Y values are equal, try also comparing them by X and returning -1 or 1. Also make sure you are sorting the collection after this stop node has been added.

2) The NodeModified event.

3) NodeCreating is raised only if the user starts drawing a node on the canvas, but not for drag-and-drop operations.

4) Set diagram.UndoManager.UndoEnabled = true, and call the UndoManager's methods to undo / redo actions.

I hope that helps,
Stoyan
« Last Edit: Mar 15th, 2010 at 11:48am by Stoyo »  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #16 - Mar 15th, 2010 at 12:08pm
Print Post  
Thanks Stoyan.

1) I will modify the IComparer.Compare operation and try it out.

2) NodeModified event worked. Thanks.

3) Understood. Thank you.

4) I tried adding the code diagram.UndoManager.UndoEnabled = true; to the constructor. I also added 2 buttons for performing Undo and Redo operation. The Undo button has the following code,
diagram.UndoManager.Undo();
and the Redo button has the following code,
diagram.UndoManager.Redo();

The Undo and Redo seems to be malfunctioning. When undo operation is performed it introduces new nodes and makes the diagram a junk.

5) Also Drawing.Behavior = Behavior.DrawLink doesn't work. Is there anything else we need to set to enable manual drawing of the links. I need the ability that my diagram should be capable of drawing links manually as well as through code behind.

6) Can we use a CustomControl as well as a ShapeNode in the same diagram. My requirement is that i will have few Custom Controls in my diagram and i also need a IfElse which is already available in the ShapeNode.

Please help on these items.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #17 - Mar 15th, 2010 at 12:55pm
Print Post  
Quote:
The Undo and Redo seems to be malfunctioning. When undo operation is performed it introduces new nodes and makes the diagram a junk.


Are you perhaps creating some temporary nodes and removing them later? The Undo method might be creating them again...

5) It works in my test. Check if it's not set to Modify / DoNothing by some code later.

6) Yes, you could use ControlNodes that host your custom controls.

Stoyan
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #18 - Mar 16th, 2010 at 6:16am
Print Post  
Thanks Stoyan,

I am not creating any temporary nodes, i just have 3 buttons (in my toolbox) each for Activity(Shape node), WorkFlow(Shape node) and Ifelse(Shape node). On click of the buttons, i just insert the node above the stop node. Here i have used the function CreateActivity from the sample WorkFlowDesigner. After this if i try to do undo, i expect the 3rd node which is recently created to disappear, but strange things happen. ???

ControlNodes?, is it a node type. How to use it? Do you have any samples for it.

Please help.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #19 - Mar 16th, 2010 at 8:41am
Print Post  
Could you email your test project or at least the buttons' code to support@mindfusion.eu?
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #20 - Mar 16th, 2010 at 9:53am
Print Post  
Sent you the sample Project which i was working on. you will receive an email from Surendra@eagle-india.com.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #21 - Mar 16th, 2010 at 10:43am
Print Post  
If you expect removing the link and adding a node and two new links to be undone as a single operation, you must enclose all that code within UndoManager.StartComposite() and CompositeCmd.Execute() calls. Additionally, only add and remove operations are saved automatically in the undo history. Operations that modify items properties such as the code that arranges links must be enclosed within "new ChangeItemCmd()" and cmd.Execute() calls.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #22 - Mar 16th, 2010 at 11:26am
Print Post  
Sorry, it's called ControlNode in the WinForms version. In WPF you can directly add a control to the diagram.Nodes collection - this creates a DiagramNodeAdapter behind the scenes. Or you might explicitly create a DiagramNodeAdapter that hosts the control and add it to the Nodes collection.
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #23 - Mar 17th, 2010 at 9:51am
Print Post  
Thanks Stoyan.

Is it possible to design a new Shape in ShapeNode which can hold two images in the right hand corner one below the other.

Also i wanted to group the nodes, the IfElse node comprises of Shapes.Decision, Shapes.Ellipse and few links. I wanted to make all these into a group so that if the user select the node, the entire group is selected. It will be great to have this feature. Is this possible?

Please help
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #24 - Mar 17th, 2010 at 11:29am
Print Post  
Quote:
Is it possible to design a new Shape in ShapeNode which can hold two images in the right hand corner one below the other.


The standard ShapeNode class has only one Image property. You have a few options:

- derive ShapeNode to add Image2 property, and override the Draw method to render Image2.
- use standard ShapeNodes with custom drawing, i.e. with their CustomDraw property is set to Additional, and the DrawNode event handler renders the additional image.
- use TableNodes (each cell can display an image) or a custom control wrapped in DiagramNodeAdapter.
- use an attached ShapeNode to display the additional image. If you set Transparent = true, only the image will be visible and not the node geometry.

Quote:
Also i wanted to group the nodes, the IfElse node comprises of Shapes.Decision, Shapes.Ellipse and few links. I wanted to make all these into a group so that if the user select the node, the entire group is selected. It will be great to have this feature. Is this possible?


You could use the AttachTo method to attach the additional nodes to the IfElse node; then if the user moves the IfElse, the atatched images will move too. Selecting any of the child nodes won't select the whole group, but you could implement it with some event handling by selecting the nodes accessible through node.MasterGroup or node.SubordinateGroup.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #25 - Mar 17th, 2010 at 1:19pm
Print Post  
Thanks Stoyan,

I am planning to use the TableNode.  if i design a node with 3 rows and 2 columns. how do i place a image in column 2 of row 1 and column 2 of row 3.

Also, i can see the table border displaying inside the node, is it possible to alter the style not to display the borders.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #26 - Mar 17th, 2010 at 2:09pm
Print Post  
Set CellFrameStyle = None to hide the border lines and assign to table[col, row].Image to set the images.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #27 - Mar 17th, 2010 at 2:40pm
Print Post  
Thanks Stoyan. It worked.

Is it possible to remove the first row of the TableNode which says "Table" and then a line below.

I just wanted my node to show some text which i give and images which i set.

Also is it possible to raise an event when i click on the image?

Please help.

  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Parallel Connections in Diagrams
Reply #28 - Mar 17th, 2010 at 3:01pm
Print Post  
Try setting CaptionHeight = 0 and handling the CellClicked event.
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Parallel Connections in Diagrams
Reply #29 - Mar 17th, 2010 at 3:08pm
Print Post  
Thanks Stoyan.

Where do i get the CellClicked event? is it part of TableNode or cell?

Do you have any code sample for this? Please help.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 4 
Send TopicPrint