The BZDev Class Library

The BZDev class library is partitioned into 8 modules as shown in the following diagram (also shown on the OVERVIEW page):

3D Printing Module Actor-Based Simulation Module Animation Module Discrete Event Simulation Module Desktop (GUI) Module Object Naming Module Graphics Module Math Module Embedded Web Server Module Base Module Servlets Module

All of these modules are dependent on the module org.bzdev.base, but only some dependencies are shown explicitly to reduce clutter: just enough so that the diagram will show at least an indirect dependency. Two modules, org.bzdev.dmethods and org.bzdev.parmproc, are not shown as these are used only for annotation processing.

The module org.bzdev.base

The module org.bzdev.base provides basic operations. The following diagram shows the packages this module contains:

Base Module Java Lang Extension Package IO Package Scripting Support Package Utility Package Units Package Dynamic Method Annotations Package Networking Package Protocols Package Factory Annotations Package

The packages in this module provide the following:

The module org.bzdev.math

The module org.bzdev.math provides special functions, various numerical algorithms, random variables, and statistics. The following diagram shows the packages this module contains:

Math Module Math Package Math SPI Package Random Variable Package Statistics Package

The packages in this module provide the following:

The module org.bzdev.graphics

The module org.bzdev.graphics provides graphs and IO operatios involving geometry, graphics-based IO operations, graphs, and packages that support factory classes for simulations, animations, etc. The following diagram shows the packages this module contains:

Graphics Module Geometry Package Graphics IO Package Image-IO Operations Package Graphs Package Graphics IO SPI Package Named Object Factory Support Package Graphs SPI Package

The packages in this module provide the following:

The module org.bzdev.desktop

The module org.bzdev.base provides graphics and desktop operations. The following diagram shows the packages this module contains:

Desktop Module GUI Components Package Proxy-Configuration GUI Component IO-related Swing Support Package Name-to-Virtual-Key Package Document-related Swing-Support Module

The packages in this module provide the following:

The module org.bzdev.devqsim

The module org.bzdev.devqsim provides discrete event and queuing simulation. The folloowing diagram shows the packages this module contains:
Discrete Event Simulation Module Named Random Variable Package Discrete Event Simulation Package

The package

The module org.bzdev.drama

The module org.bzdev.drama provides discrete event simulations using a message-passing paradigm. The following diagram shows the packages this module contains:
Actor-Based Simulation Module Actor-Based Simulation Shared-Class Package Generic Actor-Based Simulation Package Drama Simulation Package

The package

The module org.bzdev.ejws

The module org.bzdev.base provides an embedded web server based on the Java package com.sun.net.httpserver that is part of the standard Java release. The following diagram shows the packages this module contains:

Embedded Web Server Module Embedded Web Server Pacakge EJWS URL-Mapping Package

These packages are described below:

The module org.bzdev.servlets

The module org.bzdev.servlets contains a single package that contains a single class, each of whose subclasses will use an instance of {@link org.bzdev.net.ServletAdapter} to implement a servlet. Unlike the other modules, compiling this module requires an external library (in this case the servlet API) on the class path. The following diagram contains this module and its package:

Servlets Module Servlets Package

The current name for the servlet-API module is servlet.api although that may change.

The remaining modules

The remaining modules, like the org.bzdev.servlets module, are ones with one package (sometimes a substantial package) per module. The following diagram shows these modules and their packages:

2D Animation Module Object Naming Module 3D Printing Module 2D Animation Package Object Naming Package 3D Printing Package

Compilation

The following instructions are appropriate for Debian Linux and other distributions that put libraries in the same locations. The procedure depends on whether Java modules are used or not.

To compile without modules and without annotation processors, assuming the compiled classes will be put in the directory classes


      javac -d classes -classpath /usr/share/java/libbzdev.jar \
             JAVA_FILE...
To compile without modules and with annotation processors, add a directory tmpsrc to hold the generated source-code files:

      javac -d classes -classpath /usr/share/java/libbzdev.jar \
             -s tmpsrc JAVA_FILE...
In both cases JAVA_FILE should be a path whose components reflect the package hierarchy. For example, the class com.foo.pkg.Foo will be in the file com/foo/pkg/Foo.java.

To compile with modules and without annotations, the source file should be in subdirectories of a directory traditionally named src. These subdirectories should have names matching a module name (for example, com.foo.mod). The compiled code goes into similar subdirectories of a directory named mods:


      javac -d mods/com.foo.mod -p /usr/share/bzdev JAVA_FILE...
In this example, src/com.foo.mod must contain a file named module-info.java:

      module com.foo.mod {
        ....
      }
In addition, a Java source file for the class com.foo.pkg.Foo.java in the module com.foo.mod must be in the directory src/com.foo.mod/com/foo/pkg/Foo.java, with all modules and packages being compiled following this pattern.

To compile with modules and with annotation, the javac command above should be changed to


      javac -d mods/com.foo.mod -p /usr/share/bzdev \
          -s tmpsrc/com.foo.mod \
          --processor-module-path /usr/share/bzdev \
          src/com.foo.mod/module-info.java JAVA_FILE...

