Module JavaApplet

module JavaApplet: sig .. end
Support for Java applets.

In order to produce a jar archive containing an applet, it is necessary to link the application with the -applet k command-line switch, where k designate the kind of applet (AWT-, Swing-, or Graphics-based). An applet class will be generated, with name pack.ocamljavaApplet where pack can be set using the -java-package p command-line switch.

When linking with the -applet k command-line switch, the last module to be linked has to abide to one of the module types of the JavaApplet module, the exact module type depending on the value of k.



Applet information

type parameter = {
   param_name :java'lang'String java_instance; (*parameter name.*)
   param_type :java'lang'String java_instance; (*parameter type.*)
   param_desc :java'lang'String java_instance; (*parameter description.*)
}
The type of parameters, describing parameters accepted by an applet.
type parameter_info 
The type of parameter info, as returned by the getParameterInfo() method.
val parameter_info_of_list : parameter list -> parameter_info
Converts a list of parameters into a parameter info, preserving the order of elements.

AWT-based applets

module type AWT = sig .. end
The module type for applets linked with -applet awt.

Swing-based applets

module type Swing = sig .. end
The module type for applets linked with -applet swing.

Graphics-based applets

type graphics_event = {
   mouse_x :int; (*X coordinate of the mouse.*)
   mouse_y :int; (*Y coordinate of the mouse.*)
   button :bool; (*true if a mouse button is pressed.*)
   keypressed :bool; (*true if a key has been pressed.*)
   key :char; (*the character for the key pressed.*)
}
Equivalent to Graphics.status, copied to avoid dependency.
module type Graphics = sig .. end
The module type for applets linked with -applet graphics.