Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Layout problem (Read 2806 times)
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Layout problem
Jul 6th, 2011 at 10:48am
Print Post  
Hi stoyo,
I used JDiagram in swing ,but it seems tough to implement same with java swing.

I used a layout in swing ,
TreeLayout tl = new TreeLayout();

tl.setRoot(null);
tl.setType(TreeLayoutType.Radial);
tl.setLevelDistance(100);
tl.setLinkStyle(TreeLayoutLinkType.Rounded);
tl.arrange(diag);

but unable to use same in java script.

Is there any other way to implement in web applications.....like i see the jspSample example in doc..i need some more example if i use scriplet to use the same code as i used in java swing in web..

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout problem
Reply #1 - Jul 6th, 2011 at 10:59am
Print Post  
Hi Amit,

Call DiagramApplet.getScriptHelper().createTreeLayout() to create a TreeLayout instance from JavaScript.

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


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Re: Layout problem
Reply #2 - Jul 8th, 2011 at 12:06pm
Print Post  
I did this....I asked  it onve in past...
U told me Add MindFusion.Diagramming.TreeLayoutLinkType =
{
Straight: 0,
Cascading2: 1
Cascading3: 2
Rounded:3
}

in .js file and call

and call
var diag = applet.getDiagramView().getDiagram();
var tl = applet.getScriptHelper().createTreeLayout();
tl.setTreeLayoutLinkType(3);
// tl.setTreeLayoutLinkType(MindFusion.Diagramming.TreeLayoutLinkType.Round ed);
tl.arrange(diag);


but i m unable to get the layout..
and i need TreeLayoutTye.radial too..
I need exact same layout i m getting from java swing code mentioned above..
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout problem
Reply #3 - Jul 8th, 2011 at 2:39pm
Print Post  
TreeLayoutType.Radial equals to 2. You can also get such constant values by calling the getConstant method of ScriptHelper, e.g. helper.getConstant("TreeLayoutType", "Radial");
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint