PLplot  5.11.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
PLStream.java
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 //
3 // Copyright (C) 2004 Andrew Ross
4 //
5 // This file is part of PLplot.
6 //
7 // PLplot is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU Library General Public License as published
9 // by the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
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.
16 //
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
20 //
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.
26 //
27 
28 package plplot.core;
29 
30 import java.io.*;
31 
32 public class PLStream implements plplotjavacConstants {
33 // Class data.
34  int stream_id = -1;
35 
36  static int active_streams = 0;
37 
38 // Constructor
39  public PLStream()
40  {
41  int[] strm = new int[1];
42 
43  // If this is the first instance of the class we
44  // need to load the C part of the bindings
45  if ( active_streams == 0 )
46  {
47  openlib();
48  }
49 
50  // Create stream and check it worked ok.
51  plplotjavac.plmkstrm( strm );
52  if ( strm[0] != -1 )
53  {
54  stream_id = strm[0];
55  active_streams++;
56  }
57  else
58  {
59  System.err.println( "Error creating plplot stream" );
60  stream_id = -1;
61  }
62  }
63 
64 // Ensure this is the current stream
65  public int set_stream()
66  {
67  if ( ( stream_id == -1 ) || ( active_streams == 0 ) )
68  {
69  System.err.println( "Error: This stream is not active" );
70  return -1;
71  }
72  plplotjavac.plsstrm( stream_id );
73  return 0;
74  }
75 
76 // Method to load the native C part of the java wrapper
77  public void openlib()
78  {
79  File libname = null;
80 
81  try {
82  String libdir = System.getProperty( "plplot.libdir" );
83  libname = new File( libdir + File.separatorChar + plplot.core.config.libname );
84  if ( !libname.exists() )
85  {
86  libname = null;
87  }
88  } catch ( Exception e ) {
89  }
90  if ( libname == null )
91  {
92  libname = new File( plplot.core.config.libdir + File.separatorChar + plplot.core.config.libname );
93  if ( !libname.exists() )
94  {
95  libname = null;
96  }
97  }
98  if ( libname != null )
99  {
100  try {
101  System.load( libname.getAbsolutePath() );
102  } catch ( UnsatisfiedLinkError e ) {
103  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 );
104  System.exit( 1 );
105  }
106  }
107  else
108  {
109  System.err.println( "Unable to find native code library.\n" );
110  System.exit( 1 );
111  }
112  }
113 
114 // The following are wrappers to the C API methods, or their derivatives
115 
116  public void setcontlabelformat( int lexp, int sigdig )
117  {
118  if ( set_stream() == -1 ) return;
119  plplotjavac.pl_setcontlabelformat( lexp, sigdig );
120  }
121 
122  public void setcontlabelparam( double offset, double size, double spacing, int active )
123  {
124  if ( set_stream() == -1 ) return;
125  plplotjavac.pl_setcontlabelparam( offset, size, spacing, active );
126  }
127 
128  public void adv( int page )
129  {
130  if ( set_stream() == -1 ) return;
131  plplotjavac.pladv( page );
132  }
133 
134  public void arc( double x, double y, double a, double b, double angle1, double angle2, double rotate, boolean fill )
135  {
136  if ( set_stream() == -1 ) return;
137  plplotjavac.plarc( x, y, a, b, angle1, angle2, rotate, fill );
138  }
139 
140  public void axes( double x0, double y0, String xopt, double xtick, int nxsub,
141  String yopt, double ytick, int nysub )
142  {
143  if ( set_stream() == -1 ) return;
144  plplotjavac.plaxes( x0, y0, xopt, xtick, nxsub, yopt, ytick, nysub );
145  }
146 
147  public void bin( double[] x, double[] y, int center )
148  {
149  if ( set_stream() == -1 ) return;
150  plplotjavac.plbin( x, y, center );
151  }
152 
153  public void bop()
154  {
155  if ( set_stream() == -1 ) return;
156  plplotjavac.plbop();
157  }
158 
159  public void box( String xopt, double xtick, int nxsub,
160  String yopt, double ytick, int nysub )
161  {
162  if ( set_stream() == -1 ) return;
163  plplotjavac.plbox( xopt, xtick, nxsub, yopt, ytick, nysub );
164  }
165 
166  public void box3( String xopt, String xlabel, double xtick, int nsubx,
167  String yopt, String ylabel, double ytick, int nsuby,
168  String zopt, String zlabel, double ztick, int nsubz )
169  {
170  if ( set_stream() == -1 ) return;
171  plplotjavac.plbox3( xopt, xlabel, xtick, nsubx, yopt, ylabel, ytick, nsuby,
172  zopt, zlabel, ztick, nsubz );
173  }
174 
175  public void btime( int year[], int month[], int day[], int hour[], int min[], double sec[], double ctime )
176  {
177  if ( set_stream() == -1 ) return;
178  plplotjavac.plbtime( year, month, day, hour, min, sec, ctime );
179  }
180 
181  public void calc_world( double rx, double ry, double[] wx, double[] wy, int[] window )
182  {
183  if ( set_stream() == -1 ) return;
184  plplotjavac.plcalc_world( rx, ry, wx, wy, window );
185  }
186 
187  public void clear()
188  {
189  if ( set_stream() == -1 ) return;
190  plplotjavac.plclear();
191  }
192 
193  public void col0( int icol0 )
194  {
195  if ( set_stream() == -1 ) return;
196  plplotjavac.plcol0( icol0 );
197  }
198 
199  public void col1( double col1 )
200  {
201  if ( set_stream() == -1 ) return;
202  plplotjavac.plcol1( col1 );
203  }
204 
205  public void configtime( double scale, double offset1, double offset2,
206  int ccontrol, boolean ifbtime_offset, int year,
207  int month, int day, int hour, int min,
208  double sec )
209  {
210  if ( set_stream() == -1 ) return;
211  plplotjavac.plconfigtime( scale, offset1, offset2, ccontrol, ifbtime_offset,
212  year, month, day, hour, min, sec );
213  }
214 
215  public void cont( double[][] f, int kx, int lx, int ky, int ly,
216  double[] clevel, double[][] pltr, double[][] OBJECT_DATA )
217  {
218  if ( set_stream() == -1 ) return;
219  plplotjavac.plcont( f, kx, lx, ky, ly, clevel, pltr, OBJECT_DATA );
220  }
221 
222  public void cpstrm( PLStream pls, boolean flags )
223  {
224  if ( set_stream() == -1 ) return;
225  plplotjavac.plcpstrm( pls.stream_id, flags );
226  }
227 
228  public void ctime( int year, int month, int day, int hour, int min, double sec, double ctime[] )
229  {
230  if ( set_stream() == -1 ) return;
231  plplotjavac.plctime( year, month, day, hour, min, sec, ctime );
232  }
233 
234 // The end / end1 functions have extra code in to keep track of the
235 // stream references in the class.
236  public void end()
237  {
238  if ( set_stream() == -1 ) return;
239  plplotjavac.plend();
240  active_streams = 0;
241  stream_id = -1;
242  }
243 
244  public void end1()
245  {
246  if ( set_stream() == -1 ) return;
247  plplotjavac.plend1();
248 
249  active_streams--;
250  stream_id = -1;
251  }
252 
253  public void env( double xmin, double xmax, double ymin, double ymax, int just, int axis )
254  {
255  if ( set_stream() == -1 ) return;
256  plplotjavac.plenv( xmin, xmax, ymin, ymax, just, axis );
257  }
258 
259  public void env0( double xmin, double xmax, double ymin, double ymax, int just, int axis )
260  {
261  if ( set_stream() == -1 ) return;
262  plplotjavac.plenv0( xmin, xmax, ymin, ymax, just, axis );
263  }
264 
265  public void eop()
266  {
267  if ( set_stream() == -1 ) return;
268  plplotjavac.pleop();
269  }
270 
271  public void errx( double[] xmin, double[] xmax, double[] y )
272  {
273  if ( set_stream() == -1 ) return;
274  plplotjavac.plerrx( xmin, xmax, y );
275  }
276 
277  public void erry( double[] x, double[] ymin, double[] ymax )
278  {
279  if ( set_stream() == -1 ) return;
280  plplotjavac.plerry( x, ymin, ymax );
281  }
282 
283  public void famadv()
284  {
285  if ( set_stream() == -1 ) return;
286  plplotjavac.plfamadv();
287  }
288 
289  public void fill( double[] x, double[] y )
290  {
291  if ( set_stream() == -1 ) return;
292  plplotjavac.plfill( x, y );
293  }
294 
295  public void fill3( double[] x, double[] y, double[] z )
296  {
297  if ( set_stream() == -1 ) return;
298  plplotjavac.plfill3( x, y, z );
299  }
300 
301  public void flush()
302  {
303  if ( set_stream() == -1 ) return;
304  plplotjavac.plflush();
305  }
306 
307  public void font( int ifont )
308  {
309  if ( set_stream() == -1 ) return;
310  plplotjavac.plfont( ifont );
311  }
312 
313  public void fontld( int fnt )
314  {
315  if ( set_stream() == -1 ) return;
316  plplotjavac.plfontld( fnt );
317  }
318 
319  public void gchr( double[] p_def, double[] p_ht )
320  {
321  if ( set_stream() == -1 ) return;
322  plplotjavac.plgchr( p_def, p_ht );
323  }
324 
325  public void gcol0( int icol0, int[] r, int[] g, int[] b )
326  {
327  if ( set_stream() == -1 ) return;
328  plplotjavac.plgcol0( icol0, r, g, b );
329  }
330 
331  public void gcol0a( int icol0, int[] r, int[] g, int[] b, double[] a )
332  {
333  if ( set_stream() == -1 ) return;
334  plplotjavac.plgcol0a( icol0, r, g, b, a );
335  }
336 
337  public void gcolbg( int[] r, int[] g, int[] b )
338  {
339  if ( set_stream() == -1 ) return;
340  plplotjavac.plgcolbg( r, g, b );
341  }
342 
343  public void gcolbga( int[] r, int[] g, int[] b, double[] a )
344  {
345  if ( set_stream() == -1 ) return;
346  plplotjavac.plgcolbga( r, g, b, a );
347  }
348 
349  public void gcompression( int[] compression )
350  {
351  if ( set_stream() == -1 ) return;
352  plplotjavac.plgcompression( compression );
353  }
354 
355  public void gdev( StringBuffer dev )
356  {
357  if ( set_stream() == -1 ) return;
358  plplotjavac.plgdev( dev );
359  }
360 
361  public void gdidev( double[] mar, double[] aspect, double[] jx, double[] jy )
362  {
363  if ( set_stream() == -1 ) return;
364  plplotjavac.plgdidev( mar, aspect, jx, jy );
365  }
366 
367  public void gdiori( double[] rot )
368  {
369  if ( set_stream() == -1 ) return;
370  plplotjavac.plgdiori( rot );
371  }
372 
373  public void gdiplt( double[] xmin, double[] xmax, double[] ymin, double[] ymax )
374  {
375  if ( set_stream() == -1 ) return;
376  plplotjavac.plgdiplt( xmin, xmax, ymin, ymax );
377  }
378 
379  public int getCursor( PLGraphicsIn gin )
380  {
381  if ( set_stream() == -1 ) return 0;
382  return plplotjavac.plGetCursor( gin );
383  }
384 
385  public void gfam( int[] fam, int[] num, int[] bmax )
386  {
387  if ( set_stream() == -1 ) return;
388  plplotjavac.plgfam( fam, num, bmax );
389  }
390 
391  public void gfci( long[] pfci )
392  {
393  if ( set_stream() == -1 ) return;
394  plplotjavac.plgfci( pfci );
395  }
396 
397  public void gfnam( StringBuffer fnam )
398  {
399  if ( set_stream() == -1 ) return;
400  plplotjavac.plgfnam( fnam );
401  }
402 
403  public void gfont( int[] family, int[] style, int[] weight )
404  {
405  if ( set_stream() == -1 ) return;
406  plplotjavac.plgfont( family, style, weight );
407  }
408 
409  public void glevel( int[] p_level )
410  {
411  if ( set_stream() == -1 ) return;
412  plplotjavac.plglevel( p_level );
413  }
414 
415  public void gpage( double[] xp, double[] yp, int[] xleng, int[] yleng, int[] xoff, int[] yoff )
416  {
417  if ( set_stream() == -1 ) return;
418  plplotjavac.plgpage( xp, yp, xleng, yleng, xoff, yoff );
419  }
420 
421  public void gra()
422  {
423  if ( set_stream() == -1 ) return;
424  plplotjavac.plgra();
425  }
426 
427  public void gradient( double[] x, double[] y, double angle )
428  {
429  if ( set_stream() == -1 ) return;
430  plplotjavac.plgradient( x, y, angle );
431  }
432 
433  public void griddata( double[] x, double[] y, double[] z, double[] xg,
434  double[] yg, double[][] zg, int type, double data )
435  {
436  if ( set_stream() == -1 ) return;
437  plplotjavac.plgriddata( x, y, z, xg, yg, zg, type, data );
438  }
439 
440  public void gspa( double[] xmin, double[] xmax, double[] ymin, double[] ymax )
441  {
442  if ( set_stream() == -1 ) return;
443  plplotjavac.plgspa( xmin, xmax, ymin, ymax );
444  }
445 
446 // Note: The user should never need this in with this class
447 // since the stream is encapsulated in the class.
448 //public void gstrm(int[] p_strm) {
449 // if (set_stream() == -1) return;
450 // plplotjavac.plgstrm(p_strm);
451 //}
452 
453  public void gver( StringBuffer ver )
454  {
455  if ( set_stream() == -1 ) return;
456  plplotjavac.plgver( ver );
457  }
458 
459  public void gvpd( double[] xmin, double[] xmax, double[] ymin, double[] ymax )
460  {
461  if ( set_stream() == -1 ) return;
462  plplotjavac.plgvpd( xmin, xmax, ymin, ymax );
463  }
464 
465  public void gvpw( double[] xmin, double[] xmax, double[] ymin, double[] ymax )
466  {
467  if ( set_stream() == -1 ) return;
468  plplotjavac.plgvpw( xmin, xmax, ymin, ymax );
469  }
470 
471  public void gxax( int[] digmax, int[] digits )
472  {
473  if ( set_stream() == -1 ) return;
474  plplotjavac.plgxax( digmax, digits );
475  }
476 
477  public void gyax( int[] digmax, int[] digits )
478  {
479  if ( set_stream() == -1 ) return;
480  plplotjavac.plgyax( digmax, digits );
481  }
482 
483  public void gzax( int[] digmax, int[] digits )
484  {
485  if ( set_stream() == -1 ) return;
486  plplotjavac.plgzax( digmax, digits );
487  }
488 
489  public void hist( double[] data, double datmin, double datmax, int nbin, int oldwin )
490  {
491  if ( set_stream() == -1 ) return;
492  plplotjavac.plhist( data, datmin, datmax, nbin, oldwin );
493  }
494 
495 // Officially deprecated.
496 //public void hls(double h, double l, double s) {
497 // if (set_stream() == -1) return;
498 // plplotjavac.plhls(h, l, s);
499 //}
500 
501  public void image( double[][] data, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double Dxmin, double Dxmax, double Dymin, double Dymax )
502  {
503  if ( set_stream() == -1 ) return;
504  plplotjavac.plimage( data, xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax, Dymin, Dymax );
505  }
506 
507  public void imagefr( double[][] data, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double valuemin, double valuemax, double[][] pltr_im, double[][] OBJECT_DATA_im )
508  {
509  if ( set_stream() == -1 ) return;
510  plplotjavac.plimagefr( data, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr_im, OBJECT_DATA_im );
511  }
512 
513  public void init()
514  {
515  if ( set_stream() == -1 ) return;
516  plplotjavac.plinit();
517  }
518 
519  public void join( double x1, double y1, double x2, double y2 )
520  {
521  if ( set_stream() == -1 ) return;
522  plplotjavac.pljoin( x1, y1, x2, y2 );
523  }
524 
525  public void lab( String xlabel, String ylabel, String tlabel )
526  {
527  if ( set_stream() == -1 ) return;
528  plplotjavac.pllab( xlabel, ylabel, tlabel );
529  }
530 
531  public void legend( double[] p_legend_width, double[] p_legend_height,
532  int opt, int position, double x, double y, double plot_width,
533  int bg_color, int bb_color, int bb_style,
534  int nrow, int ncolumn, int[] opt_array,
535  double text_offset, double text_scale,
536  double text_spacing, double text_justification,
537  int[] text_colors, String[] text,
538  int[] box_colors, int[] box_patterns,
539  double[] box_scales, double[] box_line_widths,
540  int[] line_colors, int[] line_styles,
541  double[] line_widths,
542  int[] symbol_colors, double[] symbol_scales,
543  int[] symbol_numbers, String[] symbols )
544  {
545  if ( set_stream() == -1 ) return;
546  plplotjavac.pllegend( p_legend_width, p_legend_height,
547  opt, position, x, y, plot_width, bg_color, bb_color,
548  bb_style, nrow, ncolumn, opt_array,
549  text_offset, text_scale, text_spacing,
550  text_justification, text_colors, text,
551  box_colors, box_patterns, box_scales,
552  box_line_widths, line_colors, line_styles,
553  line_widths, symbol_colors, symbol_scales,
554  symbol_numbers, symbols );
555  }
556 
557 
558  public void colorbar( double[] p_colorbar_width,
559  double[] p_colorbar_height,
560  int opt, int position, double x, double y,
561  double x_length, double y_length,
562  int bg_color, int bb_color, int bb_style,
563  double low_cap_color, double high_cap_color,
564  int cont_color, double cont_width,
565  int[] label_opts, String[] labels,
566  String[] axis_opts,
567  double[] ticks, int[] sub_ticks,
568  int[] n_values, double[][] values )
569  {
570  if ( set_stream() == -1 ) return;
571  plplotjavac.plcolorbar( p_colorbar_width, p_colorbar_height,
572  opt, position, x, y, x_length, y_length,
573  bg_color, bb_color, bb_style,
574  low_cap_color, high_cap_color,
575  cont_color, cont_width,
576  label_opts, labels, axis_opts,
577  ticks, sub_ticks,
578  n_values, values );
579  }
580 
581 
582  public void lightsource( double x, double y, double z )
583  {
584  if ( set_stream() == -1 ) return;
585  plplotjavac.pllightsource( x, y, z );
586  }
587 
588  public void line( double[] x, double[] y )
589  {
590  if ( set_stream() == -1 ) return;
591  plplotjavac.plline( x, y );
592  }
593 
594  public void line3( double[] x, double[] y, double[] z )
595  {
596  if ( set_stream() == -1 ) return;
597  plplotjavac.plline3( x, y, z );
598  }
599 
600  public void lsty( int lin )
601  {
602  if ( set_stream() == -1 ) return;
603  plplotjavac.pllsty( lin );
604  }
605 
606  public void map( PLCallbackMapform mapform, String type, double minlong, double maxlong, double minlat, double maxlat )
607  {
608  if ( set_stream() == -1 ) return;
609  plplotjavac.plmap( mapform, type, minlong, maxlong, minlat, maxlat );
610  }
611 
612  public void mapline( PLCallbackMapform mapform, String type, double minlong, double maxlong, double minlat, double maxlat, int[] plotentries )
613  {
614  if ( set_stream() == -1 ) return;
615  plplotjavac.plmapline( mapform, type, minlong, maxlong, minlat, maxlat, plotentries );
616  }
617 
618  public void mapstring( PLCallbackMapform mapform, String type, String string, double minlong, double maxlong, double minlat, double maxlat, int[] plotentries )
619  {
620  if ( set_stream() == -1 ) return;
621  plplotjavac.plmapstring( mapform, type, string, minlong, maxlong, minlat, maxlat, plotentries );
622  }
623 
624  public void maptex( PLCallbackMapform mapform, String type, double dx, double dy, double just, String text, double minlong, double maxlong, double minlat, double maxlat, int plotentry )
625  {
626  if ( set_stream() == -1 ) return;
627  plplotjavac.plmaptex( mapform, type, dx, dy, just, text, minlong, maxlong, minlat, maxlat, plotentry );
628  }
629 
630  public void mapfill( PLCallbackMapform mapform, String type, double minlong, double maxlong, double minlat, double maxlat, int[] plotentries )
631  {
632  if ( set_stream() == -1 ) return;
633  plplotjavac.plmapfill( mapform, type, minlong, maxlong, minlat, maxlat, plotentries );
634  }
635 
636  public void meridians( PLCallbackMapform mapform, double dlong, double dlat, double minlong, double maxlong, double minlat, double maxlat )
637  {
638  if ( set_stream() == -1 ) return;
639  plplotjavac.plmeridians( mapform, dlong, dlat, minlong, maxlong, minlat, maxlat );
640  }
641 
642  public void minMax2dGrid( double[][] f, double[] fmax, double[] fmin )
643  {
644  if ( set_stream() == -1 ) return;
645  plplotjavac.plMinMax2dGrid( f, fmax, fmin );
646  }
647 
648  public void mesh( double[] x, double[] y, double[][] z, int opt )
649  {
650  if ( set_stream() == -1 ) return;
651  plplotjavac.plmesh( x, y, z, opt );
652  }
653 
654  public void meshc( double[] x, double[] y, double[][] z, int opt, double[] clevel )
655  {
656  if ( set_stream() == -1 ) return;
657  plplotjavac.plmeshc( x, y, z, opt, clevel );
658  }
659 
660 // Don't need this in the OO approach - create a new object instead.
661 //public void mkstrm(int[] OUTPUT) {
662 // if (set_stream() == -1) return;
663 // plplotjavac.plmkstrm(int[] OUTPUT);
664 //}
665 
666  public void mtex( String side, double disp, double pos, double just, String text )
667  {
668  if ( set_stream() == -1 ) return;
669  plplotjavac.plmtex( side, disp, pos, just, text );
670  }
671 
672  public void mtex3( String side, double disp, double pos, double just, String text )
673  {
674  if ( set_stream() == -1 ) return;
675  plplotjavac.plmtex3( side, disp, pos, just, text );
676  }
677 
678  public void plot3d( double[] x, double[] y, double[][] z, int opt, boolean side )
679  {
680  if ( set_stream() == -1 ) return;
681  plplotjavac.plot3d( x, y, z, opt, side );
682  }
683 
684  public void plot3dc( double[] x, double[] y, double[][] z, int opt, double[] clevel )
685  {
686  if ( set_stream() == -1 ) return;
687  plplotjavac.plot3dc( x, y, z, opt, clevel );
688  }
689 
690  public void plot3dcl( double[] x, double[] y, double[][] z, int opt,
691  double[] clevel, int ixstart, int[] indexymin, int[] indexymax )
692  {
693  if ( set_stream() == -1 ) return;
694  plplotjavac.plot3dcl( x, y, z, opt, clevel, ixstart, indexymin, indexymax );
695  }
696 
697  public void surf3d( double[] x, double[] y, double[][] z, int opt, double[] clevel )
698  {
699  if ( set_stream() == -1 ) return;
700  plplotjavac.plsurf3d( x, y, z, opt, clevel );
701  }
702 
703  public void surf3dl( double[] x, double[] y, double[][] z, int opt,
704  double[] clevel, int ixstart, int[] indexymin, int[] indexymax )
705  {
706  if ( set_stream() == -1 ) return;
707  plplotjavac.plsurf3dl( x, y, z, opt, clevel, ixstart, indexymin, indexymax );
708  }
709 
710  public void parseopts( String[] argv, int mode )
711  {
712  if ( set_stream() == -1 ) return;
713  plplotjavac.plparseopts( argv, mode );
714  }
715 
716  public void pat( int[] inc, int[] del )
717  {
718  if ( set_stream() == -1 ) return;
719  plplotjavac.plpat( inc, del );
720  }
721 
722  public void path( int n, double x1, double y1, double x2, double y2 )
723  {
724  if ( set_stream() == -1 ) return;
725  plplotjavac.plpath( n, x1, y1, x2, y2 );
726  }
727 
728  public void poin( double[] x, double[] y, int code )
729  {
730  if ( set_stream() == -1 ) return;
731  plplotjavac.plpoin( x, y, code );
732  }
733 
734  public void poin3( double[] x, double[] y, double[] z, int code )
735  {
736  if ( set_stream() == -1 ) return;
737  plplotjavac.plpoin3( x, y, z, code );
738  }
739 
740  public void poly3( double[] x, double[] y, double[] z, boolean[] draw, boolean ifcc )
741  {
742  if ( set_stream() == -1 ) return;
743  plplotjavac.plpoly3( x, y, z, draw, ifcc );
744  }
745 
746  public void prec( int setp, int prec )
747  {
748  if ( set_stream() == -1 ) return;
749  plplotjavac.plprec( setp, prec );
750  }
751 
752  public void psty( int patt )
753  {
754  if ( set_stream() == -1 ) return;
755  plplotjavac.plpsty( patt );
756  }
757 
758  public void ptex( double x, double y, double dx, double dy, double just, String text )
759  {
760  if ( set_stream() == -1 ) return;
761  plplotjavac.plptex( x, y, dx, dy, just, text );
762  }
763 
764  public void ptex3( double x, double y, double z, double dx, double dy, double dz, double sx, double sy, double sz, double just, String text )
765  {
766  if ( set_stream() == -1 ) return;
767  plplotjavac.plptex3( x, y, z, dx, dy, dz, sx, sy, sz, just, text );
768  }
769 
770  public double randd()
771  {
772  if ( set_stream() == -1 ) return 0.0;
773  return plplotjavac.plrandd();
774  }
775 
776  public void replot()
777  {
778  if ( set_stream() == -1 ) return;
779  plplotjavac.plreplot();
780  }
781 
782  public void schr( double def, double scale )
783  {
784  if ( set_stream() == -1 ) return;
785  plplotjavac.plschr( def, scale );
786  }
787 
788  public void scmap0( int[] r, int[] g, int[] b )
789  {
790  if ( set_stream() == -1 ) return;
791  plplotjavac.plscmap0( r, g, b );
792  }
793 
794  public void scmap0a( int[] r, int[] g, int[] b, double[] a )
795  {
796  if ( set_stream() == -1 ) return;
797  plplotjavac.plscmap0a( r, g, b, a );
798  }
799 
800  public void scmap0n( int ncol0 )
801  {
802  if ( set_stream() == -1 ) return;
803  plplotjavac.plscmap0n( ncol0 );
804  }
805 
806  public void scmap1( int[] r, int[] g, int[] b )
807  {
808  if ( set_stream() == -1 ) return;
809  plplotjavac.plscmap1( r, g, b );
810  }
811 
812  public void scmap1a( int[] r, int[] g, int[] b, double[] a )
813  {
814  if ( set_stream() == -1 ) return;
815  plplotjavac.plscmap1a( r, g, b, a );
816  }
817 
818  public void scmap1l( boolean itype, double[] intensity, double[] coord1,
819  double[] coord2, double[] coord3, boolean[] alt_hue_path )
820  {
821  if ( set_stream() == -1 ) return;
822  plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, alt_hue_path );
823  }
824 
825  public void scmap1l( boolean itype, double[] intensity, double[] coord1,
826  double[] coord2, double[] coord3 )
827  {
828  if ( set_stream() == -1 ) return;
829  plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, null );
830  }
831 
832  public void scmap1la( boolean itype, double[] intensity, double[] coord1,
833  double[] coord2, double[] coord3, double[] a, boolean[] alt_hue_path )
834  {
835  if ( set_stream() == -1 ) return;
836  plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, alt_hue_path );
837  }
838 
839  public void scmap1la( boolean itype, double[] intensity, double[] coord1,
840  double[] coord2, double[] coord3, double[] a )
841  {
842  if ( set_stream() == -1 ) return;
843  plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, null );
844  }
845 
846  public void scmap1n( int ncol1 )
847  {
848  if ( set_stream() == -1 ) return;
849  plplotjavac.plscmap1n( ncol1 );
850  }
851 
852  public void scmap1_range( double min_color, double max_color )
853  {
854  if ( set_stream() == -1 ) return;
855  plplotjavac.plscmap1_range( min_color, max_color );
856  }
857 
858  public void gcmap1_range( double[] min_color, double[] max_color )
859  {
860  if ( set_stream() == -1 ) return;
861  plplotjavac.plgcmap1_range( min_color, max_color );
862  }
863 
864  public void scol0( int icol0, int r, int g, int b )
865  {
866  if ( set_stream() == -1 ) return;
867  plplotjavac.plscol0( icol0, r, g, b );
868  }
869 
870  public void scol0a( int icol0, int r, int g, int b, double a )
871  {
872  if ( set_stream() == -1 ) return;
873  plplotjavac.plscol0a( icol0, r, g, b, a );
874  }
875 
876  public void scolbg( int r, int g, int b )
877  {
878  if ( set_stream() == -1 ) return;
879  plplotjavac.plscolbg( r, g, b );
880  }
881 
882  public void scolbga( int r, int g, int b, double a )
883  {
884  if ( set_stream() == -1 ) return;
885  plplotjavac.plscolbga( r, g, b, a );
886  }
887 
888  public void scolor( int color )
889  {
890  if ( set_stream() == -1 ) return;
891  plplotjavac.plscolor( color );
892  }
893 
894  public void scompression( int compression )
895  {
896  if ( set_stream() == -1 ) return;
897  plplotjavac.plscompression( compression );
898  }
899 
900  public void sdev( String devname )
901  {
902  if ( set_stream() == -1 ) return;
903  plplotjavac.plsdev( devname );
904  }
905 
906  public void sdidev( double mar, double aspect, double jx, double jy )
907  {
908  if ( set_stream() == -1 ) return;
909  plplotjavac.plsdidev( mar, aspect, jx, jy );
910  }
911 
912  public void sdimap( int dimxmin, int dimxmax, int dimymin, int dimymax,
913  double dimxpmm, double dimypmm )
914  {
915  if ( set_stream() == -1 ) return;
916  plplotjavac.plsdimap( dimxmin, dimxmax, dimymin, dimymax, dimxpmm, dimypmm );
917  }
918 
919  public void sdiori( double rot )
920  {
921  if ( set_stream() == -1 ) return;
922  plplotjavac.plsdiori( rot );
923  }
924 
925  public void sdiplt( double xmin, double ymin, double xmax, double ymax )
926  {
927  if ( set_stream() == -1 ) return;
928  plplotjavac.plsdiplt( xmin, ymin, xmax, ymax );
929  }
930 
931  public void sdiplz( double xmin, double ymin, double xmax, double ymax )
932  {
933  if ( set_stream() == -1 ) return;
934  plplotjavac.plsdiplz( xmin, ymin, xmax, ymax );
935  }
936 
937  public void seed( long s )
938  {
939  if ( set_stream() == -1 ) return;
940  plplotjavac.plseed( s );
941  }
942 
943  public void sesc( char esc )
944  {
945  if ( set_stream() == -1 ) return;
946  plplotjavac.plsesc( esc );
947  }
948 
949  public void setopt( String opt, String optarg )
950  {
951  if ( set_stream() == -1 ) return;
952  plplotjavac.plsetopt( opt, optarg );
953  }
954 
955  public void sfam( int fam, int num, int bmax )
956  {
957  if ( set_stream() == -1 ) return;
958  plplotjavac.plsfam( fam, num, bmax );
959  }
960 
961  public void sfci( long fci )
962  {
963  if ( set_stream() == -1 ) return;
964  plplotjavac.plsfci( fci );
965  }
966 
967  public void sfnam( String fnam )
968  {
969  if ( set_stream() == -1 ) return;
970  plplotjavac.plsfnam( fnam );
971  }
972 
973  public void sfont( int family, int style, int weight )
974  {
975  if ( set_stream() == -1 ) return;
976  plplotjavac.plsfont( family, style, weight );
977  }
978 
979  public void shades( double[][] a, double xmin, double xmax, double ymin,
980  double ymax, double[] clevel, double fill_width, int cont_color,
981  double cont_width, boolean rectangular,
982  double[][] pltr, double[][] OBJECT_DATA )
983  {
984  if ( set_stream() == -1 ) return;
985  plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width,
986  cont_color, cont_width, rectangular, pltr, OBJECT_DATA );
987  }
988 
989  public void shade( double[][] a, double left, double right, double bottom,
990  double top, double shade_min, double shade_max, int sh_cmap,
991  double sh_color, double sh_width, int min_color, double min_width,
992  int max_color, double max_width, boolean rectangular,
993  double[][] pltr, double[][] OBJECT_DATA )
994  {
995  if ( set_stream() == -1 ) return;
996  plplotjavac.plshade( a, left, right, bottom, top, shade_min, shade_max,
997  sh_cmap, sh_color, sh_width, min_color, min_width,
998  max_color, max_width, rectangular, pltr, OBJECT_DATA );
999  }
1000 
1001  public void slabelfunc( PLCallbackLabel label, Object obj )
1002  {
1003  if ( set_stream() == -1 ) return;
1004  plplotjavac.plslabelfunc( label, obj );
1005  }
1006 
1007  public void slabelfunc( PLCallbackLabel label )
1008  {
1009  if ( set_stream() == -1 ) return;
1010  plplotjavac.plslabelfunc( label, null );
1011  }
1012 
1013  public void smaj( double def, double scale )
1014  {
1015  if ( set_stream() == -1 ) return;
1016  plplotjavac.plsmaj( def, scale );
1017  }
1018 
1019  public void smin( double def, double scale )
1020  {
1021  if ( set_stream() == -1 ) return;
1022  plplotjavac.plsmin( def, scale );
1023  }
1024 
1025  public void sori( int ori )
1026  {
1027  if ( set_stream() == -1 ) return;
1028  plplotjavac.plsori( ori );
1029  }
1030 
1031  public void spage( double xp, double yp, int xleng, int yleng, int xoff, int yoff )
1032  {
1033  if ( set_stream() == -1 ) return;
1034  plplotjavac.plspage( xp, yp, xleng, yleng, xoff, yoff );
1035  }
1036 
1037  public void spal0( String filename )
1038  {
1039  if ( set_stream() == -1 ) return;
1040  plplotjavac.plspal0( filename );
1041  }
1042 
1043  public void spal1( String filename, boolean interpolate )
1044  {
1045  if ( set_stream() == -1 ) return;
1046  plplotjavac.plspal1( filename, interpolate );
1047  }
1048 
1049  public void spause( boolean pause )
1050  {
1051  if ( set_stream() == -1 ) return;
1052  plplotjavac.plspause( pause );
1053  }
1054 
1055  public void sstrm( int strm )
1056  {
1057  if ( set_stream() == -1 ) return;
1058  plplotjavac.plsstrm( strm );
1059  }
1060 
1061  public void ssub( int nx, int ny )
1062  {
1063  if ( set_stream() == -1 ) return;
1064  plplotjavac.plssub( nx, ny );
1065  }
1066 
1067  public void ssym( double def, double scale )
1068  {
1069  if ( set_stream() == -1 ) return;
1070  plplotjavac.plssym( def, scale );
1071  }
1072 
1073  public void star( int nx, int ny )
1074  {
1075  if ( set_stream() == -1 ) return;
1076  plplotjavac.plstar( nx, ny );
1077  }
1078 
1079  public void start( String devname, int nx, int ny )
1080  {
1081  if ( set_stream() == -1 ) return;
1082  plplotjavac.plstart( devname, nx, ny );
1083  }
1084 
1085  public void stransform( PLCallbackCT coordTrans, Object data )
1086  {
1087  if ( set_stream() == -1 ) return;
1088  plplotjavac.plstransform( coordTrans, data );
1089  }
1090 
1091  public void string( double[] x, double[] y, String string )
1092  {
1093  if ( set_stream() == -1 ) return;
1094  plplotjavac.plstring( x, y, string );
1095  }
1096 
1097  public void string3( double[] x, double[] y, double[] z, String string )
1098  {
1099  if ( set_stream() == -1 ) return;
1100  plplotjavac.plstring3( x, y, z, string );
1101  }
1102 
1103  public void stripa( int id, int pen, double x, double y )
1104  {
1105  if ( set_stream() == -1 ) return;
1106  plplotjavac.plstripa( id, pen, x, y );
1107  }
1108 
1109  public void stripc( int[] id, String xspec, String yspec,
1110  double xmin, double xmax, double xjump,
1111  double ymin, double ymax, double xlpos, double ylpos,
1112  boolean y_ascl, boolean acc, int colbox, int collab,
1113  int[] colline, int[] styline, String[] legline,
1114  String labx, String laby, String labtop )
1115  {
1116  if ( set_stream() == -1 ) return;
1117  plplotjavac.plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
1118  xlpos, ylpos, y_ascl, acc, colbox, collab, colline,
1119  styline, legline, labx, laby, labtop );
1120  }
1121 
1122  public void stripd( int id )
1123  {
1124  if ( set_stream() == -1 ) return;
1125  plplotjavac.plstripd( id );
1126  }
1127 
1128  public void styl( int[] mark, int[] space )
1129  {
1130  if ( set_stream() == -1 ) return;
1131  plplotjavac.plstyl( mark, space );
1132  }
1133 
1134  public void svect( double[] arrow_x, double[] arrow_y, boolean fill )
1135  {
1136  if ( set_stream() == -1 ) return;
1137  plplotjavac.plsvect( arrow_x, arrow_y, fill );
1138  }
1139 
1140  public void svpa( double xmin, double xmax, double ymin, double ymax )
1141  {
1142  if ( set_stream() == -1 ) return;
1143  plplotjavac.plsvpa( xmin, xmax, ymin, ymax );
1144  }
1145 
1146  public void sxax( int digmax, int digits )
1147  {
1148  if ( set_stream() == -1 ) return;
1149  plplotjavac.plsxax( digmax, digits );
1150  }
1151 
1152  public void syax( int digmax, int digits )
1153  {
1154  if ( set_stream() == -1 ) return;
1155  plplotjavac.plsyax( digmax, digits );
1156  }
1157 
1158  public void sym( double[] x, double[] y, int code )
1159  {
1160  if ( set_stream() == -1 ) return;
1161  plplotjavac.plsym( x, y, code );
1162  }
1163 
1164  public void szax( int digmax, int digits )
1165  {
1166  if ( set_stream() == -1 ) return;
1167  plplotjavac.plszax( digmax, digits );
1168  }
1169 
1170  public void text()
1171  {
1172  if ( set_stream() == -1 ) return;
1173  plplotjavac.pltext();
1174  }
1175 
1176  public void timefmt( String fmt )
1177  {
1178  if ( set_stream() == -1 ) return;
1179  plplotjavac.pltimefmt( fmt );
1180  }
1181 
1182  public void vasp( double aspect )
1183  {
1184  if ( set_stream() == -1 ) return;
1185  plplotjavac.plvasp( aspect );
1186  }
1187 
1188  public void vect( double[][] u, double[][] v, double scale, double[][] pltr, double[][] OBJECT_DATA )
1189  {
1190  if ( set_stream() == -1 ) return;
1191  plplotjavac.plvect( u, v, scale, pltr, OBJECT_DATA );
1192  }
1193 
1194  public void vpas( double xmin, double xmax, double ymin, double ymax, double aspect )
1195  {
1196  if ( set_stream() == -1 ) return;
1197  plplotjavac.plvpas( xmin, xmax, ymin, ymax, aspect );
1198  }
1199 
1200  public void vpor( double xmin, double xmax, double ymin, double ymax )
1201  {
1202  if ( set_stream() == -1 ) return;
1203  plplotjavac.plvpor( xmin, xmax, ymin, ymax );
1204  }
1205 
1206  public void vsta()
1207  {
1208  if ( set_stream() == -1 ) return;
1209  plplotjavac.plvsta();
1210  }
1211 
1212  public void w3d( double basex, double basey, double height, double xmin0,
1213  double xmax0, double ymin0, double ymax0, double zmin0,
1214  double zmax0, double alt, double az )
1215  {
1216  if ( set_stream() == -1 ) return;
1217  plplotjavac.plw3d( basex, basey, height, xmin0, xmax0, ymin0, ymax0,
1218  zmin0, zmax0, alt, az );
1219  }
1220 
1221  public void width( double width )
1222  {
1223  if ( set_stream() == -1 ) return;
1224  plplotjavac.plwidth( width );
1225  }
1226 
1227  // Overloaded version with integer width.
1228  public void width( int width )
1229  {
1230  if ( set_stream() == -1 ) return;
1231  plplotjavac.plwidth( width );
1232  }
1233 
1234  public void wind( double xmin, double xmax, double ymin, double ymax )
1235  {
1236  if ( set_stream() == -1 ) return;
1237  plplotjavac.plwind( xmin, xmax, ymin, ymax );
1238  }
1239 
1240  public void xormod( boolean mode, boolean[] status )
1241  {
1242  if ( set_stream() == -1 ) return;
1243  plplotjavac.plxormod( mode, status );
1244  }
1245 
1246  public void ClearOpts()
1247  {
1248  if ( set_stream() == -1 ) return;
1249  plplotjavac.plClearOpts();
1250  }
1251 
1252  public void ResetOpts()
1253  {
1254  if ( set_stream() == -1 ) return;
1255  plplotjavac.plResetOpts();
1256  }
1257 
1258  public void SetUsage( String program_string, String usage_string )
1259  {
1260  if ( set_stream() == -1 ) return;
1261  plplotjavac.plSetUsage( program_string, usage_string );
1262  }
1263 
1264  public void OptUsage()
1265  {
1266  if ( set_stream() == -1 ) return;
1267  plplotjavac.plOptUsage();
1268  }
1269 
1270  public void hlsrgb( double h, double l, double s, double[] r, double[] g, double[] b )
1271  {
1272  if ( set_stream() == -1 ) return;
1273  plplotjavac.plhlsrgb( h, l, s, r, g, b );
1274  }
1275 
1276  public void rgbhls( double r, double g, double b, double[] h, double[] l, double[] s )
1277  {
1278  if ( set_stream() == -1 ) return;
1279  plplotjavac.plrgbhls( r, g, b, h, l, s );
1280  }
1281 
1282 // Deprecated versions of methods which use int for a flag instead of
1283 // boolean.
1284  public void cpstrm( int iplsr, int flags )
1285  {
1286  if ( set_stream() == -1 ) return;
1287  plplotjavac.plcpstrm( iplsr, flags != 0 );
1288  }
1289 
1290  public void plot3d( double[] x, double[] y, double[][] z, int opt, int side )
1291  {
1292  if ( set_stream() == -1 ) return;
1293  plplotjavac.plot3d( x, y, z, opt, side != 0 );
1294  }
1295 
1296  public void poly3( double[] x, double[] y, double[] z, int[] draw, int ifcc )
1297  {
1298  if ( set_stream() == -1 ) return;
1299  boolean [] loc_draw = new boolean[draw.length];
1300  for ( int i = 0; i < draw.length; i++ )
1301  {
1302  loc_draw[i] = ( draw[i] != 0 );
1303  }
1304  plplotjavac.plpoly3( x, y, z, loc_draw, ifcc != 0 );
1305  }
1306 
1307  public void scmap1l( int itype, double[] intensity, double[] coord1,
1308  double[] coord2, double[] coord3, int[] alt_hue_path )
1309  {
1310  if ( set_stream() == -1 ) return;
1311  boolean [] loc_alt_hue_path = null;
1312  if ( alt_hue_path != null )
1313  {
1314  loc_alt_hue_path = new boolean[alt_hue_path.length];
1315  for ( int i = 0; i < alt_hue_path.length; i++ )
1316  {
1317  loc_alt_hue_path[i] = ( alt_hue_path[i] != 0 );
1318  }
1319  }
1320  plplotjavac.plscmap1l( itype != 0, intensity, coord1, coord2, coord3, loc_alt_hue_path );
1321  }
1322 
1323  public void shades( double[][] a, double xmin, double xmax, double ymin,
1324  double ymax, double[] clevel, double fill_width, int cont_color,
1325  double cont_width, int rectangular,
1326  double[][] pltr, double[][] OBJECT_DATA )
1327  {
1328  if ( set_stream() == -1 ) return;
1329  plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width,
1330  cont_color, cont_width, rectangular != 0, pltr, OBJECT_DATA );
1331  }
1332 
1333  public void shade( double[][] a, double left, double right, double bottom,
1334  double top, double shade_min, double shade_max, int sh_cmap,
1335  double sh_color, double sh_width, int min_color, double min_width,
1336  int max_color, double max_width, int rectangular,
1337  double[][] pltr, double[][] OBJECT_DATA )
1338  {
1339  if ( set_stream() == -1 ) return;
1340  plplotjavac.plshade( a, left, right, bottom, top, shade_min, shade_max,
1341  sh_cmap, sh_color, sh_width, min_color, min_width,
1342  max_color, max_width, rectangular != 0, pltr, OBJECT_DATA );
1343  }
1344 
1345  public void spause( int pause )
1346  {
1347  if ( set_stream() == -1 ) return;
1348  plplotjavac.plspause( pause != 0 );
1349  }
1350 
1351  public void stripc( int[] id, String xspec, String yspec,
1352  double xmin, double xmax, double xjump,
1353  double ymin, double ymax, double xlpos, double ylpos,
1354  int y_ascl, int acc, int colbox, int collab,
1355  int[] colline, int[] styline, String[] legline,
1356  String labx, String laby, String labtop )
1357  {
1358  if ( set_stream() == -1 ) return;
1359  plplotjavac.plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
1360  xlpos, ylpos, y_ascl != 0, acc != 0, colbox, collab,
1361  colline, styline, legline, labx, laby, labtop );
1362  }
1363 
1364  public void svect( double[] arrow_x, double[] arrow_y, int fill )
1365  {
1366  if ( set_stream() == -1 ) return;
1367  plplotjavac.plsvect( arrow_x, arrow_y, fill != 0 );
1368  }
1369 
1370  public void xormod( int mode, int[] status )
1371  {
1372  if ( set_stream() == -1 ) return;
1373  boolean [] loc_status = new boolean[1];
1374  plplotjavac.plxormod( mode != 0, loc_status );
1375  status[0] = loc_status[0] ? 1 : 0;
1376  }
1377 }