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