1 The javajs directory contains a variety of Java files that you are
2 encouraged to use in your project. It is self-contained, and the
3 classes and methods all work in Java as well as JavaScript.
5 These classes perform functions not standard in Java or provide
6 classes that are particularly optimized for JavaScript (fewer overloaded
9 -- creating (minimal) PDF files
10 -- decoding and encoding image files
11 -- working with binary, compound document, JSON, and zip data
12 -- providing very efficient classes for vectors, matricies, and quaternions
13 -- providing a java.lang.Thread subclass (JSThread) that can be used
14 wherever a thread is necessary; note that JSThread cannot sleep(), but
15 it provides a means of managing setTimeout callbacks that is very easy
17 -- providing two very important annotations:
19 @J2SIgnoreImport Indicates that this class will never be used in JavaScript
20 and thus does not need to be indicated as a dependency. In
21 some cases, this annotation is necessary just to break a
22 cyclical dependency that Java somehow handles, but J2S does not.
24 @J2SRequireImport Allows a SwingJS developer to work around J2S transpiler
25 issues that for some reason it is not indicating the need for
26 a dependent class. Typically this is because a static call
27 to a static method in a class.
29 In addition, though, @J2SRequireImport can be used to "inject"
30 JavaScript at a specific point in code loading. For example,
31 swingjs.plaf.JSSlider uses the following annotation to load
32 jQueryUI, fooling J2S to think that it is a "class" file.
34 @J2SRequireImport(swingjs.jquery.JQueryUI.class)
37 All files in the javajs/util directory will be moved to j2s/JU by a build script.