--- orig/BuildComposablePipeline.java 2003-06-21 18:56:35.000000000 +0200 +++ new/BuildComposablePipeline.java 2003-06-22 00:40:05.000000000 +0200 @@ -466,6 +466,7 @@ protected void postMethodEmissionHook(PrintWriter output) { output.println("private PrintStream " + getOutputStreamName() + ";"); + output.println("private int indent = 0;"); output.println("protected String dumpArray(Object obj)"); output.println("{"); output.println(" StringBuffer sb = new StringBuffer(\"[\");"); @@ -481,11 +482,24 @@ output.println(" sb.append(']');"); output.println(" return sb.toString();"); output.println("}"); - + output.println("protected void print(String str)"); + output.println("{"); + output.println(" "+getOutputStreamName()+".print(str);"); + output.println("}"); + output.println("protected void println(String str)"); + output.println("{"); + output.println(" "+getOutputStreamName()+".println(str);"); + output.println("}"); + output.println("protected void printIndent()"); + output.println("{"); + output.println(" for( int i =0; i < indent; i++) {"+getOutputStreamName()+".print(' ');}"); + output.println("}"); } + + protected void emitClassDocComment(PrintWriter output) { output.println("/**
Composable pipline which wraps an underlying {@link GL} implementation,"); @@ -501,8 +515,17 @@ protected void preDownstreamCallHook(PrintWriter output, Method m) { Class[] params = m.getParameterTypes(); + if ( m.getName().equals("glEnd") || m.getName().equals("glEndList")) + { + output.println("indent-=2;"); + output.println(" printIndent();"); + } + else + { + output.println("printIndent();"); + } - output.print(getOutputStreamName() + ".print(\"" + m.getName() + "(\""); + output.print(" print(\"" + m.getName() + "(\""); for ( int i =0; i < params.length; i++ ) { if ( params[i].isArray() ) @@ -514,6 +537,10 @@ } output.println("+\")\");"); output.print(" "); + if ( m.getName().equals("glBegin")|| m.getName().equals("glNewList")) { + output.println("indent+=2;"); + output.print(" "); + } } protected void postDownstreamCallHook(PrintWriter output, Method m) @@ -521,11 +548,11 @@ Class ret = m.getReturnType(); if ( ret != Void.TYPE ) { - output.println(" "+getOutputStreamName() + ".println(\" = \"+_res);"); + output.println(" println(\" = \"+_res);"); } else { - output.println(" "+getOutputStreamName() + ".println();"); + output.println(" println(\"\");"); } }