Closed dartrax closed 1 year ago
This applet unfortunately triggers multiple bugs and at this stage we are completely focused on a new architecture for CheerpJ (CheerpJ 3.0, see our announcement here: https://leaningtech.com/announcing-cheerpj-3-0-a-jvm-replacement-in-html5-and-webassembly-to-run-java-applications-and-applets-on-modern-browsers/)
CheerpJ 3.0 will structurally solve this sorts of bugs, but in the meantime we can suggest a workaround HTML that should work. Compared to the original HTML there are a few modifications:
mindmap.html_files/
in front of all JAR files, this was a mistake in the original HTML./
from JAR paths, as they confuse the CheerpJ loader<script>
tags, you will not need to use the extension<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
<style type="text/css">
/**/
body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; height:100% }
html { height:100% }
/**/
</style>
<script src="https://cjrtnc.leaningtech.com/20230517/loader.js"></script>
<script>cheerpjInit()</script>
</head>
<body>
<applet code="org.freeplane.main.applet.FreeplaneApplet.class" archive="mindmap.html_files/freeplaneviewer.jar,mindmap.html_files/freeplaneapi_viewer.jar,mindmap.html_files/kitfox-svg-salamander-1.1.1-p1.jar" width="100%" height="100%">
<param name="browsemode_initial_map" value="./mindmap.html_files/map.mm">
<param name="selection_method" value="selection_method_direct">
<param name="codebase_lookup" value="false">
<script>document.write("<param name='location_href' value='" + window.location.href +"'/>");</script><param name="location_href" value="https://www.dartrax.de/other/freeplane/mindmap.html">
</applet>
</body>
</html>
Hope this helps, I will keep this issue open as a test case for the future release of a CheerpJ 3.0 Applet Runner
Thank you for your fast reply! It's a benefit that the extension is not needed in this case. I've uploaded your HTML to this URL: https://www.dartrax.de/other/freeplane/mindmap2.html
The User interface loads, but the Mindmap ./mindmap.html_files/map2.mm is not loaded.
When I look at the console, there seem to be some .jar.js files generated that contain HTML from the homepage. This doesn't look right, but I don't know if that has something to do with it...
Are you sure this applet works with native Java? From my tests, both native Java and CheerpJ cannot load the map because some class is missing, in particular: org/freeplane/api/ChildNodesAlignment
. This class is not available in any of the 3 JAR files which are used.
I should have checked that first. I also don't get it to work native so I created a bug report in the freeplane project, let's see what happens.
The applet works now with native java, i've uploaded it here: https://www.dartrax.de/other/freeplane/map.html However, I did not succeed in modifying map.html in such a way that it works with cheerpj like you've done before, not even the UI loads. You'll find my try here: https://www.dartrax.de/other/freeplane/map_cheerpj.html May be you can have a look at it once again?
This seem to work for me:
Now even with loading the mindmap. Thanks, it must have been a caching problem.
Do you see a possibility to reduce loading time? Probably wait for the new v3.0 I guess? ;-)
Yes, CheerpJ 3.0 is being engineered from scratch to improve loading time. For CheerpJ 2.x you could get better result by AOT compiling the jar to jar.js files.
Please see instructions here: https://docs.leaningtech.com/cheerpj/Getting-Started
Great! That reduced loading time from 35s down to 14s! I've just compiled the three jar files to jar.js and added them to the directory with the jar files. It was easy, the documentation is easy to follow!
Glad to hear the docs were helpful. If you need further help, please consider joining our discord: https://discord.gg/CHeATR6E9k
I try to use Cheerpj to view Mindmaps generated from Freeplane. Freeplane allows to export as Java Applet. But it never finishes loading.
I've uploaded an example here: https://www.dartrax.de/other/freeplane/mindmap.html
I hope the issue will be found and fixed :-)