PLplot  5.9.9
 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;
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;
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;
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;
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;
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 meridians( PLCallbackMapform mapform, double dlong, double dlat, double minlong, double maxlong, double minlat, double maxlat )
613  {
614  if ( set_stream() == -1 ) return;
615  plplotjavac.plmeridians( mapform, dlong, dlat, minlong, maxlong, minlat, maxlat );
616  }
617 
618  public void minMax2dGrid( double[][] f, double[] fmax, double[] fmin )
619  {
620  if ( set_stream() == -1 ) return;
621  plplotjavac.plMinMax2dGrid( f, fmax, fmin );
622  }
623 
624  public void mesh( double[] x, double[] y, double[][] z, int opt )
625  {
626  if ( set_stream() == -1 ) return;
627  plplotjavac.plmesh( x, y, z, opt );
628  }
629 
630  public void meshc( double[] x, double[] y, double[][] z, int opt, double[] clevel )
631  {
632  if ( set_stream() == -1 ) return;
633  plplotjavac.plmeshc( x, y, z, opt, clevel );
634  }
635 
636 // Don't need this in the OO approach - create a new object instead.
637 //public void mkstrm(int[] OUTPUT) {
638 // if (set_stream() == -1) return;
639 // plplotjavac.plmkstrm(int[] OUTPUT);
640 //}
641 
642  public void mtex( String side, double disp, double pos, double just, String text )
643  {
644  if ( set_stream() == -1 ) return;
645  plplotjavac.plmtex( side, disp, pos, just, text );
646  }
647 
648  public void mtex3( String side, double disp, double pos, double just, String text )
649  {
650  if ( set_stream() == -1 ) return;
651  plplotjavac.plmtex3( side, disp, pos, just, text );
652  }
653 
654  public void plot3d( double[] x, double[] y, double[][] z, int opt, boolean side )
655  {
656  if ( set_stream() == -1 ) return;
657  plplotjavac.plot3d( x, y, z, opt, side );
658  }
659 
660  public void plot3dc( double[] x, double[] y, double[][] z, int opt, double[] clevel )
661  {
662  if ( set_stream() == -1 ) return;
663  plplotjavac.plot3dc( x, y, z, opt, clevel );
664  }
665 
666  public void plot3dcl( double[] x, double[] y, double[][] z, int opt,
667  double[] clevel, int ixstart, int[] indexymin, int[] indexymax )
668  {
669  if ( set_stream() == -1 ) return;
670  plplotjavac.plot3dcl( x, y, z, opt, clevel, ixstart, indexymin, indexymax );
671  }
672 
673  public void surf3d( double[] x, double[] y, double[][] z, int opt, double[] clevel )
674  {
675  if ( set_stream() == -1 ) return;
676  plplotjavac.plsurf3d( x, y, z, opt, clevel );
677  }
678 
679  public void surf3dl( double[] x, double[] y, double[][] z, int opt,
680  double[] clevel, int ixstart, int[] indexymin, int[] indexymax )
681  {
682  if ( set_stream() == -1 ) return;
683  plplotjavac.plsurf3dl( x, y, z, opt, clevel, ixstart, indexymin, indexymax );
684  }
685 
686  public void parseopts( String[] argv, int mode )
687  {
688  if ( set_stream() == -1 ) return;
689  plplotjavac.plparseopts( argv, mode );
690  }
691 
692  public void pat( int[] inc, int[] del )
693  {
694  if ( set_stream() == -1 ) return;
695  plplotjavac.plpat( inc, del );
696  }
697 
698  public void poin( double[] x, double[] y, int code )
699  {
700  if ( set_stream() == -1 ) return;
701  plplotjavac.plpoin( x, y, code );
702  }
703 
704  public void poin3( double[] x, double[] y, double[] z, int code )
705  {
706  if ( set_stream() == -1 ) return;
707  plplotjavac.plpoin3( x, y, z, code );
708  }
709 
710  public void poly3( double[] x, double[] y, double[] z, boolean[] draw, boolean ifcc )
711  {
712  if ( set_stream() == -1 ) return;
713  plplotjavac.plpoly3( x, y, z, draw, ifcc );
714  }
715 
716  public void prec( int setp, int prec )
717  {
718  if ( set_stream() == -1 ) return;
719  plplotjavac.plprec( setp, prec );
720  }
721 
722  public void psty( int patt )
723  {
724  if ( set_stream() == -1 ) return;
725  plplotjavac.plpsty( patt );
726  }
727 
728  public void ptex( double x, double y, double dx, double dy, double just, String text )
729  {
730  if ( set_stream() == -1 ) return;
731  plplotjavac.plptex( x, y, dx, dy, just, text );
732  }
733 
734  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 )
735  {
736  if ( set_stream() == -1 ) return;
737  plplotjavac.plptex3( x, y, z, dx, dy, dz, sx, sy, sz, just, text );
738  }
739 
740  public double randd()
741  {
742  if ( set_stream() == -1 ) return 0.0;
743  return plplotjavac.plrandd();
744  }
745 
746  public void replot()
747  {
748  if ( set_stream() == -1 ) return;
750  }
751 
752  public void schr( double def, double scale )
753  {
754  if ( set_stream() == -1 ) return;
755  plplotjavac.plschr( def, scale );
756  }
757 
758  public void scmap0( int[] r, int[] g, int[] b )
759  {
760  if ( set_stream() == -1 ) return;
761  plplotjavac.plscmap0( r, g, b );
762  }
763 
764  public void scmap0a( int[] r, int[] g, int[] b, double[] a )
765  {
766  if ( set_stream() == -1 ) return;
767  plplotjavac.plscmap0a( r, g, b, a );
768  }
769 
770  public void scmap0n( int ncol0 )
771  {
772  if ( set_stream() == -1 ) return;
773  plplotjavac.plscmap0n( ncol0 );
774  }
775 
776  public void scmap1( int[] r, int[] g, int[] b )
777  {
778  if ( set_stream() == -1 ) return;
779  plplotjavac.plscmap1( r, g, b );
780  }
781 
782  public void scmap1a( int[] r, int[] g, int[] b, double[] a )
783  {
784  if ( set_stream() == -1 ) return;
785  plplotjavac.plscmap1a( r, g, b, a );
786  }
787 
788  public void scmap1l( boolean itype, double[] intensity, double[] coord1,
789  double[] coord2, double[] coord3, boolean[] alt_hue_path )
790  {
791  if ( set_stream() == -1 ) return;
792  plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, alt_hue_path );
793  }
794 
795  public void scmap1l( boolean itype, double[] intensity, double[] coord1,
796  double[] coord2, double[] coord3 )
797  {
798  if ( set_stream() == -1 ) return;
799  plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, null );
800  }
801 
802  public void scmap1la( boolean itype, double[] intensity, double[] coord1,
803  double[] coord2, double[] coord3, double[] a, boolean[] alt_hue_path )
804  {
805  if ( set_stream() == -1 ) return;
806  plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, alt_hue_path );
807  }
808 
809  public void scmap1la( boolean itype, double[] intensity, double[] coord1,
810  double[] coord2, double[] coord3, double[] a )
811  {
812  if ( set_stream() == -1 ) return;
813  plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, null );
814  }
815 
816  public void scmap1n( int ncol1 )
817  {
818  if ( set_stream() == -1 ) return;
819  plplotjavac.plscmap1n( ncol1 );
820  }
821 
822  public void scmap1_range( double min_color, double max_color )
823  {
824  if ( set_stream() == -1 ) return;
825  plplotjavac.plscmap1_range( min_color, max_color );
826  }
827 
828  public void gcmap1_range( double[] min_color, double[] max_color )
829  {
830  if ( set_stream() == -1 ) return;
831  plplotjavac.plgcmap1_range( min_color, max_color );
832  }
833 
834  public void scol0( int icol0, int r, int g, int b )
835  {
836  if ( set_stream() == -1 ) return;
837  plplotjavac.plscol0( icol0, r, g, b );
838  }
839 
840  public void scol0a( int icol0, int r, int g, int b, double a )
841  {
842  if ( set_stream() == -1 ) return;
843  plplotjavac.plscol0a( icol0, r, g, b, a );
844  }
845 
846  public void scolbg( int r, int g, int b )
847  {
848  if ( set_stream() == -1 ) return;
849  plplotjavac.plscolbg( r, g, b );
850  }
851 
852  public void scolbga( int r, int g, int b, double a )
853  {
854  if ( set_stream() == -1 ) return;
855  plplotjavac.plscolbga( r, g, b, a );
856  }
857 
858  public void scolor( int color )
859  {
860  if ( set_stream() == -1 ) return;
861  plplotjavac.plscolor( color );
862  }
863 
864  public void scompression( int compression )
865  {
866  if ( set_stream() == -1 ) return;
867  plplotjavac.plscompression( compression );
868  }
869 
870  public void sdev( String devname )
871  {
872  if ( set_stream() == -1 ) return;
873  plplotjavac.plsdev( devname );
874  }
875 
876  public void sdidev( double mar, double aspect, double jx, double jy )
877  {
878  if ( set_stream() == -1 ) return;
879  plplotjavac.plsdidev( mar, aspect, jx, jy );
880  }
881 
882  public void sdimap( int dimxmin, int dimxmax, int dimymin, int dimymax,
883  double dimxpmm, double dimypmm )
884  {
885  if ( set_stream() == -1 ) return;
886  plplotjavac.plsdimap( dimxmin, dimxmax, dimymin, dimymax, dimxpmm, dimypmm );
887  }
888 
889  public void sdiori( double rot )
890  {
891  if ( set_stream() == -1 ) return;
892  plplotjavac.plsdiori( rot );
893  }
894 
895  public void sdiplt( double xmin, double ymin, double xmax, double ymax )
896  {
897  if ( set_stream() == -1 ) return;
898  plplotjavac.plsdiplt( xmin, ymin, xmax, ymax );
899  }
900 
901  public void sdiplz( double xmin, double ymin, double xmax, double ymax )
902  {
903  if ( set_stream() == -1 ) return;
904  plplotjavac.plsdiplz( xmin, ymin, xmax, ymax );
905  }
906 
907  public void seed( long s )
908  {
909  if ( set_stream() == -1 ) return;
910  plplotjavac.plseed( s );
911  }
912 
913  public void sesc( char esc )
914  {
915  if ( set_stream() == -1 ) return;
916  plplotjavac.plsesc( esc );
917  }
918 
919  public void setopt( String opt, String optarg )
920  {
921  if ( set_stream() == -1 ) return;
922  plplotjavac.plsetopt( opt, optarg );
923  }
924 
925  public void sfam( int fam, int num, int bmax )
926  {
927  if ( set_stream() == -1 ) return;
928  plplotjavac.plsfam( fam, num, bmax );
929  }
930 
931  public void sfci( long fci )
932  {
933  if ( set_stream() == -1 ) return;
934  plplotjavac.plsfci( fci );
935  }
936 
937  public void sfnam( String fnam )
938  {
939  if ( set_stream() == -1 ) return;
940  plplotjavac.plsfnam( fnam );
941  }
942 
943  public void sfont( int family, int style, int weight )
944  {
945  if ( set_stream() == -1 ) return;
946  plplotjavac.plsfont( family, style, weight );
947  }
948 
949  public void shades( double[][] a, double xmin, double xmax, double ymin,
950  double ymax, double[] clevel, double fill_width, int cont_color,
951  double cont_width, boolean rectangular,
952  double[][] pltr, double[][] OBJECT_DATA )
953  {
954  if ( set_stream() == -1 ) return;
955  plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width,
956  cont_color, cont_width, rectangular, pltr, OBJECT_DATA );
957  }
958 
959  public void shade( double[][] a, double left, double right, double bottom,
960  double top, double shade_min, double shade_max, int sh_cmap,
961  double sh_color, double sh_width, int min_color, double min_width,
962  int max_color, double max_width, boolean rectangular,
963  double[][] pltr, double[][] OBJECT_DATA )
964  {
965  if ( set_stream() == -1 ) return;
966  plplotjavac.plshade( a, left, right, bottom, top, shade_min, shade_max,
967  sh_cmap, sh_color, sh_width, min_color, min_width,
968  max_color, max_width, rectangular, pltr, OBJECT_DATA );
969  }
970 
971  public void slabelfunc( PLCallbackLabel label, Object obj )
972  {
973  if ( set_stream() == -1 ) return;
974  plplotjavac.plslabelfunc( label, obj );
975  }
976 
978  {
979  if ( set_stream() == -1 ) return;
980  plplotjavac.plslabelfunc( label, null );
981  }
982 
983  public void smaj( double def, double scale )
984  {
985  if ( set_stream() == -1 ) return;
986  plplotjavac.plsmaj( def, scale );
987  }
988 
989  public void smin( double def, double scale )
990  {
991  if ( set_stream() == -1 ) return;
992  plplotjavac.plsmin( def, scale );
993  }
994 
995  public void sori( int ori )
996  {
997  if ( set_stream() == -1 ) return;
998  plplotjavac.plsori( ori );
999  }
1000 
1001  public void spage( double xp, double yp, int xleng, int yleng, int xoff, int yoff )
1002  {
1003  if ( set_stream() == -1 ) return;
1004  plplotjavac.plspage( xp, yp, xleng, yleng, xoff, yoff );
1005  }
1006 
1007  public void spal0( String filename )
1008  {
1009  if ( set_stream() == -1 ) return;
1010  plplotjavac.plspal0( filename );
1011  }
1012 
1013  public void spal1( String filename, boolean interpolate )
1014  {
1015  if ( set_stream() == -1 ) return;
1016  plplotjavac.plspal1( filename, interpolate );
1017  }
1018 
1019  public void spause( boolean pause )
1020  {
1021  if ( set_stream() == -1 ) return;
1022  plplotjavac.plspause( pause );
1023  }
1024 
1025  public void sstrm( int strm )
1026  {
1027  if ( set_stream() == -1 ) return;
1028  plplotjavac.plsstrm( strm );
1029  }
1030 
1031  public void ssub( int nx, int ny )
1032  {
1033  if ( set_stream() == -1 ) return;
1034  plplotjavac.plssub( nx, ny );
1035  }
1036 
1037  public void ssym( double def, double scale )
1038  {
1039  if ( set_stream() == -1 ) return;
1040  plplotjavac.plssym( def, scale );
1041  }
1042 
1043  public void star( int nx, int ny )
1044  {
1045  if ( set_stream() == -1 ) return;
1046  plplotjavac.plstar( nx, ny );
1047  }
1048 
1049  public void start( String devname, int nx, int ny )
1050  {
1051  if ( set_stream() == -1 ) return;
1052  plplotjavac.plstart( devname, nx, ny );
1053  }
1054 
1055  public void stransform( PLCallbackCT coordTrans, Object data )
1056  {
1057  if ( set_stream() == -1 ) return;
1058  plplotjavac.plstransform( coordTrans, data );
1059  }
1060 
1061  public void string( double[] x, double[] y, String string )
1062  {
1063  if ( set_stream() == -1 ) return;
1064  plplotjavac.plstring( x, y, string );
1065  }
1066 
1067  public void string3( double[] x, double[] y, double[] z, String string )
1068  {
1069  if ( set_stream() == -1 ) return;
1070  plplotjavac.plstring3( x, y, z, string );
1071  }
1072 
1073  public void stripa( int id, int pen, double x, double y )
1074  {
1075  if ( set_stream() == -1 ) return;
1076  plplotjavac.plstripa( id, pen, x, y );
1077  }
1078 
1079  public void stripc( int[] id, String xspec, String yspec,
1080  double xmin, double xmax, double xjump,
1081  double ymin, double ymax, double xlpos, double ylpos,
1082  boolean y_ascl, boolean acc, int colbox, int collab,
1083  int[] colline, int[] styline, String[] legline,
1084  String labx, String laby, String labtop )
1085  {
1086  if ( set_stream() == -1 ) return;
1087  plplotjavac.plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
1088  xlpos, ylpos, y_ascl, acc, colbox, collab, colline,
1089  styline, legline, labx, laby, labtop );
1090  }
1091 
1092  public void stripd( int id )
1093  {
1094  if ( set_stream() == -1 ) return;
1095  plplotjavac.plstripd( id );
1096  }
1097 
1098  public void styl( int[] mark, int[] space )
1099  {
1100  if ( set_stream() == -1 ) return;
1101  plplotjavac.plstyl( mark, space );
1102  }
1103 
1104  public void svect( double[] arrow_x, double[] arrow_y, boolean fill )
1105  {
1106  if ( set_stream() == -1 ) return;
1107  plplotjavac.plsvect( arrow_x, arrow_y, fill );
1108  }
1109 
1110  public void svpa( double xmin, double xmax, double ymin, double ymax )
1111  {
1112  if ( set_stream() == -1 ) return;
1113  plplotjavac.plsvpa( xmin, xmax, ymin, ymax );
1114  }
1115 
1116  public void sxax( int digmax, int digits )
1117  {
1118  if ( set_stream() == -1 ) return;
1119  plplotjavac.plsxax( digmax, digits );
1120  }
1121 
1122  public void syax( int digmax, int digits )
1123  {
1124  if ( set_stream() == -1 ) return;
1125  plplotjavac.plsyax( digmax, digits );
1126  }
1127 
1128  public void sym( double[] x, double[] y, int code )
1129  {
1130  if ( set_stream() == -1 ) return;
1131  plplotjavac.plsym( x, y, code );
1132  }
1133 
1134  public void szax( int digmax, int digits )
1135  {
1136  if ( set_stream() == -1 ) return;
1137  plplotjavac.plszax( digmax, digits );
1138  }
1139 
1140  public void text()
1141  {
1142  if ( set_stream() == -1 ) return;
1143  plplotjavac.pltext();
1144  }
1145 
1146  public void timefmt( String fmt )
1147  {
1148  if ( set_stream() == -1 ) return;
1149  plplotjavac.pltimefmt( fmt );
1150  }
1151 
1152  public void vasp( double aspect )
1153  {
1154  if ( set_stream() == -1 ) return;
1155  plplotjavac.plvasp( aspect );
1156  }
1157 
1158  public void vect( double[][] u, double[][] v, double scale, double[][] pltr, double[][] OBJECT_DATA )
1159  {
1160  if ( set_stream() == -1 ) return;
1161  plplotjavac.plvect( u, v, scale, pltr, OBJECT_DATA );
1162  }
1163 
1164  public void vpas( double xmin, double xmax, double ymin, double ymax, double aspect )
1165  {
1166  if ( set_stream() == -1 ) return;
1167  plplotjavac.plvpas( xmin, xmax, ymin, ymax, aspect );
1168  }
1169 
1170  public void vpor( double xmin, double xmax, double ymin, double ymax )
1171  {
1172  if ( set_stream() == -1 ) return;
1173  plplotjavac.plvpor( xmin, xmax, ymin, ymax );
1174  }
1175 
1176  public void vsta()
1177  {
1178  if ( set_stream() == -1 ) return;
1179  plplotjavac.plvsta();
1180  }
1181 
1182  public void w3d( double basex, double basey, double height, double xmin0,
1183  double xmax0, double ymin0, double ymax0, double zmin0,
1184  double zmax0, double alt, double az )
1185  {
1186  if ( set_stream() == -1 ) return;
1187  plplotjavac.plw3d( basex, basey, height, xmin0, xmax0, ymin0, ymax0,
1188  zmin0, zmax0, alt, az );
1189  }
1190 
1191  public void width( int width )
1192  {
1193  if ( set_stream() == -1 ) return;
1194  plplotjavac.plwidth( width );
1195  }
1196 
1197  public void wind( double xmin, double xmax, double ymin, double ymax )
1198  {
1199  if ( set_stream() == -1 ) return;
1200  plplotjavac.plwind( xmin, xmax, ymin, ymax );
1201  }
1202 
1203  public void xormod( boolean mode, boolean[] status )
1204  {
1205  if ( set_stream() == -1 ) return;
1206  plplotjavac.plxormod( mode, status );
1207  }
1208 
1209  public void ClearOpts()
1210  {
1211  if ( set_stream() == -1 ) return;
1213  }
1214 
1215  public void ResetOpts()
1216  {
1217  if ( set_stream() == -1 ) return;
1219  }
1220 
1221  public void SetUsage( String program_string, String usage_string )
1222  {
1223  if ( set_stream() == -1 ) return;
1224  plplotjavac.plSetUsage( program_string, usage_string );
1225  }
1226 
1227  public void OptUsage()
1228  {
1229  if ( set_stream() == -1 ) return;
1231  }
1232 
1233  public void hlsrgb( double h, double l, double s, double[] r, double[] g, double[] b )
1234  {
1235  if ( set_stream() == -1 ) return;
1236  plplotjavac.plhlsrgb( h, l, s, r, g, b );
1237  }
1238 
1239  public void rgbhls( double r, double g, double b, double[] h, double[] l, double[] s )
1240  {
1241  if ( set_stream() == -1 ) return;
1242  plplotjavac.plrgbhls( r, g, b, h, l, s );
1243  }
1244 
1245 // Deprecated versions of methods which use int for a flag instead of
1246 // boolean.
1247  public void cpstrm( int iplsr, int flags )
1248  {
1249  if ( set_stream() == -1 ) return;
1250  plplotjavac.plcpstrm( iplsr, flags != 0 );
1251  }
1252 
1253  public void plot3d( double[] x, double[] y, double[][] z, int opt, int side )
1254  {
1255  if ( set_stream() == -1 ) return;
1256  plplotjavac.plot3d( x, y, z, opt, side != 0 );
1257  }
1258 
1259  public void poly3( double[] x, double[] y, double[] z, int[] draw, int ifcc )
1260  {
1261  if ( set_stream() == -1 ) return;
1262  boolean [] loc_draw = new boolean[draw.length];
1263  for ( int i = 0; i < draw.length; i++ )
1264  {
1265  loc_draw[i] = ( draw[i] != 0 );
1266  }
1267  plplotjavac.plpoly3( x, y, z, loc_draw, ifcc != 0 );
1268  }
1269 
1270  public void scmap1l( int itype, double[] intensity, double[] coord1,
1271  double[] coord2, double[] coord3, int[] alt_hue_path )
1272  {
1273  if ( set_stream() == -1 ) return;
1274  boolean [] loc_alt_hue_path = null;
1275  if ( alt_hue_path != null )
1276  {
1277  loc_alt_hue_path = new boolean[alt_hue_path.length];
1278  for ( int i = 0; i < alt_hue_path.length; i++ )
1279  {
1280  loc_alt_hue_path[i] = ( alt_hue_path[i] != 0 );
1281  }
1282  }
1283  plplotjavac.plscmap1l( itype != 0, intensity, coord1, coord2, coord3, loc_alt_hue_path );
1284  }
1285 
1286  public void shades( double[][] a, double xmin, double xmax, double ymin,
1287  double ymax, double[] clevel, double fill_width, int cont_color,
1288  double cont_width, int rectangular,
1289  double[][] pltr, double[][] OBJECT_DATA )
1290  {
1291  if ( set_stream() == -1 ) return;
1292  plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width,
1293  cont_color, cont_width, rectangular != 0, pltr, OBJECT_DATA );
1294  }
1295 
1296  public void shade( double[][] a, double left, double right, double bottom,
1297  double top, double shade_min, double shade_max, int sh_cmap,
1298  double sh_color, double sh_width, int min_color, double min_width,
1299  int max_color, double max_width, int rectangular,
1300  double[][] pltr, double[][] OBJECT_DATA )
1301  {
1302  if ( set_stream() == -1 ) return;
1303  plplotjavac.plshade( a, left, right, bottom, top, shade_min, shade_max,
1304  sh_cmap, sh_color, sh_width, min_color, min_width,
1305  max_color, max_width, rectangular != 0, pltr, OBJECT_DATA );
1306  }
1307 
1308  public void spause( int pause )
1309  {
1310  if ( set_stream() == -1 ) return;
1311  plplotjavac.plspause( pause != 0 );
1312  }
1313 
1314  public void stripc( int[] id, String xspec, String yspec,
1315  double xmin, double xmax, double xjump,
1316  double ymin, double ymax, double xlpos, double ylpos,
1317  int y_ascl, int acc, int colbox, int collab,
1318  int[] colline, int[] styline, String[] legline,
1319  String labx, String laby, String labtop )
1320  {
1321  if ( set_stream() == -1 ) return;
1322  plplotjavac.plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
1323  xlpos, ylpos, y_ascl != 0, acc != 0, colbox, collab,
1324  colline, styline, legline, labx, laby, labtop );
1325  }
1326 
1327  public void svect( double[] arrow_x, double[] arrow_y, int fill )
1328  {
1329  if ( set_stream() == -1 ) return;
1330  plplotjavac.plsvect( arrow_x, arrow_y, fill != 0 );
1331  }
1332 
1333  public void xormod( int mode, int[] status )
1334  {
1335  if ( set_stream() == -1 ) return;
1336  boolean [] loc_status = new boolean[1];
1337  plplotjavac.plxormod( mode != 0, loc_status );
1338  status[0] = loc_status[0] ? 1 : 0;
1339  }
1340 }