[cairo-commit] cairo-java/test/kapow Kapow.java,1.3,1.4

Jeffrey Morgan commit at pdx.freedesktop.org
Tue Mar 8 16:58:38 PST 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/kapow
In directory gabe:/tmp/cvs-serv21543/test/kapow

Modified Files:
	Kapow.java 
Log Message:
still working on the current_path callbacks

Index: Kapow.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/kapow/Kapow.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Kapow.java	8 Mar 2005 21:31:59 -0000	1.3
+++ Kapow.java	9 Mar 2005 00:58:36 -0000	1.4
@@ -24,6 +24,7 @@
 public class Kapow {
 	
 	public Cairo cr;
+	private MyPath path;
 	private String filename = "kapow.png";
 	public int IMAGE_WIDTH = 384;
 	public int IMAGE_HEIGHT = 256;
@@ -123,14 +124,22 @@
 	}
 	
 	private void makeTextPath(double x, double y, String text) {
+		path = new MyPath();
 	    cr.moveTo(x, y);
         cr.textPath(text);
-        cr.setCurrentPathFlat(new MyPath());
+        cr.setCurrentPathFlat(path);
 	}
 
-	public static void main(String[] args) {
-
-		
+	private static void usage(){
+		System.out.println("USAGE: gij kapow.Kapow <text>");
+		System.out.println("You must specify the text to print.");
+		System.exit(1);
+	}
+	
+	public static void main(String[] args) throws Exception {
+		if (args.length != 1)
+			usage();
+		new Kapow(args[0]);
 	}
     
     private class MyPath implements CurrentPath {
@@ -138,6 +147,7 @@
         private boolean firstTime = true;
 
         public void moveTo(double x, double y) {
+        	System.out.println("moveTo");
             if (firstTime) {
                 cr.newPath();
                 firstTime = false;




More information about the cairo-commit mailing list