The BZDev class library

The BZDev class library supports discrete-event simulation, graphs and plotting, mathematical functions and numerical algorithms, 2D animation, 3D printing, writing graphics to output streams, integration of scripting with applications, additional Swing components, etc. The library uses 'factory' classes for configuring simulations and animations. An annotation processor makes it relatively easy to create a factory class. The code is partitioned into several Java modules. The dependencies are shown in the following graph (click on the module names as a shortcut):

Dependencies
Module org.bzdev.servlets

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.

For a more detailed description of this library, please use the following links:

and the following books:

In addition, several applications were written using the BZDev class library. As they were written, classes that seemed to be useful for other applications and that were a good match for those already in the library were added to the library so they could be shared with other applications. These programs are

  • epts. This program is a graphics editor that creates and edits two types of objects: points and paths. It can also write a description of these objects to a file, using templates to specify the form of the output. Built-in templates can create
    • SVG files.
    • ECMAScript/JavaScript files or ESP files in a format usable by the simulations the BZDev class library provides.
    • HTML image maps (the image above uses an image map created with epts).
    • lists of path lengths or the areas of closed paths.
    User-supplied templates can be used as well. Coordinates of points can be in Java user-space units or in some other units, defined by setting a scale factor. For distances, the values are scaled to meters. When running the points and paths can be overlayed on a pre-existing image. In this case, the appropriate scaling can be determined by measuring a distance in Java user-space units and providing the corresponding distance in the application's units. The source code is available on GitHub.
  • geth. This program is a simple utility that issues HTTP requests and prints the headers in a response. It can also print the content if the content is text. The headers include all those in an exchange, including HTTP redirects. Headers can be set in requests as well, which is useful for analyzing web sites that base their responses on the browser or operating system in use. The source code is available on GitHub.
  • webnail. This program can scale images (one or more) to fit into a specified bounding box. For just scaling images, the output can be in a variety of formats: single images, a directory, or a zip file. In addition, webnail can create a web site in one of four format:
    • A web-site directory. The directory will contain an HTML file and several subdirectories containing images and two ECMAScript files, both used for navigation and to run slideshows.
    • A web-site ZIP file. The ZIP file created contains the same files and directory structure used in the first option (a web-site directory).
    • A directory for a web archive. This option creates a web-archive directory containing images, ECMAScript files for controlling a slideshow, and a servlet for cases in which multiple systems should show the same images at the same time.
    • A web-archive (WAR) file. This option creates a web-archive file (WAR file) containing images, ECMAScript files for controlling a slideshow, and a servlet for cases in which multiple systems should show the same images at the same time.
    Webnail allows the user to set various options for this case (for example, titles) and to reorder images and add a title to each that can be displayed when a mouse hovers over an image. Images can be added in various ways including simply dragging them from a folder. The source code is available on GitHub.
The source code for these programs and libraries can be used as extended coding examples. For use on Debian systems, the packages containing these programs should be in the same repository as the package libbzdev-java.
Modules
Module
Description
Module providing 2D animations.
Base module for the BZDev class library.
Module containing BZDev classes for graphs, geometry, graphics IO, and GUI support.
Module providing discrete-event simulations.
Module providing actor-based simulations.
Module providing an embedded Java-based web server.
Module containing BZDev classes for graphs, geometry, graphics IO, and GUI support.
Mathematics module
Module providing object naming.
Module providing 3D printing.
Module for encapsulating an instance of ServletAdapter in a servlet.