Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag node instead of draw link when click n' drag (Read 4967 times)
cmastrantono
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jul 20th, 2011
Drag node instead of draw link when click n' drag
Jul 26th, 2011 at 9:23pm
Print Post  
Hi,

I'm wondering if there is a way to achieve this: when you click and drag a node that is unselected, it should move instead of starting to draw a link.

I've proved with setShapeHandlesStyle (EasyMove, MoveOnly, etc.) and always it starts to draw a link from the node I'm dragging.

Anyone knows how can I do that?

Best regards.

Cristian.


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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Drag node instead of draw link when click n' d
Reply #1 - Jul 27th, 2011 at 6:30am
Print Post  
The MoveOnly flag should not allow link drawing. If you want to be able to move the nodes without first selecting them, try this:

Code
Select All
diagramView.setModificationStart(ModificationStart.AutoHandles); 


I hope it helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
cmastrantono
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jul 20th, 2011
Re: Drag node instead of draw link when click n' d
Reply #2 - Jul 27th, 2011 at 1:54pm
Print Post  
Ok, I understand...

But it still not working...

I'm using an Applet inside a JSP and a Diagram object as a session Bean.

So, in the "AppletStarted" event of the applet I'm doing:

Code
Select All
var d = applet.getDiagramView().setModificationStart(applet.getScriptHelper().getConstant('ModificationStart', 'AutoHandles')); 



But when I click and drag an unselected node It starts drawing a link instead of moving that node.

Should I use or set in adition any Diagram property? (like shapeHandlesStyle)

Cristian.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Drag node instead of draw link when click n' d
Reply #3 - Jul 27th, 2011 at 2:42pm
Print Post  
DiagramView.ModificationStart simply enables node interactions without the need to select the node first. The allowed interactions still depend on the value of the node's HandlesStyle. Therefore, you need to set HandlesStyle to a value, which prevents link creation, such as MoveOnly.

Code
Select All
node.setHandlesStyle(7); // MoveOnly 


This however will prevent link creation even if the node is selected, which might not be desired.

Regards,
Meppy
  
Back to top
 
IP Logged
 
cmastrantono
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jul 20th, 2011
Re: Drag node instead of draw link when click n' d
Reply #4 - Jul 27th, 2011 at 2:51pm
Print Post  
Go it...

I think I found the problem...

The javascript function asociated to the AppletStarted param of the appplet is never called.

This is how my applet is defined in the JSP page:

Code
Select All
<applet id="diag"
archive="../JDiagram.jar"
width='${diagram.getBounds().getWidth()}>'
height='${ diagram.getBounds().getHeight()}>'
code="com.mindfusion.diagramming.DiagramApplet"
mayscript>
<param name='DiagramData' value='........'>
<param name='Clicked' value='docClicked'>
<param name='LinkDoubleClicked' value='linkDoubleClicked'>
<param name='AppletStarted' value='appletStarted'>
</applet> 



I wasn't able to find info about the "params" of the applet.... in particular, the "AppletStarted" or "DiagramData" params. Where it is supposed that I can find that info?

Regards,
Cristian
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Drag node instead of draw link when click n' d
Reply #5 - Jul 28th, 2011 at 7:06am
Print Post  
Define the appletStarted function with two arguments. I am not entirely sure what they are for (they come as undefined in my tests). The other event handlers need to have the corresponding number of arguments too, as described here.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint