Provides support for hiding some of the complexity of the VisAD package.
For the MetApps project, the most relevant top-level classes are probably {@link ucar.visad.display.DisplayAdapter}, {@link ucar.visad.display.MapAdapter}, and {@link ucar.visad.display.DataAdapter}. Here's a simple example of their use (bold text is more important):
import javax.swing.*;
import ucar.visad.display.*;
import visad.*;
public class MyTest
{
public static void main(String[] args)
{
private DisplayAdapter display =
new DisplayAdapter(new DisplayImplJ3D("MyTest"));
display.add(new XAxisScalarMap(xDataType, display));
display.add(new YAxisScalarMap(yDataType, display));
display.add(new ContourScalarMap(zDataType, display));
display.add(new ConstantMapAdapter(-1, Display.ZAxis));
DataReferenceImpl dataRef = new DataReferenceImpl("MyData");
dataRef.setData(new MyData());
display.add(
new DataAdapter(
display,
dataRef,
new RGBConstantMaps(Color.yellow)));
JFrame jframe = new JFrame("My Test");
jframe.getContentPane().add(display.getComponent());
jframe.pack();
jframe.setVisible(true);
}
}
...
The above example creates a {@link ucar.visad.display.DisplayAdapter}
from a VisAD {@link visad.DisplayImpl}. It then adds to the adapted display
the necessary {@link ucar.visad.display.ScalarMapAdapter}s and {@link
ucar.visad.display.ConstantMapAdapter} to have contour lines of the
data appear at Z = -1. The data is then added to the display with
a {@link ucar.visad.display.RGBConstantMaps} instance that
causes the contour lines to appear in yellow.