~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to examples/java/x13.java

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//---------------------------------------------------------------------------//
2
 
// $Id: x13.java,v 1.7 2004/01/17 16:41:39 rlaboiss Exp $
 
2
// $Id: x13.java,v 1.13 2005/07/03 12:43:39 andrewross Exp $
3
3
//---------------------------------------------------------------------------//
4
4
 
5
5
//---------------------------------------------------------------------------//
6
6
// Copyright (C) 2001  Geoffrey Furnish
7
7
// Copyright (C) 2001, 2002  Alan W. Irwin
 
8
// Copyright (C) 2004  Andrew Ross
8
9
//
9
10
// This file is part of PLplot.
10
11
//
19
20
//
20
21
// You should have received a copy of the GNU Library General Public License
21
22
// along with PLplot; if not, write to the Free Software
22
 
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 
23
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
23
24
//---------------------------------------------------------------------------//
24
25
 
25
26
//---------------------------------------------------------------------------//
45
46
 
46
47
    public x13( String[] args )
47
48
    {
48
 
       PLStreamc plsdummy = new PLStreamc();
49
 
       plplotjavac pls = new plplotjavac();
 
49
        PLStream pls = new PLStream();
50
50
 
51
51
        int i, j, dthet, theta0, theta1, theta;
52
52
        double just, dx, dy;
53
53
        double[] x = new double[ 500 ];
54
54
        double[] y = new double[ 500 ];
55
55
        
56
 
        pls.plParseOpts( args, pls.PL_PARSE_FULL | pls.PL_PARSE_NOPROGRAM );
 
56
        pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM );
57
57
 
58
 
        pls.plinit();
 
58
        pls.init();
59
59
        
60
 
        pls.plenv(0., 10., 0., 10., 1, -2);
61
 
        pls.plcol0(2);
 
60
        pls.env(0., 10., 0., 10., 1, -2);
 
61
        pls.col0(2);
62
62
    // n.b. all theta quantities scaled by 2*pi/500 to be integers to avoid
63
63
    // floating point logic problems.
64
64
        theta0 = 0;
76
76
                x[j] = 5 + 3 * Math.cos((2.*Math.PI/500.)*theta);
77
77
                y[j++] = 5 + 3 * Math.sin((2.*Math.PI/500.)*theta);
78
78
            }
79
 
            pls.plcol0(i + 1);
80
 
            pls.plpsty((i + 3) % 8 + 1);
 
79
            pls.col0(i + 1);
 
80
            pls.psty((i + 3) % 8 + 1);
81
81
            // Make array of correct size to copy to.
82
82
            double [] xsized = new double[j];
83
83
            double [] ysized = new double[j];
84
84
            System.arraycopy(x, 0, xsized, 0, j);
85
85
            System.arraycopy(y, 0, ysized, 0, j);
86
 
            pls.plfill(xsized, ysized);
87
 
            pls.plcol0(1);
88
 
            pls.plline(xsized, ysized);
 
86
            pls.fill(xsized, ysized);
 
87
            pls.col0(1);
 
88
            pls.line(xsized, ysized);
89
89
            just = (2.*Math.PI/500.)*(theta0 + theta1)/2.;
90
90
            dx = .25 * Math.cos(just);
91
91
            dy = .25 * Math.sin(just);
94
94
            else 
95
95
                just = 1.;
96
96
 
97
 
            pls.plptex((x[j / 2] + dx), (y[j / 2] + dy), 1.0, 0.0, just, text[i]);
 
97
            pls.ptex((x[j / 2] + dx), (y[j / 2] + dy), 1.0, 0.0, just, text[i]);
98
98
            theta0 = theta - dthet;
99
99
        }
100
 
        pls.plfont(2);
101
 
        pls.plschr(0., 1.3);
102
 
        pls.plptex(5.0, 9.0, 1.0, 0.0, 0.5, "Percentage of Sales");
103
 
        pls.plend();
 
100
        pls.font(2);
 
101
        pls.schr(0., 1.3);
 
102
        pls.ptex(5.0, 9.0, 1.0, 0.0, 0.5, "Percentage of Sales");
 
103
        pls.end();
104
104
    }
105
105
}
106
106