Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Web (Read 9500 times)
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Web
Mar 15th, 2011 at 8:32am
Print Post  
Hello Sir

I want to use this for web Application ,I did't get Any example like I got for Java Swing..
So pls tell me how can i use this for web application.
I need same as i used it with swing, the only difference i need to run it on browser.
  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Re: Web
Reply #1 - Mar 15th, 2011 at 9:23am
Print Post  
Sorry I got the examples ,They are in Applet Demo Folder But my IDE(Eclipse does not support them) Its unable to run those examples..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #2 - Mar 15th, 2011 at 11:39am
Print Post  
Apart from the applet's jar, that folder contains only html files with some JavaScript inside. If you need to run the pages from the IDE, you will have to add them to some kind of web application that can serve html files. I don't know what project type you should choose in Eclipse for that, but I suppose one from the Web projects category (shown in the New Project window) should work.
  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Re: Web
Reply #3 - Mar 16th, 2011 at 9:06am
Print Post  
Sir,
  I tried and Add it to my Dynamic Project ,Except Diagram EveryThing is Visible(Button, Layout Options).
Is it some Plugins Problem?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #4 - Mar 16th, 2011 at 9:28am
Print Post  
Do you mean the diagram applet cannot load when you run the demo, or do you expect the applet to show in some html design window inside Eclipse?
  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Re: Web
Reply #5 - Mar 16th, 2011 at 12:12pm
Print Post  
Yeah,i m unable to load Applet or diagram in browser.
i need a code to draw a single node in Browser,Could u provide this to me?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #6 - Mar 17th, 2011 at 10:37am
Print Post  
Regarding loading the applet, check if jdiagram.jar is in the same folder as the html file and if your web server is configured to serve jar files.

You can use two methods to preload items in the diagram:

- create a Diagram instance on the server, create the diagram items, call saveToString, and then load the string on the client side using loadFromString.

- use the JDiagram API from JavaScript to create diagram items when the applet is loaded.

The first method is shown in the JspSample sample project, check the index.jsp file under its WebContent subfolder.

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: Web
Reply #7 - Apr 4th, 2011 at 7:23am
Print Post  
Thanks Stoyo....
  i m using javascript to create diagram...
But i m unable to change its behaviour and link style

var beh=applet.getScriptHelper().setBehavior(Behavior.pan);

and when i m setting behaviour its occurring error..
And one more thing i want to set the behaviour of diagram not a particular shape.


And when i m setting layout

treeLayout = applet.getScriptHelper().createTreeLayout();
treeLayout.setType(TreeLayoutType.Centered);
its also not running.
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #8 - Apr 4th, 2011 at 9:00am
Print Post  
Behavior is property of DiagramView, so you should call applet.getDiagramView().setBehavior(). Also you can't access the enum constants like that. You can either use their numeric values, or load this .js file from our ASP.NET control to get the constant definitions -

https://mindfusion.eu/_samples/NetdiagScripts.zip

Feel free to edit it to shorten the 'namespace' object name.

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


I love YaBB 1G - SP1!

Posts: 1
Joined: Apr 7th, 2011
Re: Web
Reply #9 - Apr 7th, 2011 at 6:23pm
Print Post  
Is there an advantage to one option or the other (building the diagram on the server and streaming to the browser vs building it in the browser using javascript)? Performance implications? User interraction limitations? API limitations?

I am building a web app which will visually represent system relationships, which meta-data is all stored in an Oracle DB. So I will have a data access layer that will read from DB and building on the server makes sense. But I also need to have access in the browser to handle user interaction. The diagram will be static (i.e. user can't modify the diagram) but they should be able to click for more info or links or resize/reposition/etc.

We'd also like it to be visible in all browsers and mobile devices. Does JDiagrams make this possible?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #10 - Apr 7th, 2011 at 6:53pm
Print Post  
Quote:
Is there an advantage to one option or the other (building the diagram on the server and streaming to the browser vs building it in the browser using javascript)? Performance implications?


I suppose building it on the client will be much less taxing to your server. You can embed in the page only the data you need (e.g. as a string array, XML or JSON) and then parse it on the client and create the corresponding diagram elements. Otherwise on each GET request the server would have to load a bunch of Java Graphics and Swing classes instantiated with a Diagram that would not be used.

Quote:
API limitations?


You'd have to do a lot of calls to the ScriptHelper class if you build the diagram from JavaScript, and it might still not cover all APIs (we are adding them on demand). You could instead create your own applet that wraps a DiagramView and implement service calls, data parsing, etc in Java.

Quote:
We'd also like it to be visible in all browsers and mobile devices. Does JDiagrams make this possible?


You cannot use Java applets on smartphones AFAIK. For them you could export the diagram as a bitmap image on the server and build a corresponding HTML image map (using the HtmlBuilder class) whose AREAs will let you detect clicks on the nodes.

If you are not tied to Java on the server side, check our ASP.NET MVC / HTML5 Canvas based control -
http://mindfusion.eu/Forum/YaBB.pl?board=mvcdg_disc;action=display;num=130210032...

The HTML5 canvas element should work at least on iOS and Android.

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: Web
Reply #11 - Apr 8th, 2011 at 8:15am
Print Post  
Thanks ...
I m able to get behaviour..
BUt there is no function for
.setType(TreeLayoutType.Radial);
and
.setLinkStyle(TreeLayoutLinkType.Rounded);

And i tried to find files but ubanle to find out them

So how can i get these functions
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #12 - Apr 8th, 2011 at 10:04am
Print Post  
Hi, add this to the js ile:

Code
Select All
MindFusion.Diagramming.TreeLayoutLinkType =
{
	Straight:	 0,
	Cascading2: 1
	Cascading3: 2
	Rounded:	3
} 

  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Web
Reply #13 - Apr 9th, 2011 at 6:45am
Print Post  
Sorry Sir

  BUt  i added this code in my js file

and tyr this var ty=applet.getDiagramView().TreeLayoutLinkType(3);
or
ty=applet.getDiagramView().TreeLayoutLinkType(3);

or
treeLayout.setLinkStyle(applet.getDiagramView().TreeLayoutLinkType(2));
or
treeLayout.setLinkStyle(applet.getDiagramView().setTreeLayoutLinkType(2));

but its unable to acess this link style...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Web
Reply #14 - Apr 11th, 2011 at 6:23am
Print Post  
It should look like this:

Code
Select All
function layoutTree(applet)
{
	var diag = applet.getDiagramView().getDiagram();
	var tl = applet.getScriptHelper().createTreeLayout();
	tl.setTreeLayoutLinkType(3);
	// tl.setTreeLayoutLinkType(MindFusion.Diagramming.TreeLayoutLinkType.Rounded);
	tl.arrange(diag);
} 

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