Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic NetDiagram v3  - User Created Diagrams ImageMap (Read 2822 times)
ghawkes
YaBB Newbies
*
Offline



Posts: 9
Joined: Apr 10th, 2009
NetDiagram v3  - User Created Diagrams ImageMap
Apr 14th, 2009 at 8:44pm
Print Post  
Hello,

I am trying to produce a Diagram like the ShapeListBox demo where a user can build/modify their own diagram. I need to use ImageMap mode and I am unsure how to duplicate some of the behavior in the JavaApplet.

For instance, in the demo a single click allows move/resize and a click+drag will link objects. In ImageMap mode I only seem to be able to have 1 set of behavior at a time. Also, I did not see a BehaviorBase class that applied to ASP.NET.

Is there anywhere I can download sample/example code using ImageMap mode? I am especially interested in user created/modified diagrams.

Thank you,
- G
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NetDiagram v3  - User Created Diagrams ImageMa
Reply #1 - Apr 15th, 2009 at 7:50am
Print Post  
Hi,

Do you mean the Flowcharter example? Setting DiagramView.Behavior = LinkShapes should let you draw both nodes and links, and also select and modify them. In LinkShapes mode, drawing from an unoccupied point of the diagram creates a node, and drawing from a node creates a link. You can check this in the Behaviors sample, new for NetDiagram V3: select LinkShapes from the list there and you will be able to create both nodes and links, and also select them by clicking and resize them by moving their selection handles.

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



Posts: 9
Joined: Apr 10th, 2009
Re: NetDiagram v3  - User Created Diagrams ImageMa
Reply #2 - Apr 15th, 2009 at 5:50pm
Print Post  
Hi Stoyan, thank you for your quick reply.

I am actually referring to the ShapeListBox example where the user can build a custom diagram by dragging the shapes onto the diagram itself. 

The DiagramView.Behavior = MindFusion.Diagramming.Behavior.LinkShapes is not giving me the behavior that I am seeing in the demo on the webpage.  When I single click a shape it draws a link to itself and does not allow me to resize / move the shape.  I would like the user to be able to:

* Drag new shapes onto the Diagram from a ShapeListBox.
* Single click shapes to resize / move them.
* Click and hold to draw links between shapes.
* NOT be able to draw new boxes on the diagram, all shapes should come from the ShapeListBox.

I see behavior close to what I need in the applet example but I am not sure how to duplicate it using ImageMap mode.  Is there anything I can do? 

Thank you.
- G
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NetDiagram v3  - User Created Diagrams ImageMa
Reply #3 - Apr 15th, 2009 at 6:42pm
Print Post  
Hi,

Do you mean the online demo here?
http://mindfusion.eu/demos/jdiagram/ShapeListBox.htm

It lets you draw new shapes from what I can see, and to disable that you should set Behavior = DrawLinks. In DrawLinks mode, the user will be able to create a node only through the listbox, and the rest of your requirements should hold too.

Clicking on a node should not draw a self-loop link, unless the mouse moves a couple of pixels between the mouse down and up events. Anyway you could try that with AllowSelfLoops set to false if you don't need such links at all. Also you might try this with the latest build of the control, in case our developers have fixed something related to the behaviors logic since the last release:
https://mindfusion.eu/_temp/netdiag_events.zip

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



Posts: 9
Joined: Apr 10th, 2009
Re: NetDiagram v3  - User Created Diagrams ImageMa
Reply #4 - Apr 15th, 2009 at 7:38pm
Print Post  
Hi Stoyan,

With the latest code and diagramView.Behavior = Behavior.DrawLinks I am getting the behavior that I was looking for. Thank you.

However, I have run into another issue. I am trying to handle serverside events in ImageMap mode but they never seem to fire. I have the code:



<ndiag:DiagramView ID="diagramView" runat="server" Height="512px" Width="512px"



ClientSideMode="ImageMap" ShowScrollbars="false">



<Diagram AllowSelfLoops="false"




OnNodeDoubleClicked="Diagram_NodeDoubleClicked"




OnNodeClicked="Diagram_NodeClicked"




OnLinkClicked="LinkClicked" />


</ndiag:DiagramView>

I have the 3 event handlers implemented in my C# code-behind but yet they never fire. Is there something I am missing?

I have also tried hooking them up using:
diagramView.Diagram.NodeClicked += new NodeEventHandler(Diagram_NodeClicked);

This does not seem to work either.

Thank you,
- G
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NetDiagram v3  - User Created Diagrams ImageMa
Reply #5 - Apr 15th, 2009 at 7:48pm
Print Post  
Hi G,

We haven't found any way to connect handlers to events of a nested object that's not an ASP.NET control through markup. So, at this time the supported events are defined in DiagramView. The ones you can see in Diagram are used in the Windows Forms version of the control, which is based on the same diagramming.dll as NetDiagram.

Stoyan
  
Back to top
 
IP Logged
 
ghawkes
YaBB Newbies
*
Offline



Posts: 9
Joined: Apr 10th, 2009
Re: NetDiagram v3  - User Created Diagrams ImageMa
Reply #6 - Apr 15th, 2009 at 8:02pm
Print Post  
Ok Stoyan, thank you for the information (and the quick reply).

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