简体   繁体   中英

What functionality is the java code responsible for within the GraphEditor in the mxgraph example for javascript?

I am studying the grapheditor example under mxgraph's javascript https://github.com/jgraph/mxgraph/tree/master/javascript/examples/grapheditor

However, I notice there are two parts. There's a javascript/HTML portion in the www folder. And there's a java portion.

I am a bit rusty from my Java, so I cannot be sure what the Java code is responsible for.

Does the Javascript and HTML portion be totally responsible for the UI/UX display of the GraphEditor example?

Meaning to say things like displaying the action menu and drag and drop etc are handled by the javascript and html portion?

So what's the Java code responsible for exactly?

The front-end part is only client-side JavaScript and HTML. The Java back-end is partly historic for older browsers that couldn't do things like open/save locally without echoing the file via a server.

There's also export functionality on the server. A long time ago browsers couldn't generate raster images (like PNG) locally, so the server had to do it. Now IE 11 is the only supported browser that cannot do this.

There's also PDF export, no browser can currently do this, so that's always generated on the server. See https://github.com/jgraph/mxgraph/blob/master/javascript/examples/grapheditor/java/src/com/mxgraph/examples/web/GraphEditor.java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM