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

« back to all changes in this revision

Viewing changes to examples/java/x07.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: x07.java,v 1.7 2004/01/17 16:41:39 rlaboiss Exp $
 
2
// $Id: x07.java,v 1.16 2005/12/10 20:14:45 airwin 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) 2001  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
//---------------------------------------------------------------------------//
47
48
 
48
49
    public x07( String[] args )
49
50
    {
50
 
       PLStreamc plsdummy = new PLStreamc();
51
 
       plplotjavac pls = new plplotjavac();
 
51
       PLStream pls = new PLStream();
52
52
 
53
53
//        NumberFormat nf = NumberFormat.getNumberInstance();
54
54
//        Change to this custom format to get stupid locale commas
55
55
//        separating hundreds and thousands place out of labels.
56
 
        DecimalFormat nf = new DecimalFormat("#####");
 
56
        DecimalFormat nf = new DecimalFormat("####0");
57
57
 
58
58
        int i, j, k, l;
59
59
        double x[] = new double[1];
61
61
 
62
62
    // Parse and process command line arguments.
63
63
 
64
 
        pls.plParseOpts( args, pls.PL_PARSE_FULL | pls.PL_PARSE_NOPROGRAM );
 
64
        pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM );
65
65
 
66
66
    // Initialize plplot.
67
67
 
68
 
        pls.plinit();
 
68
        pls.init();
69
69
 
70
 
        pls.plfontld(1);
 
70
        pls.fontld(1);
71
71
        for( l = 0; l < base.length; l++ ) {
72
 
            pls.pladv(0);
 
72
            pls.adv(0);
73
73
 
74
74
        // Set up viewport and window.
75
75
 
76
 
            pls.plcol0(2);
77
 
            pls.plvpor(0.15, 0.95, 0.1, 0.9);
78
 
            pls.plwind(0.0, 1.0, 0.0, 1.0);
 
76
            pls.col0(2);
 
77
            pls.vpor(0.15, 0.95, 0.1, 0.9);
 
78
            pls.wind(0.0, 1.0, 0.0, 1.0);
79
79
 
80
80
        // Draw the grid using plbox.
81
81
 
82
 
            pls.plbox("bcgt", 0.1, 0, "bcgt", 0.1, 0);
 
82
            pls.box("bcg", 0.1, 0, "bcg", 0.1, 0);
83
83
 
84
84
        // Write the digits below the frame.
85
85
 
86
 
            pls.plcol0(15);
 
86
            pls.col0(15);
87
87
            for (i = 0; i <= 9; i++) {
88
88
                String text = nf.format(i);
89
 
                pls.plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, text);
 
89
                pls.mtex("b", 1.5, (0.1 * i + 0.05), 0.5, text);
90
90
            }
91
91
 
92
92
            k = 0;
95
95
            // Write the digits to the left of the frame.
96
96
 
97
97
                String text = nf.format( base[l] + 10*i );
98
 
                pls.plmtex("lv", 1.0, (0.95 - 0.1 * i), 1.0, text);
 
98
                pls.mtex("lv", 1.0, (0.95 - 0.1 * i), 1.0, text);
99
99
                for( j = 0; j <= 9; j++ ) {
100
100
                    x[0] = 0.1 * j + 0.05;
101
101
                    y[0] = 0.95 - 0.1 * i;
103
103
                // Display the symbols.
104
104
                // N.B. plsym expects arrays so that is what we give it.
105
105
 
106
 
                    pls.plsym( x, y, base[l] + k );
 
106
                    pls.sym( x, y, base[l] + k );
107
107
                    k = k + 1;
108
108
                }
109
109
            }
110
110
 
111
 
            pls.plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols");
 
111
            pls.mtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols");
112
112
        }
113
 
        pls.plend();
 
113
        pls.end();
114
114
    }
115
115
}
116
116