[cairo-commit] cairo-java/test/snippets CairoSnippetsPS.java, NONE, 1.1 CairoSnippetsPDF.java, 1.1, 1.2

Jeffrey Morgan commit at pdx.freedesktop.org
Mon Mar 14 18:12:03 PST 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/snippets
In directory gabe:/tmp/cvs-serv10534/test/snippets

Modified Files:
	CairoSnippetsPDF.java 
Added Files:
	CairoSnippetsPS.java 
Log Message:
caching jmethodID and new example

--- NEW FILE: CairoSnippetsPS.java ---
/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2005 the Java-Gnome Team, all rights reserved.
 *
 * The Java-Gnome bindings library is free software distributed under
 * the terms of the GNU Library General Public License version 2.
 */

package snippets;

import org.freedesktop.cairo.Cairo;
import org.freedesktop.cairo.PdfSurface;
import org.freedesktop.cairo.PsSurface;

/**
 */
public class CairoSnippetsPS {

	public static int X_INCHES = 2;
	public static int Y_INCHES = 2;
	public static double X_PPI = 300.0;
	public static double Y_PPI = 300.0;

	public static double WIDTH  = X_INCHES * 96.0;
	public static double HEIGHT = Y_INCHES * 96.0;
	

	public static void main(String[] args) throws Exception {
		// initialize
		Cairo cr = new Cairo();
		PsSurface surface = new PsSurface("./snippets.ps", X_INCHES, Y_INCHES, X_PPI, Y_PPI);
		cr.setTargetSurface(surface);
		
		// call the snippets
		Snippets snip = new Snippets();
		for (int i = 0; i < Snippets.snippets.length; i++) {
			cr.save();
			Snippets.invokeSnippet(snip, i, cr, WIDTH, HEIGHT);
			cr.showPage();
			cr.restore();
		}
		
		// cleanup
		cr.dispose();
		surface.close();
	}
}

Index: CairoSnippetsPDF.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPDF.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CairoSnippetsPDF.java	8 Mar 2005 11:58:33 -0000	1.1
+++ CairoSnippetsPDF.java	15 Mar 2005 02:12:01 -0000	1.2
@@ -24,8 +24,6 @@
 	public static double WIDTH  = X_INCHES * 96.0;
 	public static double HEIGHT = Y_INCHES * 96.0;
 	
-	public static double M_PI = 3.14159265358979323846;
-	
 
 	public static void main(String[] args) throws Exception {
 		// initialize




More information about the cairo-commit mailing list