JWAVE

Java™ Graphic Components


The WaveGraph class

The WaveGraph "superclass" is an abstract class in the IFC which handles most of the work for creating visualization in a java applet or application. It is subclassed or derived from to create classes which can create actual graphics and visualizations by communicating with a PV-WAVE based graphic server. Some of the tasks it performs include:

Graphic classes derived from WaveGraph

The following classes have been derived from WaveGraph to create special plot types:

Example Code Fragment

The following code fragment shows how easy it is to incorporate a plot into your interface.

   //
   // Initialize the WavePlot component with a position, size, and
   // URL for the server to be used to process the graphic requests.
   //
   plot = new WavePlot( 25, 30, 400, 300 );
   plot.setServer( "http://vrml.boulder.vni.com" );
   mainRootView().addSubview( plot );

   //
   // Create some dummy random data and associate it with the plot
   //
   double[] data = new double[100];
   for(int i =0; i<100; i++) data[i]=Math.random();
   plot.setY( data );

   //
   // Set some attributes for the plot
   //
   plot.setRegion( .01, .05, .95, .95 );
   plot.setYRange( 0, 1.25);
   plot.setYStyle( 1 );
   plot.setTitle( "Test Plot" );
   plot.setSubtitle( "Random Data" );
   plot.setXTitle( "X Axes" );
   plot.setYTitle( "Y Axes" );
   plot.setColor( "cyan" );

   //
   // Draw the plot
   //
   plot.plot();

JWAVE Home Page
Copyright © 1996 - Visual Numerics, Inc.®