Skip navigation links

Package ucar.visad.display

Provides support for hiding some of the complexity of the VisAD package.

See: Description

Package ucar.visad.display Description

Provides support for hiding some of the complexity of the VisAD package.

For the MetApps project, the most relevant top-level classes are probably DisplayAdapter, MapAdapter, and 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 DisplayAdapter from a VisAD DisplayImpl. It then adds to the adapted display the necessary ScalarMapAdapters and ConstantMapAdapter to have contour lines of the data appear at Z = -1. The data is then added to the display with a RGBConstantMaps instance that causes the contour lines to appear in yellow.

Skip navigation links