PLplot
5.10.0
|
00001 //-------------------------------------------------------------------------- 00002 // 00003 // Copyright (C) 2004 Andrew Ross 00004 // 00005 // This file is part of PLplot. 00006 // 00007 // PLplot is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU Library General Public License as published 00009 // by the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // PLplot is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU Library General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Library General Public License 00018 // along with PLplot; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 // 00021 // This class provides a more object orientated wrapper to the PLplot library 00022 // for java. It is currently very similar to the C++ plstream class. 00023 // Each instance of the class corresponds to a plplot stream. Calling a 00024 // method in the class will ensure the stream is correctly set before 00025 // calling the underlying API function. 00026 // 00027 00028 package plplot.core; 00029 00030 import java.io.*; 00031 00032 public class PLStream implements plplotjavacConstants { 00033 // Class data. 00034 int stream_id = -1; 00035 00036 static int active_streams = 0; 00037 00038 // Constructor 00039 public PLStream() 00040 { 00041 int[] strm = new int[1]; 00042 00043 // If this is the first instance of the class we 00044 // need to load the C part of the bindings 00045 if ( active_streams == 0 ) 00046 { 00047 openlib(); 00048 } 00049 00050 // Create stream and check it worked ok. 00051 plplotjavac.plmkstrm( strm ); 00052 if ( strm[0] != -1 ) 00053 { 00054 stream_id = strm[0]; 00055 active_streams++; 00056 } 00057 else 00058 { 00059 System.err.println( "Error creating plplot stream" ); 00060 stream_id = -1; 00061 } 00062 } 00063 00064 // Ensure this is the current stream 00065 public int set_stream() 00066 { 00067 if ( ( stream_id == -1 ) || ( active_streams == 0 ) ) 00068 { 00069 System.err.println( "Error: This stream is not active" ); 00070 return -1; 00071 } 00072 plplotjavac.plsstrm( stream_id ); 00073 return 0; 00074 } 00075 00076 // Method to load the native C part of the java wrapper 00077 public void openlib() 00078 { 00079 File libname = null; 00080 00081 try { 00082 String libdir = System.getProperty( "plplot.libdir" ); 00083 libname = new File( libdir + File.separatorChar + plplot.core.config.libname ); 00084 if ( !libname.exists() ) 00085 { 00086 libname = null; 00087 } 00088 } catch ( Exception e ) { 00089 } 00090 if ( libname == null ) 00091 { 00092 libname = new File( plplot.core.config.libdir + File.separatorChar + plplot.core.config.libname ); 00093 if ( !libname.exists() ) 00094 { 00095 libname = null; 00096 } 00097 } 00098 if ( libname != null ) 00099 { 00100 try { 00101 System.load( libname.getAbsolutePath() ); 00102 } catch ( UnsatisfiedLinkError e ) { 00103 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 ); 00104 System.exit( 1 ); 00105 } 00106 } 00107 else 00108 { 00109 System.err.println( "Unable to find native code library.\n" ); 00110 System.exit( 1 ); 00111 } 00112 } 00113 00114 // The following are wrappers to the C API methods, or their derivatives 00115 00116 public void setcontlabelformat( int lexp, int sigdig ) 00117 { 00118 if ( set_stream() == -1 ) return; 00119 plplotjavac.pl_setcontlabelformat( lexp, sigdig ); 00120 } 00121 00122 public void setcontlabelparam( double offset, double size, double spacing, int active ) 00123 { 00124 if ( set_stream() == -1 ) return; 00125 plplotjavac.pl_setcontlabelparam( offset, size, spacing, active ); 00126 } 00127 00128 public void adv( int page ) 00129 { 00130 if ( set_stream() == -1 ) return; 00131 plplotjavac.pladv( page ); 00132 } 00133 00134 public void arc( double x, double y, double a, double b, double angle1, double angle2, double rotate, boolean fill ) 00135 { 00136 if ( set_stream() == -1 ) return; 00137 plplotjavac.plarc( x, y, a, b, angle1, angle2, rotate, fill ); 00138 } 00139 00140 public void axes( double x0, double y0, String xopt, double xtick, int nxsub, 00141 String yopt, double ytick, int nysub ) 00142 { 00143 if ( set_stream() == -1 ) return; 00144 plplotjavac.plaxes( x0, y0, xopt, xtick, nxsub, yopt, ytick, nysub ); 00145 } 00146 00147 public void bin( double[] x, double[] y, int center ) 00148 { 00149 if ( set_stream() == -1 ) return; 00150 plplotjavac.plbin( x, y, center ); 00151 } 00152 00153 public void bop() 00154 { 00155 if ( set_stream() == -1 ) return; 00156 plplotjavac.plbop(); 00157 } 00158 00159 public void box( String xopt, double xtick, int nxsub, 00160 String yopt, double ytick, int nysub ) 00161 { 00162 if ( set_stream() == -1 ) return; 00163 plplotjavac.plbox( xopt, xtick, nxsub, yopt, ytick, nysub ); 00164 } 00165 00166 public void box3( String xopt, String xlabel, double xtick, int nsubx, 00167 String yopt, String ylabel, double ytick, int nsuby, 00168 String zopt, String zlabel, double ztick, int nsubz ) 00169 { 00170 if ( set_stream() == -1 ) return; 00171 plplotjavac.plbox3( xopt, xlabel, xtick, nsubx, yopt, ylabel, ytick, nsuby, 00172 zopt, zlabel, ztick, nsubz ); 00173 } 00174 00175 public void btime( int year[], int month[], int day[], int hour[], int min[], double sec[], double ctime ) 00176 { 00177 if ( set_stream() == -1 ) return; 00178 plplotjavac.plbtime( year, month, day, hour, min, sec, ctime ); 00179 } 00180 00181 public void calc_world( double rx, double ry, double[] wx, double[] wy, int[] window ) 00182 { 00183 if ( set_stream() == -1 ) return; 00184 plplotjavac.plcalc_world( rx, ry, wx, wy, window ); 00185 } 00186 00187 public void clear() 00188 { 00189 if ( set_stream() == -1 ) return; 00190 plplotjavac.plclear(); 00191 } 00192 00193 public void col0( int icol0 ) 00194 { 00195 if ( set_stream() == -1 ) return; 00196 plplotjavac.plcol0( icol0 ); 00197 } 00198 00199 public void col1( double col1 ) 00200 { 00201 if ( set_stream() == -1 ) return; 00202 plplotjavac.plcol1( col1 ); 00203 } 00204 00205 public void configtime( double scale, double offset1, double offset2, 00206 int ccontrol, boolean ifbtime_offset, int year, 00207 int month, int day, int hour, int min, 00208 double sec ) 00209 { 00210 if ( set_stream() == -1 ) return; 00211 plplotjavac.plconfigtime( scale, offset1, offset2, ccontrol, ifbtime_offset, 00212 year, month, day, hour, min, sec ); 00213 } 00214 00215 public void cont( double[][] f, int kx, int lx, int ky, int ly, 00216 double[] clevel, double[][] pltr, double[][] OBJECT_DATA ) 00217 { 00218 if ( set_stream() == -1 ) return; 00219 plplotjavac.plcont( f, kx, lx, ky, ly, clevel, pltr, OBJECT_DATA ); 00220 } 00221 00222 public void cpstrm( PLStream pls, boolean flags ) 00223 { 00224 if ( set_stream() == -1 ) return; 00225 plplotjavac.plcpstrm( pls.stream_id, flags ); 00226 } 00227 00228 public void ctime( int year, int month, int day, int hour, int min, double sec, double ctime[] ) 00229 { 00230 if ( set_stream() == -1 ) return; 00231 plplotjavac.plctime( year, month, day, hour, min, sec, ctime ); 00232 } 00233 00234 // The end / end1 functions have extra code in to keep track of the 00235 // stream references in the class. 00236 public void end() 00237 { 00238 if ( set_stream() == -1 ) return; 00239 plplotjavac.plend(); 00240 active_streams = 0; 00241 stream_id = -1; 00242 } 00243 00244 public void end1() 00245 { 00246 if ( set_stream() == -1 ) return; 00247 plplotjavac.plend1(); 00248 00249 active_streams--; 00250 stream_id = -1; 00251 } 00252 00253 public void env( double xmin, double xmax, double ymin, double ymax, int just, int axis ) 00254 { 00255 if ( set_stream() == -1 ) return; 00256 plplotjavac.plenv( xmin, xmax, ymin, ymax, just, axis ); 00257 } 00258 00259 public void env0( double xmin, double xmax, double ymin, double ymax, int just, int axis ) 00260 { 00261 if ( set_stream() == -1 ) return; 00262 plplotjavac.plenv0( xmin, xmax, ymin, ymax, just, axis ); 00263 } 00264 00265 public void eop() 00266 { 00267 if ( set_stream() == -1 ) return; 00268 plplotjavac.pleop(); 00269 } 00270 00271 public void errx( double[] xmin, double[] xmax, double[] y ) 00272 { 00273 if ( set_stream() == -1 ) return; 00274 plplotjavac.plerrx( xmin, xmax, y ); 00275 } 00276 00277 public void erry( double[] x, double[] ymin, double[] ymax ) 00278 { 00279 if ( set_stream() == -1 ) return; 00280 plplotjavac.plerry( x, ymin, ymax ); 00281 } 00282 00283 public void famadv() 00284 { 00285 if ( set_stream() == -1 ) return; 00286 plplotjavac.plfamadv(); 00287 } 00288 00289 public void fill( double[] x, double[] y ) 00290 { 00291 if ( set_stream() == -1 ) return; 00292 plplotjavac.plfill( x, y ); 00293 } 00294 00295 public void fill3( double[] x, double[] y, double[] z ) 00296 { 00297 if ( set_stream() == -1 ) return; 00298 plplotjavac.plfill3( x, y, z ); 00299 } 00300 00301 public void flush() 00302 { 00303 if ( set_stream() == -1 ) return; 00304 plplotjavac.plflush(); 00305 } 00306 00307 public void font( int ifont ) 00308 { 00309 if ( set_stream() == -1 ) return; 00310 plplotjavac.plfont( ifont ); 00311 } 00312 00313 public void fontld( int fnt ) 00314 { 00315 if ( set_stream() == -1 ) return; 00316 plplotjavac.plfontld( fnt ); 00317 } 00318 00319 public void gchr( double[] p_def, double[] p_ht ) 00320 { 00321 if ( set_stream() == -1 ) return; 00322 plplotjavac.plgchr( p_def, p_ht ); 00323 } 00324 00325 public void gcol0( int icol0, int[] r, int[] g, int[] b ) 00326 { 00327 if ( set_stream() == -1 ) return; 00328 plplotjavac.plgcol0( icol0, r, g, b ); 00329 } 00330 00331 public void gcol0a( int icol0, int[] r, int[] g, int[] b, double[] a ) 00332 { 00333 if ( set_stream() == -1 ) return; 00334 plplotjavac.plgcol0a( icol0, r, g, b, a ); 00335 } 00336 00337 public void gcolbg( int[] r, int[] g, int[] b ) 00338 { 00339 if ( set_stream() == -1 ) return; 00340 plplotjavac.plgcolbg( r, g, b ); 00341 } 00342 00343 public void gcolbga( int[] r, int[] g, int[] b, double[] a ) 00344 { 00345 if ( set_stream() == -1 ) return; 00346 plplotjavac.plgcolbga( r, g, b, a ); 00347 } 00348 00349 public void gcompression( int[] compression ) 00350 { 00351 if ( set_stream() == -1 ) return; 00352 plplotjavac.plgcompression( compression ); 00353 } 00354 00355 public void gdev( StringBuffer dev ) 00356 { 00357 if ( set_stream() == -1 ) return; 00358 plplotjavac.plgdev( dev ); 00359 } 00360 00361 public void gdidev( double[] mar, double[] aspect, double[] jx, double[] jy ) 00362 { 00363 if ( set_stream() == -1 ) return; 00364 plplotjavac.plgdidev( mar, aspect, jx, jy ); 00365 } 00366 00367 public void gdiori( double[] rot ) 00368 { 00369 if ( set_stream() == -1 ) return; 00370 plplotjavac.plgdiori( rot ); 00371 } 00372 00373 public void gdiplt( double[] xmin, double[] xmax, double[] ymin, double[] ymax ) 00374 { 00375 if ( set_stream() == -1 ) return; 00376 plplotjavac.plgdiplt( xmin, xmax, ymin, ymax ); 00377 } 00378 00379 public int getCursor( PLGraphicsIn gin ) 00380 { 00381 if ( set_stream() == -1 ) return 0; 00382 return plplotjavac.plGetCursor( gin ); 00383 } 00384 00385 public void gfam( int[] fam, int[] num, int[] bmax ) 00386 { 00387 if ( set_stream() == -1 ) return; 00388 plplotjavac.plgfam( fam, num, bmax ); 00389 } 00390 00391 public void gfci( long[] pfci ) 00392 { 00393 if ( set_stream() == -1 ) return; 00394 plplotjavac.plgfci( pfci ); 00395 } 00396 00397 public void gfnam( StringBuffer fnam ) 00398 { 00399 if ( set_stream() == -1 ) return; 00400 plplotjavac.plgfnam( fnam ); 00401 } 00402 00403 public void gfont( int[] family, int[] style, int[] weight ) 00404 { 00405 if ( set_stream() == -1 ) return; 00406 plplotjavac.plgfont( family, style, weight ); 00407 } 00408 00409 public void glevel( int[] p_level ) 00410 { 00411 if ( set_stream() == -1 ) return; 00412 plplotjavac.plglevel( p_level ); 00413 } 00414 00415 public void gpage( double[] xp, double[] yp, int[] xleng, int[] yleng, int[] xoff, int[] yoff ) 00416 { 00417 if ( set_stream() == -1 ) return; 00418 plplotjavac.plgpage( xp, yp, xleng, yleng, xoff, yoff ); 00419 } 00420 00421 public void gra() 00422 { 00423 if ( set_stream() == -1 ) return; 00424 plplotjavac.plgra(); 00425 } 00426 00427 public void gradient( double[] x, double[] y, double angle ) 00428 { 00429 if ( set_stream() == -1 ) return; 00430 plplotjavac.plgradient( x, y, angle ); 00431 } 00432 00433 public void griddata( double[] x, double[] y, double[] z, double[] xg, 00434 double[] yg, double[][] zg, int type, double data ) 00435 { 00436 if ( set_stream() == -1 ) return; 00437 plplotjavac.plgriddata( x, y, z, xg, yg, zg, type, data ); 00438 } 00439 00440 public void gspa( double[] xmin, double[] xmax, double[] ymin, double[] ymax ) 00441 { 00442 if ( set_stream() == -1 ) return; 00443 plplotjavac.plgspa( xmin, xmax, ymin, ymax ); 00444 } 00445 00446 // Note: The user should never need this in with this class 00447 // since the stream is encapsulated in the class. 00448 //public void gstrm(int[] p_strm) { 00449 // if (set_stream() == -1) return; 00450 // plplotjavac.plgstrm(p_strm); 00451 //} 00452 00453 public void gver( StringBuffer ver ) 00454 { 00455 if ( set_stream() == -1 ) return; 00456 plplotjavac.plgver( ver ); 00457 } 00458 00459 public void gvpd( double[] xmin, double[] xmax, double[] ymin, double[] ymax ) 00460 { 00461 if ( set_stream() == -1 ) return; 00462 plplotjavac.plgvpd( xmin, xmax, ymin, ymax ); 00463 } 00464 00465 public void gvpw( double[] xmin, double[] xmax, double[] ymin, double[] ymax ) 00466 { 00467 if ( set_stream() == -1 ) return; 00468 plplotjavac.plgvpw( xmin, xmax, ymin, ymax ); 00469 } 00470 00471 public void gxax( int[] digmax, int[] digits ) 00472 { 00473 if ( set_stream() == -1 ) return; 00474 plplotjavac.plgxax( digmax, digits ); 00475 } 00476 00477 public void gyax( int[] digmax, int[] digits ) 00478 { 00479 if ( set_stream() == -1 ) return; 00480 plplotjavac.plgyax( digmax, digits ); 00481 } 00482 00483 public void gzax( int[] digmax, int[] digits ) 00484 { 00485 if ( set_stream() == -1 ) return; 00486 plplotjavac.plgzax( digmax, digits ); 00487 } 00488 00489 public void hist( double[] data, double datmin, double datmax, int nbin, int oldwin ) 00490 { 00491 if ( set_stream() == -1 ) return; 00492 plplotjavac.plhist( data, datmin, datmax, nbin, oldwin ); 00493 } 00494 00495 // Officially deprecated. 00496 //public void hls(double h, double l, double s) { 00497 // if (set_stream() == -1) return; 00498 // plplotjavac.plhls(h, l, s); 00499 //} 00500 00501 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 ) 00502 { 00503 if ( set_stream() == -1 ) return; 00504 plplotjavac.plimage( data, xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax, Dymin, Dymax ); 00505 } 00506 00507 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 ) 00508 { 00509 if ( set_stream() == -1 ) return; 00510 plplotjavac.plimagefr( data, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr_im, OBJECT_DATA_im ); 00511 } 00512 00513 public void init() 00514 { 00515 if ( set_stream() == -1 ) return; 00516 plplotjavac.plinit(); 00517 } 00518 00519 public void join( double x1, double y1, double x2, double y2 ) 00520 { 00521 if ( set_stream() == -1 ) return; 00522 plplotjavac.pljoin( x1, y1, x2, y2 ); 00523 } 00524 00525 public void lab( String xlabel, String ylabel, String tlabel ) 00526 { 00527 if ( set_stream() == -1 ) return; 00528 plplotjavac.pllab( xlabel, ylabel, tlabel ); 00529 } 00530 00531 public void legend( double[] p_legend_width, double[] p_legend_height, 00532 int opt, int position, double x, double y, double plot_width, 00533 int bg_color, int bb_color, int bb_style, 00534 int nrow, int ncolumn, int[] opt_array, 00535 double text_offset, double text_scale, 00536 double text_spacing, double text_justification, 00537 int[] text_colors, String[] text, 00538 int[] box_colors, int[] box_patterns, 00539 double[] box_scales, double[] box_line_widths, 00540 int[] line_colors, int[] line_styles, 00541 double[] line_widths, 00542 int[] symbol_colors, double[] symbol_scales, 00543 int[] symbol_numbers, String[] symbols ) 00544 { 00545 if ( set_stream() == -1 ) return; 00546 plplotjavac.pllegend( p_legend_width, p_legend_height, 00547 opt, position, x, y, plot_width, bg_color, bb_color, 00548 bb_style, nrow, ncolumn, opt_array, 00549 text_offset, text_scale, text_spacing, 00550 text_justification, text_colors, text, 00551 box_colors, box_patterns, box_scales, 00552 box_line_widths, line_colors, line_styles, 00553 line_widths, symbol_colors, symbol_scales, 00554 symbol_numbers, symbols ); 00555 } 00556 00557 00558 public void colorbar( double[] p_colorbar_width, 00559 double[] p_colorbar_height, 00560 int opt, int position, double x, double y, 00561 double x_length, double y_length, 00562 int bg_color, int bb_color, int bb_style, 00563 double low_cap_color, double high_cap_color, 00564 int cont_color, double cont_width, 00565 int[] label_opts, String[] labels, 00566 String[] axis_opts, 00567 double[] ticks, int[] sub_ticks, 00568 int[] n_values, double[][] values ) 00569 { 00570 if ( set_stream() == -1 ) return; 00571 plplotjavac.plcolorbar( p_colorbar_width, p_colorbar_height, 00572 opt, position, x, y, x_length, y_length, 00573 bg_color, bb_color, bb_style, 00574 low_cap_color, high_cap_color, 00575 cont_color, cont_width, 00576 label_opts, labels, axis_opts, 00577 ticks, sub_ticks, 00578 n_values, values ); 00579 } 00580 00581 00582 public void lightsource( double x, double y, double z ) 00583 { 00584 if ( set_stream() == -1 ) return; 00585 plplotjavac.pllightsource( x, y, z ); 00586 } 00587 00588 public void line( double[] x, double[] y ) 00589 { 00590 if ( set_stream() == -1 ) return; 00591 plplotjavac.plline( x, y ); 00592 } 00593 00594 public void line3( double[] x, double[] y, double[] z ) 00595 { 00596 if ( set_stream() == -1 ) return; 00597 plplotjavac.plline3( x, y, z ); 00598 } 00599 00600 public void lsty( int lin ) 00601 { 00602 if ( set_stream() == -1 ) return; 00603 plplotjavac.pllsty( lin ); 00604 } 00605 00606 public void map( PLCallbackMapform mapform, String type, double minlong, double maxlong, double minlat, double maxlat ) 00607 { 00608 if ( set_stream() == -1 ) return; 00609 plplotjavac.plmap( mapform, type, minlong, maxlong, minlat, maxlat ); 00610 } 00611 00612 public void meridians( PLCallbackMapform mapform, double dlong, double dlat, double minlong, double maxlong, double minlat, double maxlat ) 00613 { 00614 if ( set_stream() == -1 ) return; 00615 plplotjavac.plmeridians( mapform, dlong, dlat, minlong, maxlong, minlat, maxlat ); 00616 } 00617 00618 public void minMax2dGrid( double[][] f, double[] fmax, double[] fmin ) 00619 { 00620 if ( set_stream() == -1 ) return; 00621 plplotjavac.plMinMax2dGrid( f, fmax, fmin ); 00622 } 00623 00624 public void mesh( double[] x, double[] y, double[][] z, int opt ) 00625 { 00626 if ( set_stream() == -1 ) return; 00627 plplotjavac.plmesh( x, y, z, opt ); 00628 } 00629 00630 public void meshc( double[] x, double[] y, double[][] z, int opt, double[] clevel ) 00631 { 00632 if ( set_stream() == -1 ) return; 00633 plplotjavac.plmeshc( x, y, z, opt, clevel ); 00634 } 00635 00636 // Don't need this in the OO approach - create a new object instead. 00637 //public void mkstrm(int[] OUTPUT) { 00638 // if (set_stream() == -1) return; 00639 // plplotjavac.plmkstrm(int[] OUTPUT); 00640 //} 00641 00642 public void mtex( String side, double disp, double pos, double just, String text ) 00643 { 00644 if ( set_stream() == -1 ) return; 00645 plplotjavac.plmtex( side, disp, pos, just, text ); 00646 } 00647 00648 public void mtex3( String side, double disp, double pos, double just, String text ) 00649 { 00650 if ( set_stream() == -1 ) return; 00651 plplotjavac.plmtex3( side, disp, pos, just, text ); 00652 } 00653 00654 public void plot3d( double[] x, double[] y, double[][] z, int opt, boolean side ) 00655 { 00656 if ( set_stream() == -1 ) return; 00657 plplotjavac.plot3d( x, y, z, opt, side ); 00658 } 00659 00660 public void plot3dc( double[] x, double[] y, double[][] z, int opt, double[] clevel ) 00661 { 00662 if ( set_stream() == -1 ) return; 00663 plplotjavac.plot3dc( x, y, z, opt, clevel ); 00664 } 00665 00666 public void plot3dcl( double[] x, double[] y, double[][] z, int opt, 00667 double[] clevel, int ixstart, int[] indexymin, int[] indexymax ) 00668 { 00669 if ( set_stream() == -1 ) return; 00670 plplotjavac.plot3dcl( x, y, z, opt, clevel, ixstart, indexymin, indexymax ); 00671 } 00672 00673 public void surf3d( double[] x, double[] y, double[][] z, int opt, double[] clevel ) 00674 { 00675 if ( set_stream() == -1 ) return; 00676 plplotjavac.plsurf3d( x, y, z, opt, clevel ); 00677 } 00678 00679 public void surf3dl( double[] x, double[] y, double[][] z, int opt, 00680 double[] clevel, int ixstart, int[] indexymin, int[] indexymax ) 00681 { 00682 if ( set_stream() == -1 ) return; 00683 plplotjavac.plsurf3dl( x, y, z, opt, clevel, ixstart, indexymin, indexymax ); 00684 } 00685 00686 public void parseopts( String[] argv, int mode ) 00687 { 00688 if ( set_stream() == -1 ) return; 00689 plplotjavac.plparseopts( argv, mode ); 00690 } 00691 00692 public void pat( int[] inc, int[] del ) 00693 { 00694 if ( set_stream() == -1 ) return; 00695 plplotjavac.plpat( inc, del ); 00696 } 00697 00698 public void path( int n, double x1, double y1, double x2, double y2 ) 00699 { 00700 if ( set_stream() == -1 ) return; 00701 plplotjavac.plpath( n, x1, y1, x2, y2 ); 00702 } 00703 00704 public void poin( double[] x, double[] y, int code ) 00705 { 00706 if ( set_stream() == -1 ) return; 00707 plplotjavac.plpoin( x, y, code ); 00708 } 00709 00710 public void poin3( double[] x, double[] y, double[] z, int code ) 00711 { 00712 if ( set_stream() == -1 ) return; 00713 plplotjavac.plpoin3( x, y, z, code ); 00714 } 00715 00716 public void poly3( double[] x, double[] y, double[] z, boolean[] draw, boolean ifcc ) 00717 { 00718 if ( set_stream() == -1 ) return; 00719 plplotjavac.plpoly3( x, y, z, draw, ifcc ); 00720 } 00721 00722 public void prec( int setp, int prec ) 00723 { 00724 if ( set_stream() == -1 ) return; 00725 plplotjavac.plprec( setp, prec ); 00726 } 00727 00728 public void psty( int patt ) 00729 { 00730 if ( set_stream() == -1 ) return; 00731 plplotjavac.plpsty( patt ); 00732 } 00733 00734 public void ptex( double x, double y, double dx, double dy, double just, String text ) 00735 { 00736 if ( set_stream() == -1 ) return; 00737 plplotjavac.plptex( x, y, dx, dy, just, text ); 00738 } 00739 00740 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 ) 00741 { 00742 if ( set_stream() == -1 ) return; 00743 plplotjavac.plptex3( x, y, z, dx, dy, dz, sx, sy, sz, just, text ); 00744 } 00745 00746 public double randd() 00747 { 00748 if ( set_stream() == -1 ) return 0.0; 00749 return plplotjavac.plrandd(); 00750 } 00751 00752 public void replot() 00753 { 00754 if ( set_stream() == -1 ) return; 00755 plplotjavac.plreplot(); 00756 } 00757 00758 public void schr( double def, double scale ) 00759 { 00760 if ( set_stream() == -1 ) return; 00761 plplotjavac.plschr( def, scale ); 00762 } 00763 00764 public void scmap0( int[] r, int[] g, int[] b ) 00765 { 00766 if ( set_stream() == -1 ) return; 00767 plplotjavac.plscmap0( r, g, b ); 00768 } 00769 00770 public void scmap0a( int[] r, int[] g, int[] b, double[] a ) 00771 { 00772 if ( set_stream() == -1 ) return; 00773 plplotjavac.plscmap0a( r, g, b, a ); 00774 } 00775 00776 public void scmap0n( int ncol0 ) 00777 { 00778 if ( set_stream() == -1 ) return; 00779 plplotjavac.plscmap0n( ncol0 ); 00780 } 00781 00782 public void scmap1( int[] r, int[] g, int[] b ) 00783 { 00784 if ( set_stream() == -1 ) return; 00785 plplotjavac.plscmap1( r, g, b ); 00786 } 00787 00788 public void scmap1a( int[] r, int[] g, int[] b, double[] a ) 00789 { 00790 if ( set_stream() == -1 ) return; 00791 plplotjavac.plscmap1a( r, g, b, a ); 00792 } 00793 00794 public void scmap1l( boolean itype, double[] intensity, double[] coord1, 00795 double[] coord2, double[] coord3, boolean[] alt_hue_path ) 00796 { 00797 if ( set_stream() == -1 ) return; 00798 plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, alt_hue_path ); 00799 } 00800 00801 public void scmap1l( boolean itype, double[] intensity, double[] coord1, 00802 double[] coord2, double[] coord3 ) 00803 { 00804 if ( set_stream() == -1 ) return; 00805 plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, null ); 00806 } 00807 00808 public void scmap1la( boolean itype, double[] intensity, double[] coord1, 00809 double[] coord2, double[] coord3, double[] a, boolean[] alt_hue_path ) 00810 { 00811 if ( set_stream() == -1 ) return; 00812 plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, alt_hue_path ); 00813 } 00814 00815 public void scmap1la( boolean itype, double[] intensity, double[] coord1, 00816 double[] coord2, double[] coord3, double[] a ) 00817 { 00818 if ( set_stream() == -1 ) return; 00819 plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, null ); 00820 } 00821 00822 public void scmap1n( int ncol1 ) 00823 { 00824 if ( set_stream() == -1 ) return; 00825 plplotjavac.plscmap1n( ncol1 ); 00826 } 00827 00828 public void scmap1_range( double min_color, double max_color ) 00829 { 00830 if ( set_stream() == -1 ) return; 00831 plplotjavac.plscmap1_range( min_color, max_color ); 00832 } 00833 00834 public void gcmap1_range( double[] min_color, double[] max_color ) 00835 { 00836 if ( set_stream() == -1 ) return; 00837 plplotjavac.plgcmap1_range( min_color, max_color ); 00838 } 00839 00840 public void scol0( int icol0, int r, int g, int b ) 00841 { 00842 if ( set_stream() == -1 ) return; 00843 plplotjavac.plscol0( icol0, r, g, b ); 00844 } 00845 00846 public void scol0a( int icol0, int r, int g, int b, double a ) 00847 { 00848 if ( set_stream() == -1 ) return; 00849 plplotjavac.plscol0a( icol0, r, g, b, a ); 00850 } 00851 00852 public void scolbg( int r, int g, int b ) 00853 { 00854 if ( set_stream() == -1 ) return; 00855 plplotjavac.plscolbg( r, g, b ); 00856 } 00857 00858 public void scolbga( int r, int g, int b, double a ) 00859 { 00860 if ( set_stream() == -1 ) return; 00861 plplotjavac.plscolbga( r, g, b, a ); 00862 } 00863 00864 public void scolor( int color ) 00865 { 00866 if ( set_stream() == -1 ) return; 00867 plplotjavac.plscolor( color ); 00868 } 00869 00870 public void scompression( int compression ) 00871 { 00872 if ( set_stream() == -1 ) return; 00873 plplotjavac.plscompression( compression ); 00874 } 00875 00876 public void sdev( String devname ) 00877 { 00878 if ( set_stream() == -1 ) return; 00879 plplotjavac.plsdev( devname ); 00880 } 00881 00882 public void sdidev( double mar, double aspect, double jx, double jy ) 00883 { 00884 if ( set_stream() == -1 ) return; 00885 plplotjavac.plsdidev( mar, aspect, jx, jy ); 00886 } 00887 00888 public void sdimap( int dimxmin, int dimxmax, int dimymin, int dimymax, 00889 double dimxpmm, double dimypmm ) 00890 { 00891 if ( set_stream() == -1 ) return; 00892 plplotjavac.plsdimap( dimxmin, dimxmax, dimymin, dimymax, dimxpmm, dimypmm ); 00893 } 00894 00895 public void sdiori( double rot ) 00896 { 00897 if ( set_stream() == -1 ) return; 00898 plplotjavac.plsdiori( rot ); 00899 } 00900 00901 public void sdiplt( double xmin, double ymin, double xmax, double ymax ) 00902 { 00903 if ( set_stream() == -1 ) return; 00904 plplotjavac.plsdiplt( xmin, ymin, xmax, ymax ); 00905 } 00906 00907 public void sdiplz( double xmin, double ymin, double xmax, double ymax ) 00908 { 00909 if ( set_stream() == -1 ) return; 00910 plplotjavac.plsdiplz( xmin, ymin, xmax, ymax ); 00911 } 00912 00913 public void seed( long s ) 00914 { 00915 if ( set_stream() == -1 ) return; 00916 plplotjavac.plseed( s ); 00917 } 00918 00919 public void sesc( char esc ) 00920 { 00921 if ( set_stream() == -1 ) return; 00922 plplotjavac.plsesc( esc ); 00923 } 00924 00925 public void setopt( String opt, String optarg ) 00926 { 00927 if ( set_stream() == -1 ) return; 00928 plplotjavac.plsetopt( opt, optarg ); 00929 } 00930 00931 public void sfam( int fam, int num, int bmax ) 00932 { 00933 if ( set_stream() == -1 ) return; 00934 plplotjavac.plsfam( fam, num, bmax ); 00935 } 00936 00937 public void sfci( long fci ) 00938 { 00939 if ( set_stream() == -1 ) return; 00940 plplotjavac.plsfci( fci ); 00941 } 00942 00943 public void sfnam( String fnam ) 00944 { 00945 if ( set_stream() == -1 ) return; 00946 plplotjavac.plsfnam( fnam ); 00947 } 00948 00949 public void sfont( int family, int style, int weight ) 00950 { 00951 if ( set_stream() == -1 ) return; 00952 plplotjavac.plsfont( family, style, weight ); 00953 } 00954 00955 public void shades( double[][] a, double xmin, double xmax, double ymin, 00956 double ymax, double[] clevel, double fill_width, int cont_color, 00957 double cont_width, boolean rectangular, 00958 double[][] pltr, double[][] OBJECT_DATA ) 00959 { 00960 if ( set_stream() == -1 ) return; 00961 plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width, 00962 cont_color, cont_width, rectangular, pltr, OBJECT_DATA ); 00963 } 00964 00965 public void shade( double[][] a, double left, double right, double bottom, 00966 double top, double shade_min, double shade_max, int sh_cmap, 00967 double sh_color, double sh_width, int min_color, double min_width, 00968 int max_color, double max_width, boolean rectangular, 00969 double[][] pltr, double[][] OBJECT_DATA ) 00970 { 00971 if ( set_stream() == -1 ) return; 00972 plplotjavac.plshade( a, left, right, bottom, top, shade_min, shade_max, 00973 sh_cmap, sh_color, sh_width, min_color, min_width, 00974 max_color, max_width, rectangular, pltr, OBJECT_DATA ); 00975 } 00976 00977 public void slabelfunc( PLCallbackLabel label, Object obj ) 00978 { 00979 if ( set_stream() == -1 ) return; 00980 plplotjavac.plslabelfunc( label, obj ); 00981 } 00982 00983 public void slabelfunc( PLCallbackLabel label ) 00984 { 00985 if ( set_stream() == -1 ) return; 00986 plplotjavac.plslabelfunc( label, null ); 00987 } 00988 00989 public void smaj( double def, double scale ) 00990 { 00991 if ( set_stream() == -1 ) return; 00992 plplotjavac.plsmaj( def, scale ); 00993 } 00994 00995 public void smin( double def, double scale ) 00996 { 00997 if ( set_stream() == -1 ) return; 00998 plplotjavac.plsmin( def, scale ); 00999 } 01000 01001 public void sori( int ori ) 01002 { 01003 if ( set_stream() == -1 ) return; 01004 plplotjavac.plsori( ori ); 01005 } 01006 01007 public void spage( double xp, double yp, int xleng, int yleng, int xoff, int yoff ) 01008 { 01009 if ( set_stream() == -1 ) return; 01010 plplotjavac.plspage( xp, yp, xleng, yleng, xoff, yoff ); 01011 } 01012 01013 public void spal0( String filename ) 01014 { 01015 if ( set_stream() == -1 ) return; 01016 plplotjavac.plspal0( filename ); 01017 } 01018 01019 public void spal1( String filename, boolean interpolate ) 01020 { 01021 if ( set_stream() == -1 ) return; 01022 plplotjavac.plspal1( filename, interpolate ); 01023 } 01024 01025 public void spause( boolean pause ) 01026 { 01027 if ( set_stream() == -1 ) return; 01028 plplotjavac.plspause( pause ); 01029 } 01030 01031 public void sstrm( int strm ) 01032 { 01033 if ( set_stream() == -1 ) return; 01034 plplotjavac.plsstrm( strm ); 01035 } 01036 01037 public void ssub( int nx, int ny ) 01038 { 01039 if ( set_stream() == -1 ) return; 01040 plplotjavac.plssub( nx, ny ); 01041 } 01042 01043 public void ssym( double def, double scale ) 01044 { 01045 if ( set_stream() == -1 ) return; 01046 plplotjavac.plssym( def, scale ); 01047 } 01048 01049 public void star( int nx, int ny ) 01050 { 01051 if ( set_stream() == -1 ) return; 01052 plplotjavac.plstar( nx, ny ); 01053 } 01054 01055 public void start( String devname, int nx, int ny ) 01056 { 01057 if ( set_stream() == -1 ) return; 01058 plplotjavac.plstart( devname, nx, ny ); 01059 } 01060 01061 public void stransform( PLCallbackCT coordTrans, Object data ) 01062 { 01063 if ( set_stream() == -1 ) return; 01064 plplotjavac.plstransform( coordTrans, data ); 01065 } 01066 01067 public void string( double[] x, double[] y, String string ) 01068 { 01069 if ( set_stream() == -1 ) return; 01070 plplotjavac.plstring( x, y, string ); 01071 } 01072 01073 public void string3( double[] x, double[] y, double[] z, String string ) 01074 { 01075 if ( set_stream() == -1 ) return; 01076 plplotjavac.plstring3( x, y, z, string ); 01077 } 01078 01079 public void stripa( int id, int pen, double x, double y ) 01080 { 01081 if ( set_stream() == -1 ) return; 01082 plplotjavac.plstripa( id, pen, x, y ); 01083 } 01084 01085 public void stripc( int[] id, String xspec, String yspec, 01086 double xmin, double xmax, double xjump, 01087 double ymin, double ymax, double xlpos, double ylpos, 01088 boolean y_ascl, boolean acc, int colbox, int collab, 01089 int[] colline, int[] styline, String[] legline, 01090 String labx, String laby, String labtop ) 01091 { 01092 if ( set_stream() == -1 ) return; 01093 plplotjavac.plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax, 01094 xlpos, ylpos, y_ascl, acc, colbox, collab, colline, 01095 styline, legline, labx, laby, labtop ); 01096 } 01097 01098 public void stripd( int id ) 01099 { 01100 if ( set_stream() == -1 ) return; 01101 plplotjavac.plstripd( id ); 01102 } 01103 01104 public void styl( int[] mark, int[] space ) 01105 { 01106 if ( set_stream() == -1 ) return; 01107 plplotjavac.plstyl( mark, space ); 01108 } 01109 01110 public void svect( double[] arrow_x, double[] arrow_y, boolean fill ) 01111 { 01112 if ( set_stream() == -1 ) return; 01113 plplotjavac.plsvect( arrow_x, arrow_y, fill ); 01114 } 01115 01116 public void svpa( double xmin, double xmax, double ymin, double ymax ) 01117 { 01118 if ( set_stream() == -1 ) return; 01119 plplotjavac.plsvpa( xmin, xmax, ymin, ymax ); 01120 } 01121 01122 public void sxax( int digmax, int digits ) 01123 { 01124 if ( set_stream() == -1 ) return; 01125 plplotjavac.plsxax( digmax, digits ); 01126 } 01127 01128 public void syax( int digmax, int digits ) 01129 { 01130 if ( set_stream() == -1 ) return; 01131 plplotjavac.plsyax( digmax, digits ); 01132 } 01133 01134 public void sym( double[] x, double[] y, int code ) 01135 { 01136 if ( set_stream() == -1 ) return; 01137 plplotjavac.plsym( x, y, code ); 01138 } 01139 01140 public void szax( int digmax, int digits ) 01141 { 01142 if ( set_stream() == -1 ) return; 01143 plplotjavac.plszax( digmax, digits ); 01144 } 01145 01146 public void text() 01147 { 01148 if ( set_stream() == -1 ) return; 01149 plplotjavac.pltext(); 01150 } 01151 01152 public void timefmt( String fmt ) 01153 { 01154 if ( set_stream() == -1 ) return; 01155 plplotjavac.pltimefmt( fmt ); 01156 } 01157 01158 public void vasp( double aspect ) 01159 { 01160 if ( set_stream() == -1 ) return; 01161 plplotjavac.plvasp( aspect ); 01162 } 01163 01164 public void vect( double[][] u, double[][] v, double scale, double[][] pltr, double[][] OBJECT_DATA ) 01165 { 01166 if ( set_stream() == -1 ) return; 01167 plplotjavac.plvect( u, v, scale, pltr, OBJECT_DATA ); 01168 } 01169 01170 public void vpas( double xmin, double xmax, double ymin, double ymax, double aspect ) 01171 { 01172 if ( set_stream() == -1 ) return; 01173 plplotjavac.plvpas( xmin, xmax, ymin, ymax, aspect ); 01174 } 01175 01176 public void vpor( double xmin, double xmax, double ymin, double ymax ) 01177 { 01178 if ( set_stream() == -1 ) return; 01179 plplotjavac.plvpor( xmin, xmax, ymin, ymax ); 01180 } 01181 01182 public void vsta() 01183 { 01184 if ( set_stream() == -1 ) return; 01185 plplotjavac.plvsta(); 01186 } 01187 01188 public void w3d( double basex, double basey, double height, double xmin0, 01189 double xmax0, double ymin0, double ymax0, double zmin0, 01190 double zmax0, double alt, double az ) 01191 { 01192 if ( set_stream() == -1 ) return; 01193 plplotjavac.plw3d( basex, basey, height, xmin0, xmax0, ymin0, ymax0, 01194 zmin0, zmax0, alt, az ); 01195 } 01196 01197 public void width( int width ) 01198 { 01199 if ( set_stream() == -1 ) return; 01200 plplotjavac.plwidth( width ); 01201 } 01202 01203 public void wind( double xmin, double xmax, double ymin, double ymax ) 01204 { 01205 if ( set_stream() == -1 ) return; 01206 plplotjavac.plwind( xmin, xmax, ymin, ymax ); 01207 } 01208 01209 public void xormod( boolean mode, boolean[] status ) 01210 { 01211 if ( set_stream() == -1 ) return; 01212 plplotjavac.plxormod( mode, status ); 01213 } 01214 01215 public void ClearOpts() 01216 { 01217 if ( set_stream() == -1 ) return; 01218 plplotjavac.plClearOpts(); 01219 } 01220 01221 public void ResetOpts() 01222 { 01223 if ( set_stream() == -1 ) return; 01224 plplotjavac.plResetOpts(); 01225 } 01226 01227 public void SetUsage( String program_string, String usage_string ) 01228 { 01229 if ( set_stream() == -1 ) return; 01230 plplotjavac.plSetUsage( program_string, usage_string ); 01231 } 01232 01233 public void OptUsage() 01234 { 01235 if ( set_stream() == -1 ) return; 01236 plplotjavac.plOptUsage(); 01237 } 01238 01239 public void hlsrgb( double h, double l, double s, double[] r, double[] g, double[] b ) 01240 { 01241 if ( set_stream() == -1 ) return; 01242 plplotjavac.plhlsrgb( h, l, s, r, g, b ); 01243 } 01244 01245 public void rgbhls( double r, double g, double b, double[] h, double[] l, double[] s ) 01246 { 01247 if ( set_stream() == -1 ) return; 01248 plplotjavac.plrgbhls( r, g, b, h, l, s ); 01249 } 01250 01251 // Deprecated versions of methods which use int for a flag instead of 01252 // boolean. 01253 public void cpstrm( int iplsr, int flags ) 01254 { 01255 if ( set_stream() == -1 ) return; 01256 plplotjavac.plcpstrm( iplsr, flags != 0 ); 01257 } 01258 01259 public void plot3d( double[] x, double[] y, double[][] z, int opt, int side ) 01260 { 01261 if ( set_stream() == -1 ) return; 01262 plplotjavac.plot3d( x, y, z, opt, side != 0 ); 01263 } 01264 01265 public void poly3( double[] x, double[] y, double[] z, int[] draw, int ifcc ) 01266 { 01267 if ( set_stream() == -1 ) return; 01268 boolean [] loc_draw = new boolean[draw.length]; 01269 for ( int i = 0; i < draw.length; i++ ) 01270 { 01271 loc_draw[i] = ( draw[i] != 0 ); 01272 } 01273 plplotjavac.plpoly3( x, y, z, loc_draw, ifcc != 0 ); 01274 } 01275 01276 public void scmap1l( int itype, double[] intensity, double[] coord1, 01277 double[] coord2, double[] coord3, int[] alt_hue_path ) 01278 { 01279 if ( set_stream() == -1 ) return; 01280 boolean [] loc_alt_hue_path = null; 01281 if ( alt_hue_path != null ) 01282 { 01283 loc_alt_hue_path = new boolean[alt_hue_path.length]; 01284 for ( int i = 0; i < alt_hue_path.length; i++ ) 01285 { 01286 loc_alt_hue_path[i] = ( alt_hue_path[i] != 0 ); 01287 } 01288 } 01289 plplotjavac.plscmap1l( itype != 0, intensity, coord1, coord2, coord3, loc_alt_hue_path ); 01290 } 01291 01292 public void shades( double[][] a, double xmin, double xmax, double ymin, 01293 double ymax, double[] clevel, double fill_width, int cont_color, 01294 double cont_width, int rectangular, 01295 double[][] pltr, double[][] OBJECT_DATA ) 01296 { 01297 if ( set_stream() == -1 ) return; 01298 plplotjavac.plshades( a, xmin, xmax, ymin, ymax, clevel, fill_width, 01299 cont_color, cont_width, rectangular != 0, pltr, OBJECT_DATA ); 01300 } 01301 01302 public void shade( double[][] a, double left, double right, double bottom, 01303 double top, double shade_min, double shade_max, int sh_cmap, 01304 double sh_color, double sh_width, int min_color, double min_width, 01305 int max_color, double max_width, int rectangular, 01306 double[][] pltr, double[][] OBJECT_DATA ) 01307 { 01308 if ( set_stream() == -1 ) return; 01309 plplotjavac.plshade( a, left, right, bottom, top, shade_min, shade_max, 01310 sh_cmap, sh_color, sh_width, min_color, min_width, 01311 max_color, max_width, rectangular != 0, pltr, OBJECT_DATA ); 01312 } 01313 01314 public void spause( int pause ) 01315 { 01316 if ( set_stream() == -1 ) return; 01317 plplotjavac.plspause( pause != 0 ); 01318 } 01319 01320 public void stripc( int[] id, String xspec, String yspec, 01321 double xmin, double xmax, double xjump, 01322 double ymin, double ymax, double xlpos, double ylpos, 01323 int y_ascl, int acc, int colbox, int collab, 01324 int[] colline, int[] styline, String[] legline, 01325 String labx, String laby, String labtop ) 01326 { 01327 if ( set_stream() == -1 ) return; 01328 plplotjavac.plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax, 01329 xlpos, ylpos, y_ascl != 0, acc != 0, colbox, collab, 01330 colline, styline, legline, labx, laby, labtop ); 01331 } 01332 01333 public void svect( double[] arrow_x, double[] arrow_y, int fill ) 01334 { 01335 if ( set_stream() == -1 ) return; 01336 plplotjavac.plsvect( arrow_x, arrow_y, fill != 0 ); 01337 } 01338 01339 public void xormod( int mode, int[] status ) 01340 { 01341 if ( set_stream() == -1 ) return; 01342 boolean [] loc_status = new boolean[1]; 01343 plplotjavac.plxormod( mode != 0, loc_status ); 01344 status[0] = loc_status[0] ? 1 : 0; 01345 } 01346 }