When javadoc is used to generate API documentation, the command for the previous example without modules when annotation processing is not used is:


      javadoc -d APIDIR -sourcepath . \
          -classpath classes JAVA_FILE...
When annotation processing is used, this command becomes

      javadoc -d APIDIR -sourcpath .:tmpsrc \
          -classpath classes JAVA_FILE...
where APIDIR is the directory that will contain the API documentation. Similarly, when modules are used without annotation processing, the javadoc command is

      javadoc -d APIDIR --module-path JARDIR \
          --add-modules com.foo.mod \
          --module com.foo.mod JAVA_FILE...
where JARDIR is a directory that contains the JAR files for the modules. When annotations are used, this becomes

      javadoc -d APIDIR --module-path JARDIR \
          --module-source-path src:tmpsrc \
          --add-modules com.foo.mod \
          --module com.foo.mod JAVA_FILE...

There is a minor detail to watch: the options --module-path, module-source-path, and --add-modules allow multiple objects to be listed, separated by a colon. The --module option requires that the module names be separated by a comma.

Finally, when named object factories are used, the factories can describe their parameters. The program lsnof can generate documentation describing a factory's parameters. When modules are not used the command is


      lsnof -d APIDIR --classpathCodebase JARFILE CLASSNAME...
and when modules are used, the command is

      lsnof -d APIDIR --module-path JARDIR CLASSNAME...
While fully-qualified class names can be provided explicitly, lsnof also supports a wildcard syntax described in the lsnof man page and elsewhere. In both cases, the documentation will appear in a subdirectory of APIDIR named factories-api (the hyphen is used to prevent collisions with Java package names). If a factory's fully qualified class name is org.foo.pkg.Factory, one can place the parameter documentation in an IFRAME by using an IFRAME whose source attribute is

   SRC="{@docRoot}/factories-api/org/foo.pkg/Factory.html"
The javadoc program will replace {@docRoot} with the API directory (APIDIR in this example).

Dark mode

A reverse-video mode is available for the API documentation. To duplicate it, go to a javadoc-generated API directory and replace the stylesheet (the default is stylesheet.css) with one of two files from the libbzdev api directory:

Javadoc for versions 11 and 17 use different style sheets and the selectors for Javadoc 17 are different than those used for Javadoc 11, regardless of the release for which the documentation is being generated. When javadoc is run, the option --main-stylesheet will replace the default style sheet with a user specified on. In the API directory, the file name for this style sheet may match the one specified on the command line, but the default seems to be stylesheet.css.

Libraries

The JAR files for the libbzdev modules should be available in a single directory. On Debian Linux systems, unless modified by a package maintainer, the files are in /usr/share/java. Typically an application will set up symbolic links to these files (there are some files in /usr/share/java that interact pooly with Java modules, making it problematic to put /usr/share/java on a module path). The JAR files for the lsnof and scrunner commands are located in /usr/share/bzdev and when these are installed (the Debian package is libbzdev-util), symbolic links to /usr/share/java from /usr/share/bzdev will be set up as well.

Normally, just setting the module path to include /usr/share/bzdev is sufficient. However, if an application has to run on a device with tight memory/storage constraints, or if jlink is used to create a custom JVM for a specific application, it may be desirable to include a subset of these Jar files. The following table lists the JAR file for each module with the dependencies on other libbzdev modules.

Modules and their JAR files
ModuleJAR File and Dependencies
org.bzdevlibbzdev.jar
(special case that includes other modules but does not provide any code)
org.bzdev.animd2dlibbzdev-anim2d.jar
org.bzdev.base, org.bzdev.devqsim, org.bzdev.graphics, org.bzdev.math, org.bzdev.obnaming
org.bzdev.baselibbzdev-base.jar
(no dependencies on org.bzdev packages)
org.bzdev.desktoplibbzdev-desktop.jar
org.bzdev.base, org.bzdeb.graphics
org.bzdev.devqsimlibbzdev-devqsim.jar
org.bzdev.base, org.bzdev.math, org.bzdev.obnaming
org.bzdev.dmethodslibbzdev-dmethods.jar
org.bzdev.base (used for annotation processing)
org.bzdev.ejwslibbzdev-ejws.jar
org.bzdev.base
org.bzdev.graphicslibbzdev-graphics.jar
org.bzdev.base, org.bzdev.math, org.bzdev.obnaming
org.bzdev.mathlibbzdev-math.jar
org.bzdev.base
org.bzdev.obnaminglibbzdev-obnaming.jar
org.bzdev.base, org.bzdev.math
org.bzdev.p3dlibbzdev-p3d.jar
org.bzdev.anim2d, org.bzdev.base, org.bzdev.devqsim, org.bzdev.graphics, org.bzdev.math, org.bzdev.obnaming
org.bzdev.parmproclibbzdev-parmproc.jar
org.bzdev.base (used for annotation processing)
Modules and Jar files for Commands
org.bzdev.lsnoflibbzdev-lsnof.jar
org.bzdev.base, org.bzdev.obnaming
org.bzdev.scrunnerlibbzdev-scrunner.jar
org.bzdev.base, org.bzdev.math, org.bzdev.obnaming