VisIt’s Java API allows Java applications to control VisIt’s viewer. Java applications can launch VisIt’s viewer window and control it programmatically, even replacing VisIt’s GUI with a custom Java GUI.
The Java client for a particular version of VisIt is available as separate tarball on our downloads page.
Simply untar to the directory of your choosing to use it.
Building from source¶
To build the java client from a source build of VisIt, you must set the
VISIT_JAVA CMake bool variable to
true when configuring VisIt with CMake.
Once the CMake configure step is complete, cd to the java subdirectory of the build directory and type
This will compile the core parts of the Java interface.
There are two other targets that can be built from the java directory:
main target will build the class files for all the examples.
pack target causes a JAR file to be created and then packaged up with the Java source code, docs and example programs into a TAR file that can be shared.
visit.jar file will be present in the build directory.
pack target will also build the example class files if not already built.
What follows are examples of how VisIt’s Java client can be used.
Source code for each example is available in the
java subdirectory of the source code repository.
There are several arguments that are common to all the examples:
- tells the program to continue running after the work() method has completed instead of exiting.
- path to VisIt’s bin directory, eg,
- path to VisIt’s silo example data (used by many of the examples)
- Tells the example application that it will be connecting to a development version of VisIt. This is important because an installed version of VisIt is structured slightly differently than a build.
All of the examples are available from the
- Basic example
- Controlling lighting
- Performing queries
- Getting metadata
- Controlling annotations
- Making host profiles
- Opening the visIt GUI from Java
- Determining which variables can be plotted
- Executing Python from Java
- Plotting vectors from Java
- Changing plot attributes
- Changing points size and shape
- Using Threshold operator
This document is primarily based on visitusers.org wiki pages written by Brad Whitlock. The Java client itself and most of the examples were also initially created by Brad in 2002.