1
1
//---------------------------------------------------------------------------//
2
// $Id: PLStream.java,v 1.25 2002/10/14 17:40:57 jcard Exp $
4
// This file implements the core Java side of the Java->PLplot interface, by
5
// providing a Java class PLStream, which is intended to mirror the C
6
// PLStream of PLplot. However, we go further here in Java than we were able
7
// to do in C, by actually making the PLplot API entry points methods of this
8
// stream class. Thus, to plot to a stream in Java, you just instantiate the
9
// stream, and invoke PLplot API services upon it. This is basically what we
10
// have tried to do in the bindings to other object oriented environments,
11
// such as C++ and the Tcl/Tk and Python/Tk widget contexts. A stream
12
// represents sort of a "drawable" abstraction, and the PLplot API gets the
13
// drawing done on the identified stream. In C you have to swtich the stream
14
// explicitly with the plsstrm function, but in Java you just invoke the API
15
// function on the approrpiate stream object.
16
//---------------------------------------------------------------------------//
3
// Copyright (C) 2004 Andrew Ross
5
// This file is part of PLplot.
7
// PLplot is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Library Public License as published
9
// by the Free Software Foundation; either version 2 of the License, or
10
// (at your option) any later version.
12
// PLplot is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU Library General Public License for more details.
17
// You should have received a copy of the GNU Library General Public License
18
// along with PLplot; if not, write to the Free Software
19
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
// This class provides a more object orientated wrapper to the PLplot library
22
// for java. It is currently very similar to the C++ plstream class.
23
// Each instance of the class corresponds to a plplot stream. Calling a
24
// method in the class will ensure the stream is correctly set before
25
// calling the underlying API function.
18
28
package plplot.core;
20
public class PLStream {
22
// Arg parsing support.
23
public final int PL_PARSE_PARTIAL = 0x0000;
24
public final int PL_PARSE_FULL = 0x0001;
25
public final int PL_PARSE_QUIET = 0x0002;
26
public final int PL_PARSE_NODELETE = 0x0004;
28
public final int PL_PARSE_SHOWALL = 0x0008;
29
public final int PL_PARSE_OVERRIDE = 0x0010;
30
public final int PL_PARSE_NOPROGRAM = 0x0020;
31
public final int PL_PARSE_NODASH = 0x0040;
32
public final int PL_PARSE_SKIP = 0x0080;
34
public native void ClearOpts();
35
public native void ResetOpts();
36
// public native int MergeOpts(...);
37
public native void SetUsage( String program_string, String usage_string );
38
// setopt()/SetOpt() ???
39
public native int ParseOpts( String[] argv, int mode );
40
public native void OptUsage();
42
// The PLplot core API function calls.
43
public native void adv( int page );
45
public native void arrows( float[] u, float[] v, float[] x, float[] y,
46
int n, float scale, float dx, float dy );
47
public native void arrows( double[] u, double[] v, double[] x, double[] y,
48
int n, double scale, double dx, double dy );
50
public native void axes( float x0, float y0,
51
String xopt, float xtick, int nxsub,
52
String yopt, float ytick, int nysub );
53
public native void axes( double x0, double y0,
54
String xopt, double xtick, int nxsub,
55
String yopt, double ytick, int nysub );
57
public native void bin( int nbin, float[] x, float[] y, int center );
58
public native void bin( int nbin, double[] x, double[] y, int center );
60
public native void bop();
62
public native void box( String xopt, float xtick, int nxsub,
63
String yopt, float ytick, int nysub );
64
public native void box( String xopt, double xtick, int nxsub,
65
String yopt, double ytick, int nysub );
67
public native void box3(
68
String xopt, String xlabel, float xtick, int nsubx,
69
String yopt, String ylabel, float ytick, int nsuby,
70
String zopt, String zlabel, float ztick, int nsubz );
71
public native void box3(
72
String xopt, String xlabel, double xtick, int nsubx,
73
String yopt, String ylabel, double ytick, int nsuby,
74
String zopt, String zlabel, double ztick, int nsubz );
76
public native void col0( int icol );
78
public native void col1( float col1 );
79
public native void col1( double col1 );
83
public native void cont( float[][] z, float[] clevel, float[] xg, float[] yg, int wrap );
84
public native void cont( double[][] z, double[] clevel, double[] xg, double[] yg, int wrap );
87
public native void cont( float[][] z, float[] clevel, float[][] xg, float[][] yg, int wrap );
88
public native void cont( double[][] z, double[] clevel, double[][] xg, double[][] yg, int wrap );
95
public native void end();
99
public native void env( float xmin, float xmax, float ymin, float ymax,
100
int just, int axis );
101
public native void env( double xmin, double xmax, double ymin, double ymax,
102
int just, int axis );
104
public native void eop();
106
public native void errx( int n, float[] xmin, float[] xmax, float[] y );
107
public native void errx( int n, double[] xmin, double[] xmax, double[] y );
109
public native void erry( int n, float[] x, float[] ymin, float[] ymax );
110
public native void erry( int n, double[] x, double[] ymin, double[] ymax );
112
public native void famadv();
114
public native void fill( int n, float[] x, float[] y );
115
public native void fill( int n, double[] x, double[] y );
117
public native void fill3( int n, float[] x, float[] y, float[] z );
118
public native void fill3( int n, double[] x, double[] y, float[] z );
120
public native void flush();
121
public native void font( int fnt );
122
public native void fontld( int fnt );
139
public native int gstrm();
146
public native void hist( int n, float[] data, float datmin, float datmax,
147
int nbin, int oldwin );
148
public native void hist( int n, double[] data, double datmin, double datmax,
149
int nbin, int oldwin );
151
public native void init();
153
public native void join( float x1, float y1, float x2, float y2 );
154
public native void join( double x1, double y1, double x2, double y2 );
156
public native void lab( String xlabel, String ylabel, String tlabel );
158
public native void lightsource( float x, float y, float z );
159
public native void lightsource( double x, double y, double z );
161
public native void line( int n, float[] x, float[] y );
162
public native void line( int n, double[] x, double[] y );
164
public native void line3( int n, float[] x, float[] y, float[] z );
165
public native void line3( int n, double[] x, double[] y, double[] z );
167
public native void lsty( int lin );
172
public final int DRAW_LINEX = 0x01; // draw lines parallel to the X axis
173
public final int DRAW_LINEY = 0x02; // draw lines parallel to the Y axis
174
public final int DRAW_LINEXY = DRAW_LINEX | DRAW_LINEY; // draw lines parallel to both the X and Y axis
175
public final int MAG_COLOR = 0x04; // draw the mesh with a color dependent of the magnitude
177
public native void mesh( float[] x, float[] y, float[][] z, int opt );
178
public native void mesh( double[] x, double[] y, double[][] z, int opt );
182
public native void mtex( String side,
183
float disp, float pos, float just,
185
public native void mtex( String side,
186
double disp, double pos, double just,
189
// see the meaning of "opt" in mesh() above
191
public native void plot3d( float[] x, float[] y, float[][] z,
193
public native void plot3d( double[] x, double[] y, double[][] z,
197
public final int SURF_CONT = 0x10; // draw contour plot at surface
198
public final int BASE_CONT = 0x20; // draw contour plot at xy plane
199
public final int DRAW_SIDES = 0x40; // draw sides
200
public final int FACETED = 0x80; // draw outline for each square that makes up the surface
201
// also MAG_COLOR, defined above // draw the mesh with a color dependent of the magnitude
203
public native void surf3d( float[] x, float[] y, float[][] z, int opt, float clev[] );
204
public native void surf3d( double[] x, double[] y, double[][] z, int opt, double clev[] );
208
public native void poin( int n, float[] x, float[] y, int code );
209
public native void poin( int n, double[] x, double[] y, int code );
210
public native void poin( float x, float y, int code ); // API addition
211
public native void poin( double x, double y, int code ); // API addition
217
public native void psty( int patt );
219
public native void ptex( float x, float y, float dx, float dy,
220
float just, String text );
221
public native void ptex( double x, double y, double dx, double dy,
222
double just, String text );
228
public native void schr( float def, float scale );
229
public native void schr( double def, double scale );
231
public native void scmap0n( int ncol0 );
232
public native void scmap1n( int ncol1 );
233
public native void scmap0( int[] r, int[] g, int[] b, int ncol0 );
234
public native void scmap1( int[] r, int[] g, int[] b, int ncol1 );
235
public native void scmap1l( int itype, int npts, float[] i, float[] c1,
236
float[] c2, float[] c3, int[] rev );
237
public native void scmap1l( int itype, int npts, double[] i, double[] c1,
238
double[] c2, double[] c3, int[] rev );
239
public native void scol0( int icol0, int r, int g, int b );
240
public native void scolbg( int r, int g, int b );
241
public native void scolor( int color );
242
public native void scompression( int compression );
244
// /* Set the device (keyword) name */
247
// c_plsdev(const char *devname);
249
// /* Set window into device space using margin, aspect ratio, and */
250
// /* justification */
253
// c_plsdidev(PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy);
255
// /* Set up transformation from metafile coordinates. */
258
// c_plsdimap(PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax,
259
// PLFLT dimxpmm, PLFLT dimypmm);
261
// /* Set plot orientation, specifying rotation in units of pi/2. */
264
// c_plsdiori(PLFLT rot);
266
// /* Set window into plot space */
269
// c_plsdiplt(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax);
271
// /* Set window into plot space incrementally (zoom) */
274
// c_plsdiplz(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax);
276
// /* Set the escape character for text strings. */
279
// c_plsesc(char esc);
281
public native void setcontlabelparam( float offset, float size, float spacing, int active );
282
public native void setcontlabelparam( double offset, double size, double spacing, int active );
284
public native void setcontlabelformat( int lexp, int sigdig );
286
// /* Set family file parameters */
289
// c_plsfam(PLINT fam, PLINT num, PLINT bmax);
291
// /* Set the output file name. */
294
// c_plsfnam(const char *fnam);
298
// multi region shade
299
public native void shades( float[][] a,
300
float left, float right, float bottom, float top,
301
float[] clevel, float fill_width,
302
float cont_color, float cont_width,
304
public native void shades( double[][] a,
305
double left, double right, double bottom, double top,
306
double[] clevel, double fill_width,
307
double cont_color, double cont_width,
32
public class PLStream implements plplotjavacConstants {
37
static int next_stream = 0;
38
static int active_streams = 0;
42
// If this is the first instance of the class we
43
// need to load the C part of the bindings
44
if (active_streams == 0) {
311
public native void shades( float[][] a,
312
float left, float right, float bottom, float top,
313
float[] clevel, float fill_width,
314
float cont_color, float cont_width,
315
int rect, float[] xg, float[] yg, int wrap );
316
public native void shades( double[][] a,
317
double left, double right, double bottom, double top,
318
double[] clevel, double fill_width,
319
double cont_color, double cont_width,
320
int rect, double[] xg, double[] yg, int wrap );
323
public native void shades( float[][] a,
324
float left, float right, float bottom, float top,
325
float[] clevel, float fill_width,
326
float cont_color, float cont_width,
327
int rect, float[][] xg, float[][] yg, int wrap );
328
public native void shades( double[][] a,
329
double left, double right, double bottom, double top,
330
double[] clevel, double fill_width,
331
double cont_color, double cont_width,
332
int rect, double[][] xg, double[][] yg, int wrap );
334
// single region shade
335
public native void shade( float[][] a,
336
float left, float right, float bottom, float top,
337
float shade_min, float shade_max,
338
int sh_cmap, float sh_color, int sh_width,
339
int min_color, int min_width,
340
int max_color, int max_width,
342
public native void shade( double[][] a,
343
double left, double right, double bottom, double top,
344
double shade_min, double shade_max,
345
int sh_cmap, double sh_color, int sh_width,
346
int min_color, int min_width,
347
int max_color, int max_width,
351
public native void shade( float[][] a,
352
float left, float right, float bottom, float top,
353
float shade_min, float shade_max,
354
int sh_cmap, float sh_color, int sh_width,
355
int min_color, int min_width,
356
int max_color, int max_width,
357
int rect, float[] xg, float[] yg, int wrap );
358
public native void shade( double[][] a,
359
double left, double right, double bottom, double top,
360
double shade_min, double shade_max,
361
int sh_cmap, double sh_color, int sh_width,
362
int min_color, int min_width,
363
int max_color, int max_width,
364
int rect, double[] xg, double[] yg, int wrap );
367
public native void shade( float[][] a,
368
float left, float right, float bottom, float top,
369
float shade_min, float shade_max,
370
int sh_cmap, float sh_color, int sh_width,
371
int min_color, int min_width,
372
int max_color, int max_width,
373
int rect, float[][] xg, float[][] yg, int wrap );
374
public native void shade( double[][] a,
375
double left, double right, double bottom, double top,
376
double shade_min, double shade_max,
377
int sh_cmap, double sh_color, int sh_width,
378
int min_color, int min_width,
379
int max_color, int max_width,
380
int rect, double[][] xg, double[][] yg, int wrap );
387
// c_plspage(PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng,
388
// PLINT xoff, PLINT yoff);
390
public native void spause( int pause );
394
public native void ssub( int nx, int ny );
404
public native void styl( int nms, int mark, int space );
406
public native void svpa( float xmin, float xmax, float ymin, float ymax );
407
public native void svpa( double xmin, double xmax, double ymin, double ymax );
409
public native void sxax( int digmax, int digits );
413
public native void syax( int digmax, int digits );
415
public native void sym( int n, float[] x, float[] y, int code );
416
public native void sym( int n, double[] x, double[] y, int code );
417
public native void sym( float x, float y, int code ); // API addition
418
public native void sym( double x, double y, int code ); // API addition
420
public native void szax( int digmax, int digits );
421
public native void text();
423
public native void vasp( float aspect );
424
public native void vasp( double aspect );
426
public native void vpas( float xmin, float xmax, float ymin, float ymax, float aspect );
427
public native void vpas( double xmin, double xmax, double ymin, double ymax, double aspect );
429
public native void vpor( float xmin, float xmax, float ymin, float ymax );
430
public native void vpor( double xmin, double xmax, double ymin, double ymax );
432
public native void vsta();
434
public native void w3d( float basex, float basey, float height, float xmin0,
435
float xmax0, float ymin0, float ymax0, float zmin0,
436
float zmax0, float alt, float az);
437
public native void w3d( double basex, double basey, double height, double xmin0,
438
double xmax0, double ymin0, double ymax0, double zmin0,
439
double zmax0, double alt, double az);
441
public native void wid( int width );
443
public native void wind( float xmin, float xmax, float ymin, float ymax );
444
public native void wind( double xmin, double xmax, double ymin, double ymax );
446
// Methods needed for the implementation of PLStream, but not suitable for
447
// the public interface.
450
// Static code block to get the PLplot dynamic library loaded in.
452
System.loadLibrary( plplot.core.config.libname );
458
// Now comes stuff we need done in Java.
461
stream_id = mkstrm();
464
public int get_stream_id() { return stream_id; }
467
//---------------------------------------------------------------------------//
468
// End of PLStream.java
469
//---------------------------------------------------------------------------//
48
stream_id = next_stream;
52
// Create stream and check it worked ok.
53
if(set_stream() == -1) {
54
System.err.println("Error creating plplot stream");
61
// Ensure this is the current stream
62
public int set_stream() {
63
if ((stream_id == -1) || (active_streams == 0)) {
64
System.err.println("Error: This stream is not active");
67
plplotjavac.plsstrm(stream_id);
71
// Method to load the native C part of the java wrapper
72
public void openlib() {
76
String libdir = System.getProperty("plplot.libdir");
77
libname = new File(libdir+File.separatorChar+plplot.core.config.libname);
78
if (! libname.exists()) {
81
} catch ( Exception e) {
83
if (libname == null) {
84
libname = new File(plplot.core.config.libdir+File.separatorChar+plplot.core.config.libname);
85
if ( ! libname.exists() ) {
89
if (libname != null) {
91
System.load( libname.getAbsolutePath() );
92
} catch (UnsatisfiedLinkError e) {
93
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
98
System.err.println("Unable to find native code library.\n");
104
// The following are wrappers to the C API methods, or their derivatives
106
public void setcontlabelformat(int lexp, int sigdig) {
107
if (set_stream() == -1) return;
108
plplotjavac.pl_setcontlabelformat(lexp, sigdig);
111
public void setcontlabelparam(double offset, double size, double spacing, int active) {
112
if (set_stream() == -1) return;
113
plplotjavac.pl_setcontlabelparam(offset, size, spacing, active);
116
public void adv(int page) {
117
if (set_stream() == -1) return;
118
plplotjavac.pladv(page);
121
public void axes(double x0, double y0, String xopt, double xtick, int nxsub,
122
String yopt, double ytick, int nysub) {
123
if (set_stream() == -1) return;
124
plplotjavac.plaxes(x0, y0, xopt, xtick, nxsub, yopt, ytick, nysub);
127
public void bin(double[] x, double[] y, int center) {
128
if (set_stream() == -1) return;
129
plplotjavac.plbin(x, y, center);
133
if (set_stream() == -1) return;
137
public void box(String xopt, double xtick, int nxsub,
138
String yopt, double ytick, int nysub) {
139
if (set_stream() == -1) return;
140
plplotjavac.plbox(xopt, xtick, nxsub, yopt, ytick, nysub);
143
public void box3(String xopt, String xlabel, double xtick, int nsubx,
144
String yopt, String ylabel, double ytick, int nsuby,
145
String zopt, String zlabel, double ztick, int nsubz) {
146
if (set_stream() == -1) return;
147
plplotjavac.plbox3(xopt, xlabel, xtick, nsubx, yopt, ylabel, ytick, nsuby,
148
zopt, zlabel, ztick, nsubz);
151
public void calc_world(double rx, double ry, double[] wx, double[] wy, int[] window) {
152
if (set_stream() == -1) return;
153
plplotjavac.plcalc_world(rx, ry, wx, wy, window);
156
public void clear() {
157
if (set_stream() == -1) return;
158
plplotjavac.plclear();
161
public void col0(int icol0) {
162
if (set_stream() == -1) return;
163
plplotjavac.plcol0(icol0);
166
public void col1(double col1) {
167
if (set_stream() == -1) return;
168
plplotjavac.plcol1(col1);
171
public void cont(double[][] f, int kx, int lx, int ky, int ly,
172
double[] clevel, double[][] pltr, double[][] OBJECT_DATA) {
173
if (set_stream() == -1) return;
174
plplotjavac.plcont(f, kx, lx, ky, ly, clevel, pltr, OBJECT_DATA);
177
public void cpstrm(int iplsr, boolean flags) {
178
if (set_stream() == -1) return;
179
plplotjavac.plcpstrm(iplsr, flags);
182
// The end / end1 functions have extra code in to keep track of the
183
// stream references in the class.
185
if (set_stream() == -1) return;
192
if (set_stream() == -1) return;
193
plplotjavac.plend1();
199
public void env(double xmin, double xmax, double ymin, double ymax, int just, int axis) {
200
if (set_stream() == -1) return;
201
plplotjavac.plenv(xmin, xmax, ymin, ymax, just, axis);
205
if (set_stream() == -1) return;
209
public void errx(double[] xmin, double[] xmax, double[] y) {
210
if (set_stream() == -1) return;
211
plplotjavac.plerrx(xmin, xmax, y);
214
public void erry(double[] x, double[] ymin, double[] ymax) {
215
if (set_stream() == -1) return;
216
plplotjavac.plerry(x, ymin, ymax);
219
public void famadv() {
220
if (set_stream() == -1) return;
221
plplotjavac.plfamadv();
224
public void fill(double[] x, double[] y) {
225
if (set_stream() == -1) return;
226
plplotjavac.plfill(x, y);
229
public void fill3(double[] x, double[] y, double[] z) {
230
if (set_stream() == -1) return;
231
plplotjavac.plfill3(x, y, z);
234
public void flush() {
235
if (set_stream() == -1) return;
236
plplotjavac.plflush();
239
public void font(int ifont) {
240
if (set_stream() == -1) return;
241
plplotjavac.plfont(ifont);
244
public void fontld(int fnt) {
245
if (set_stream() == -1) return;
246
plplotjavac.plfontld(fnt);
249
public void gchr(double[] p_def, double[] p_ht) {
250
if (set_stream() == -1) return;
251
plplotjavac.plgchr(p_def, p_ht);
254
public void gcol0(int icol0, int[] r, int[] g, int[] b) {
255
if (set_stream() == -1) return;
256
plplotjavac.plgcol0(icol0, r, g, b);
259
public void gcolbg(int[] r, int[] g, int[] b) {
260
if (set_stream() == -1) return;
261
plplotjavac.plgcolbg(r, g, b);
264
public void gcompression(int[] compression) {
265
if (set_stream() == -1) return;
266
plplotjavac.plgcompression(compression);
269
public void gdev(StringBuffer dev) {
270
if (set_stream() == -1) return;
271
plplotjavac.plgdev(dev);
274
public void gdidev(double[] mar, double[] aspect, double[] jx, double[] jy) {
275
if (set_stream() == -1) return;
276
plplotjavac.plgdidev(mar, aspect, jx, jy);
279
public void gdiori(double[] rot) {
280
if (set_stream() == -1) return;
281
plplotjavac.plgdiori(rot);
284
public void gdiplt(double[] xmin, double[] xmax, double[] ymin, double[] ymax) {
285
if (set_stream() == -1) return;
286
plplotjavac.plgdiplt(xmin, xmax, ymin, ymax);
289
public void gfam(int[] fam, int[] num, int[] bmax) {
290
if (set_stream() == -1) return;
291
plplotjavac.plgfam(fam, num, bmax);
294
public void gfnam(StringBuffer fnam) {
295
if (set_stream() == -1) return;
296
plplotjavac.plgfnam(fnam);
299
public void glevel(int[] p_level) {
300
if (set_stream() == -1) return;
301
plplotjavac.plglevel(p_level);
304
public void gpage(double[] xp, double[] yp, int[] xleng, int[] yleng, int[] xoff, int[] yoff) {
305
if (set_stream() == -1) return;
306
plplotjavac.plgpage(xp, yp, xleng, yleng, xoff, yoff);
310
if (set_stream() == -1) return;
314
public void gspa(double[] xmin, double[] xmax, double[] ymin, double[] ymax) {
315
if (set_stream() == -1) return;
316
plplotjavac.plgspa(xmin, xmax, ymin, ymax);
319
// Note: The user should never need this in with this class
320
// since the stream is encapsulated in the class.
321
//public void gstrm(int[] p_strm) {
322
// if (set_stream() == -1) return;
323
// plplotjavac.plgstrm(p_strm);
326
public void gver(StringBuffer ver) {
327
if (set_stream() == -1) return;
328
plplotjavac.plgver(ver);
331
public void gvpd(double[] xmin, double[] xmax, double[] ymin, double[] ymax) {
332
if (set_stream() == -1) return;
333
plplotjavac.plgvpd(xmin, xmax, ymin, ymax);
336
public void gvpw(double[] xmin, double[] xmax, double[] ymin, double[] ymax) {
337
if (set_stream() == -1) return;
338
plplotjavac.plgvpw(xmin, xmax, ymin, ymax);
341
public void gxax(int[] digmax, int[] digits) {
342
if (set_stream() == -1) return;
343
plplotjavac.plgxax(digmax, digits);
346
public void gyax(int[] digmax, int[] digits) {
347
if (set_stream() == -1) return;
348
plplotjavac.plgyax(digmax, digits);
351
public void gzax(int[] digmax, int[] digits) {
352
if (set_stream() == -1) return;
353
plplotjavac.plgzax(digmax, digits);
356
public void hist(double[] data, double datmin, double datmax, int nbin, int oldwin) {
357
if (set_stream() == -1) return;
358
plplotjavac.plhist(data, datmin, datmax, nbin, oldwin);
361
public void hls(double h, double l, double s) {
362
if (set_stream() == -1) return;
363
plplotjavac.plhls(h, l, s);
367
if (set_stream() == -1) return;
368
plplotjavac.plinit();
371
public void join(double x1, double y1, double x2, double y2) {
372
if (set_stream() == -1) return;
373
plplotjavac.pljoin(x1, y1, x2, y2);
376
public void lab(String xlabel, String ylabel, String tlabel) {
377
if (set_stream() == -1) return;
378
plplotjavac.pllab(xlabel, ylabel, tlabel);
381
public void lightsource(double x, double y, double z) {
382
if (set_stream() == -1) return;
383
plplotjavac.pllightsource(x, y, z);
386
public void line(double[] x, double[] y) {
387
if (set_stream() == -1) return;
388
plplotjavac.plline(x, y);
391
public void line3(double[] x, double[] y, double[] z) {
392
if (set_stream() == -1) return;
393
plplotjavac.plline3(x, y, z);
396
public void lsty(int lin) {
397
if (set_stream() == -1) return;
398
plplotjavac.pllsty(lin);
401
public void mesh(double[] x, double[] y, double[][] z, int opt) {
402
if (set_stream() == -1) return;
403
plplotjavac.plmesh(x, y, z, opt);
406
public void meshc(double[] x, double[] y, double[][] z, int opt, double[] clevel) {
407
if (set_stream() == -1) return;
408
plplotjavac.plmeshc(x, y, z, opt,clevel);
411
// Don't need this in the OO approach - create a new object instead.
412
//public void mkstrm(int[] OUTPUT) {
413
// if (set_stream() == -1) return;
414
// plplotjavac.plmkstrm(int[] OUTPUT);
417
public void mtex(String side, double disp, double pos, double just, String text) {
418
if (set_stream() == -1) return;
419
plplotjavac.plmtex(side, disp, pos, just, text);
422
public void plot3d(double[] x, double[] y, double[][] z, int opt, boolean side) {
423
if (set_stream() == -1) return;
424
plplotjavac.plot3d(x, y, z, opt, side);
427
public void plot3dc(double[] x, double[] y, double[][] z, int opt, double[] clevel) {
428
if (set_stream() == -1) return;
429
plplotjavac.plot3dc(x, y, z, opt, clevel);
432
public void plot3dcl(double[] x, double[] y, double[][] z, int opt,
433
double[] clevel, int ixstart, int[] indexymin, int[] indexymax) {
434
if (set_stream() == -1) return;
435
plplotjavac.plot3dcl(x, y, z, opt, clevel, ixstart, indexymin, indexymax);
438
public void surf3d(double[] x, double[] y, double[][] z, int opt, double[] clevel) {
439
if (set_stream() == -1) return;
440
plplotjavac.plsurf3d(x, y, z, opt, clevel);
443
public void surf3dl(double[] x, double[] y, double[][] z, int opt,
444
double[] clevel, int ixstart, int[] indexymin, int[] indexymax) {
445
if (set_stream() == -1) return;
446
plplotjavac.plsurf3dl(x, y, z, opt, clevel, ixstart, indexymin, indexymax);
449
public void parseopts(String[] argv, int mode) {
450
if (set_stream() == -1) return;
451
plplotjavac.plparseopts(argv, mode);
454
public void pat(int[] inc, int[] del) {
455
if (set_stream() == -1) return;
456
plplotjavac.plpat(inc, del);
459
public void poin(double[] x, double[] y, int code) {
460
if (set_stream() == -1) return;
461
plplotjavac.plpoin(x, y, code);
464
public void poin3(double[] x, double[] y, double[] z, int code) {
465
if (set_stream() == -1) return;
466
plplotjavac.plpoin3(x, y, z, code);
469
public void poly3(double[] x, double[] y, double[] z, boolean[] draw, boolean ifcc) {
470
if (set_stream() == -1) return;
471
plplotjavac.plpoly3(x, y, z, draw, ifcc);
474
public void prec(int setp, int prec) {
475
if (set_stream() == -1) return;
476
plplotjavac.plprec(setp, prec);
479
public void psty(int patt) {
480
if (set_stream() == -1) return;
481
plplotjavac.plpsty(patt);
484
public void ptex(double x, double y, double dx, double dy, double just, String text) {
485
if (set_stream() == -1) return;
486
plplotjavac.plptex(x, y, dx, dy, just, text);
489
public void replot() {
490
if (set_stream() == -1) return;
491
plplotjavac.plreplot();
494
public void schr(double def, double scale) {
495
if (set_stream() == -1) return;
496
plplotjavac.plschr(def, scale);
499
public void scmap0(int[] r, int[] g, int[] b) {
500
if (set_stream() == -1) return;
501
plplotjavac.plscmap0(r, g, b);
504
public void scmap0n(int ncol0) {
505
if (set_stream() == -1) return;
506
plplotjavac.plscmap0n(ncol0);
509
public void scmap1(int[] r, int[] g, int[] b) {
510
if (set_stream() == -1) return;
511
plplotjavac.plscmap1(r, g, b);
514
public void scmap1l(boolean itype, double[] intensity, double[] coord1,
515
double[] coord2, double[] coord3, boolean[] rev) {
516
if (set_stream() == -1) return;
517
plplotjavac.plscmap1l(itype, intensity, coord1, coord2, coord3, rev);
520
public void scmap1n(int ncol1) {
521
if (set_stream() == -1) return;
522
plplotjavac.plscmap1n(ncol1);
525
public void scol0(int icol0, int r, int g, int b) {
526
if (set_stream() == -1) return;
527
plplotjavac.plscol0(icol0, r, g, b);
530
public void scolbg(int r, int g, int b) {
531
if (set_stream() == -1) return;
532
plplotjavac.plscolbg(r, g, b);
535
public void scolor(int color) {
536
if (set_stream() == -1) return;
537
plplotjavac.plscolor(color);
540
public void scompression(int compression) {
541
if (set_stream() == -1) return;
542
plplotjavac.plscompression(compression);
545
public void sdev(String devname) {
546
if (set_stream() == -1) return;
547
plplotjavac.plsdev(devname);
550
public void sdidev(double mar, double aspect, double jx, double jy) {
551
if (set_stream() == -1) return;
552
plplotjavac.plsdidev(mar, aspect, jx, jy);
555
public void sdimap(int dimxmin, int dimxmax, int dimymin, int dimymax,
556
double dimxpmm, double dimypmm) {
557
if (set_stream() == -1) return;
558
plplotjavac.plsdimap(dimxmin, dimxmax, dimymin, dimymax, dimxpmm, dimypmm);
561
public void sdiori(double rot) {
562
if (set_stream() == -1) return;
563
plplotjavac.plsdiori(rot);
566
public void sdiplt(double xmin, double ymin, double xmax, double ymax) {
567
if (set_stream() == -1) return;
568
plplotjavac.plsdiplt(xmin, ymin, xmax, ymax);
571
public void sdiplz(double xmin, double ymin, double xmax, double ymax) {
572
if (set_stream() == -1) return;
573
plplotjavac.plsdiplz(xmin, ymin, xmax, ymax);
576
public void sesc(char esc) {
577
if (set_stream() == -1) return;
578
plplotjavac.plsesc(esc);
581
public void setopt(String opt, String optarg) {
582
if (set_stream() == -1) return;
583
plplotjavac.plsetopt(opt, optarg);
586
public void sfam(int fam, int num, int bmax) {
587
if (set_stream() == -1) return;
588
plplotjavac.plsfam(fam, num, bmax);
591
public void sfnam(String fnam) {
592
if (set_stream() == -1) return;
593
plplotjavac.plsfnam(fnam);
596
public void shades( double[][] a, double xmin, double xmax, double ymin,
597
double ymax, double[] clevel, int fill_width, int cont_color,
598
int cont_width, boolean rectangular,
599
double[][] pltr, double[][] OBJECT_DATA) {
600
if (set_stream() == -1) return;
601
plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width,
602
cont_color, cont_width, rectangular, pltr, OBJECT_DATA);
605
public void shade(double[][] a, double left, double right, double bottom,
606
double top, double shade_min, double shade_max, int sh_cmap,
607
double sh_color, int sh_width, int min_color, int min_width,
608
int max_color, int max_width, boolean rectangular,
609
double[][] pltr, double[][] OBJECT_DATA) {
610
if (set_stream() == -1) return;
611
plplotjavac.plshade(a, left, right, bottom, top, shade_min, shade_max,
612
sh_cmap, sh_color, sh_width, min_color, min_width,
613
max_color, max_width, rectangular, pltr, OBJECT_DATA);
616
public void smaj(double def, double scale) {
617
if (set_stream() == -1) return;
618
plplotjavac.plsmaj(def, scale);
621
public void smin(double def, double scale) {
622
if (set_stream() == -1) return;
623
plplotjavac.plsmin(def, scale);
626
public void sori(int ori) {
627
if (set_stream() == -1) return;
628
plplotjavac.plsori(ori);
631
public void spage(double xp, double yp, int xleng, int yleng, int xoff, int yoff) {
632
if (set_stream() == -1) return;
633
plplotjavac.plspage(xp, yp, xleng, yleng, xoff, yoff);
636
public void spause(boolean pause) {
637
if (set_stream() == -1) return;
638
plplotjavac.plspause(pause);
641
public void sstrm(int strm) {
642
if (set_stream() == -1) return;
643
plplotjavac.plsstrm(strm);
646
public void ssub(int nx, int ny) {
647
if (set_stream() == -1) return;
648
plplotjavac.plssub(nx, ny);
651
public void ssym(double def, double scale) {
652
if (set_stream() == -1) return;
653
plplotjavac.plssym(def, scale);
656
public void star(int nx, int ny) {
657
if (set_stream() == -1) return;
658
plplotjavac.plstar(nx, ny);
661
public void start(String devname, int nx, int ny) {
662
if (set_stream() == -1) return;
663
plplotjavac.plstart(devname, nx, ny);
666
public void stripa(int id, int pen, double x, double y) {
667
if (set_stream() == -1) return;
668
plplotjavac.plstripa(id, pen, x, y);
671
public void stripc(int[] id, String xspec, String yspec,
672
double xmin, double xmax, double xjump,
673
double ymin, double ymax, double xlpos, double ylpos,
674
boolean y_ascl, boolean acc, int colbox, int collab,
675
int[] colline, int[] styline, SWIGTYPE_p_p_char legline,
676
String labx, String laby, String labtop) {
677
if (set_stream() == -1) return;
678
plplotjavac.plstripc(id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
679
xlpos, ylpos, y_ascl, acc, colbox, collab, colline,
680
styline, legline, labx, laby, labtop);
683
public void stripd(int id) {
684
if (set_stream() == -1) return;
685
plplotjavac.plstripd(id);
688
public void styl(int[] mark, int[] space) {
689
if (set_stream() == -1) return;
690
plplotjavac.plstyl(mark, space);
693
public void svect(double[] arrow_x, double[] arrow_y, boolean fill) {
694
if (set_stream() == -1) return;
695
plplotjavac.plsvect(arrow_x, arrow_y, fill);
698
public void svpa(double xmin, double xmax, double ymin, double ymax) {
699
if (set_stream() == -1) return;
700
plplotjavac.plsvpa(xmin, xmax, ymin, ymax);
703
public void sxax(int digmax, int digits) {
704
if (set_stream() == -1) return;
705
plplotjavac.plsxax(digmax, digits);
708
public void syax(int digmax, int digits) {
709
if (set_stream() == -1) return;
710
plplotjavac.plsyax(digmax, digits);
713
public void sym(double[] x, double[] y, int code) {
714
if (set_stream() == -1) return;
715
plplotjavac.plsym(x, y, code);
718
public void szax(int digmax, int digits) {
719
if (set_stream() == -1) return;
720
plplotjavac.plszax(digmax, digits);
724
if (set_stream() == -1) return;
725
plplotjavac.pltext();
728
public void vasp(double aspect) {
729
if (set_stream() == -1) return;
730
plplotjavac.plvasp(aspect);
733
public void vect(double[][] u, double[][] v, double scale, double[][] pltr, double[][] OBJECT_DATA) {
734
if (set_stream() == -1) return;
735
plplotjavac.plvect(u, v, scale, pltr, OBJECT_DATA);
738
public void vpas(double xmin, double xmax, double ymin, double ymax, double aspect) {
739
if (set_stream() == -1) return;
740
plplotjavac.plvpas(xmin, xmax, ymin, ymax, aspect);
743
public void vpor(double xmin, double xmax, double ymin, double ymax) {
744
if (set_stream() == -1) return;
745
plplotjavac.plvpor(xmin, xmax, ymin, ymax);
749
if (set_stream() == -1) return;
750
plplotjavac.plvsta();
753
public void w3d(double basex, double basey, double height, double xmin0,
754
double xmax0, double ymin0, double ymax0, double zmin0,
755
double zmax0, double alt, double az) {
756
if (set_stream() == -1) return;
757
plplotjavac.plw3d(basex, basey, height, xmin0, xmax0, ymin0, ymax0,
758
zmin0, zmax0, alt, az);
761
public void wid(int width) {
762
if (set_stream() == -1) return;
763
plplotjavac.plwid(width);
766
public void wind(double xmin, double xmax, double ymin, double ymax) {
767
if (set_stream() == -1) return;
768
plplotjavac.plwind(xmin, xmax, ymin, ymax);
771
public void xormod(boolean mode, boolean[] status) {
772
if (set_stream() == -1) return;
773
plplotjavac.plxormod(mode, status);
776
public void ClearOpts() {
777
if (set_stream() == -1) return;
778
plplotjavac.plClearOpts();
781
public void ResetOpts() {
782
if (set_stream() == -1) return;
783
plplotjavac.plResetOpts();
786
public void SetUsage(String program_string, String usage_string) {
787
if (set_stream() == -1) return;
788
plplotjavac.plSetUsage(program_string, usage_string);
791
public void OptUsage() {
792
if (set_stream() == -1) return;
793
plplotjavac.plOptUsage();
796
public void hlsrgb(double h, double l, double s, double[] r, double[] g, double[] b) {
797
if (set_stream() == -1) return;
798
plplotjavac.plhlsrgb(h,l,s,r,g,b);
801
public void rgbhls(double r, double g, double b, double[] h, double[] l, double[] s) {
802
if (set_stream() == -1) return;
803
plplotjavac.plrgbhls(r,g,b,h,l,s);
806
// Deprecated versions of methods which use int for a flag instead of
808
public void cpstrm(int iplsr, int flags) {
809
if (set_stream() == -1) return;
810
plplotjavac.plcpstrm(iplsr, flags != 0);
813
public void plot3d(double[] x, double[] y, double[][] z, int opt, int side) {
814
if (set_stream() == -1) return;
815
plplotjavac.plot3d(x, y, z, opt, side != 0);
818
public void poly3(double[] x, double[] y, double[] z, int[] draw, int ifcc) {
819
if (set_stream() == -1) return;
820
boolean [] loc_draw = new boolean[draw.length];
821
for (int i=0;i<draw.length;i++) {
822
loc_draw[i] = (draw[i]!=0);
824
plplotjavac.plpoly3(x, y, z, loc_draw, ifcc != 0);
827
public void scmap1l(int itype, double[] intensity, double[] coord1,
828
double[] coord2, double[] coord3, int[] rev) {
829
if (set_stream() == -1) return;
830
boolean [] loc_rev = new boolean[rev.length];
831
for (int i=0;i<rev.length;i++) {
832
loc_rev[i] = (rev[i]!=0);
834
plplotjavac.plscmap1l(itype != 0, intensity, coord1, coord2, coord3, loc_rev);
837
public void shades( double[][] a, double xmin, double xmax, double ymin,
838
double ymax, double[] clevel, int fill_width, int cont_color,
839
int cont_width, int rectangular,
840
double[][] pltr, double[][] OBJECT_DATA) {
841
if (set_stream() == -1) return;
842
plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width,
843
cont_color, cont_width, rectangular != 0, pltr, OBJECT_DATA);
846
public void shade(double[][] a, double left, double right, double bottom,
847
double top, double shade_min, double shade_max, int sh_cmap,
848
double sh_color, int sh_width, int min_color, int min_width,
849
int max_color, int max_width, int rectangular,
850
double[][] pltr, double[][] OBJECT_DATA) {
851
if (set_stream() == -1) return;
852
plplotjavac.plshade(a, left, right, bottom, top, shade_min, shade_max,
853
sh_cmap, sh_color, sh_width, min_color, min_width,
854
max_color, max_width, rectangular != 0, pltr, OBJECT_DATA);
857
public void spause(int pause) {
858
if (set_stream() == -1) return;
859
plplotjavac.plspause(pause != 0);
862
public void stripc(int[] id, String xspec, String yspec,
863
double xmin, double xmax, double xjump,
864
double ymin, double ymax, double xlpos, double ylpos,
865
int y_ascl, int acc, int colbox, int collab,
866
int[] colline, int[] styline, SWIGTYPE_p_p_char legline,
867
String labx, String laby, String labtop) {
868
if (set_stream() == -1) return;
869
plplotjavac.plstripc(id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
870
xlpos, ylpos, y_ascl != 0, acc != 0, colbox, collab,
871
colline, styline, legline, labx, laby, labtop);
874
public void svect(double[] arrow_x, double[] arrow_y, int fill) {
875
if (set_stream() == -1) return;
876
plplotjavac.plsvect(arrow_x, arrow_y, fill != 0);
879
public void xormod(int mode, int[] status) {
880
if (set_stream() == -1) return;
881
boolean [] loc_status = new boolean[1];
882
plplotjavac.plxormod(mode != 0, loc_status);
883
status[0] = loc_status[0] ? 1 : 0;