//---------------------------------------------------------------------------//
// $Id$
//
// This file implements the core Java side of the Java->PLplot interface, by
// providing a Java class PLStream, which is intended to mirror the C
// PLStream of PLplot.  However, we go further here in Java than we were able
// to do in C, by actually making the PLplot API entry points methods of this
// stream class.  Thus, to plot to a stream in Java, you just instantiate the
// stream, and invoke PLplot API services upon it.  This is basically what we
// have tried to do in the bindings to other object oriented environments,
// such as C++ and the Tcl/Tk and Python/Tk widget contexts.  A stream
// represents sort of a "drawable" abstraction, and the PLplot API gets the
// drawing done on the identified stream.  In C you have to swtich the stream
// explicitly with the plsstrm function, but in Java you just invoke the API
// function on the approrpiate stream object.
//---------------------------------------------------------------------------//

package plplot.core;

public class PLStream {

// The PLplot core API function calls.
    public native void adv( int page );
    public native void box( String xopt, float xtick, int nxsub,
                            String yopt, float ytick, int nysub );
    public native void box3(
        String xopt, String xlabel, float xtick, int nsubx,
        String yopt, String ylabel, float ytick, int nsuby,
        String zopt, String zlabel, float ztick, int nsubz );
    public native void col0( int icol );
    public native void end();
    public native void env( float xmin, float xmax, float ymin, float ymax,
                            int just, int axis );
    public native void fontld( int fnt );
    public native void init();
    public native void lab( String xlabel, String ylabel, String tlabel );
    public native void line( int n, float[] x, float[] y );
    public native void poin( int n, float[] x, float[] y, int code );
    public native void styl( int nms, int mark, int space );
    public native void syax( int digmax, int digits );
    public native void vsta();
    public native void wind( float xmin, float xmax, float ymin, float ymax );

// Static code block to get the PLplot dynamic library loaded in.
    static {
        System.loadLibrary( "plplot" );
    }

// Now comes stuff we need done in Java.
    public PLStream() {}

    public void xyz() { System.out.println( "In xyz()" ); }
}

//---------------------------------------------------------------------------//
//                              End of PLStream.java
//---------------------------------------------------------------------------//


@@ -1777,20 +1777,199 @@
 ive 
-void init();
+int gstrm();%0A    public native void init();%0A%0A    public native void join( float x1, float y1, float x2, float y2 );%0A    public native void join( double x1, double y1, double x2, double y2 );%0A
 %0A   
@@ -2523,16 +2523,51 @@
 %0A    %7D%0A%0A
+// Class data.%0A    int stream_id;%0A%0A
 // Now c
@@ -2640,53 +2640,46 @@
 lic 
-void xyz() %7B System.out.println( %22In xyz()%22 )
+int get_stream_id() %7B return stream_id
 ; %7D%0A

Add some more native method decls, and introduce a member variable for holding the stream id, so that we can ensure that plotting actions go to the propper stream.