Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic setEnabledHandles and LayeredLayout @JavaApplet (Read 4475 times)
henry k
Junior Member
**
Offline


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
setEnabledHandles and LayeredLayout @JavaApplet
Apr 19th, 2012 at 7:48am
Print Post  
Is it possible to set multiple handles options. As option "All" is too much and I haven't found a way to customize these options. In my case this would be simpler if from "All" -option I could disable rotate option.

Also I would like to know how to use Layouts on client-side in JavaApplet mode (if it's possible?). As {MindFusion.Graphs} return [null] and as also {MindFusion.Drawing}... what I'm missing here...?

Br. Henry
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: setEnabledHandles and LayeredLayout @JavaApplet
Reply #1 - Apr 19th, 2012 at 9:53am
Print Post  
Hi,

The bit mask for disabled rotation handle should look like "AdjustmentHandles.All & ~AdjustmentHandles.Rotate". Or you can enable only individual handles by setting EnabledHandles to a value such as "AdjustmentHandles.ResizeTopLeft | AdjustmentHandles.Move".

You cannot instantiate Java classes from JavaScript if they are not on the system's class_path, so there are various create* methods exposed via the ScriptHelper class to let you create layout objects:

Code
Select All
var applet = <%= diagramView.AppletElement %>;
var treeLayout = applet.getScriptHelper().createTreeLayout();
 



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


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Re: setEnabledHandles and LayeredLayout @JavaApplet
Reply #2 - Apr 19th, 2012 at 12:02pm
Print Post  
Thank you, both answers were helpful. Though I'm using LayeredLayout...
#1(case): I used the first option.. ( "AdjustmentHandles.All & ~AdjustmentHandles.Rotate" )

I encountered case of problem when setting orientation to this layout.

Code (Javascript)
Select All
var layout = scriptHelper.createLayeredLayout();
layout.setNodeDistance(60);
layout.setLayerDistance(30);
layout.setOrientation(1);  // I was unable to find correct property value to set, but I figured out that default(horizontal) is 0[zero] and vertical is 1[one]..
 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: setEnabledHandles and LayeredLayout @JavaApplet
Reply #3 - Apr 19th, 2012 at 5:23pm
Print Post  
Hi,

You can use ScriptHelper for finding the constants used as values of various properties:

layout.setOrientation(scriptHelper.getConstant(
    "com.mindfusion.diagramming.jlayout.Orientation", "Horizontal"));

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


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Re: setEnabledHandles and LayeredLayout @JavaApplet
Reply #4 - Apr 20th, 2012 at 5:24am
Print Post  
wow, how didn't I find this... this was really helpful!

Thank you and br. Henry
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint