diff options
author | Kenneth Russel <[email protected]> | 2004-03-15 18:49:31 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-03-15 18:49:31 +0000 |
commit | 0a7c6d77aab5b922f3225ed8ed6076f8ee984ab6 (patch) | |
tree | f2c7a495cd368f9977159f91d63338ad4a5a140e /src/net/java/games/gluegen/JavaEmitter.java | |
parent | edfa42f91c09df70073691db069db4295805f827 (diff) |
Fixed Issue 68: Window system-specific JAWT classes must implement JAWT_PlatformInfo
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@90 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/gluegen/JavaEmitter.java')
-rw-r--r-- | src/net/java/games/gluegen/JavaEmitter.java | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/net/java/games/gluegen/JavaEmitter.java b/src/net/java/games/gluegen/JavaEmitter.java index 63350b2e8..b1384375e 100644 --- a/src/net/java/games/gluegen/JavaEmitter.java +++ b/src/net/java/games/gluegen/JavaEmitter.java @@ -515,12 +515,29 @@ public class JavaEmitter implements GlueEmitter { writer.println(); writer.println("import net.java.games.gluegen.runtime.*;"); writer.println(); + List/*<String>*/ imports = cfg.imports(); + for (Iterator iter = imports.iterator(); iter.hasNext(); ) { + writer.print("import "); + writer.print(iter.next()); + writer.println(";"); + } List/*<String>*/ javadoc = cfg.javadocForClass(containingTypeName); for (Iterator iter = javadoc.iterator(); iter.hasNext(); ) { writer.println((String) iter.next()); } writer.println(); - writer.println("public class " + containingTypeName + " {"); + writer.print("public class " + containingTypeName + " "); + boolean firstIteration = true; + List/*<String>*/ userSpecifiedInterfaces = cfg.implementedInterfaces(containingTypeName); + for (Iterator iter = userSpecifiedInterfaces.iterator(); iter.hasNext(); ) { + if (firstIteration) { + writer.print("implements "); + } + firstIteration = false; + writer.print(iter.next()); + writer.print(" "); + } + writer.println("{"); writer.println(" private StructAccessor accessor;"); writer.println(); writer.println(" public static int size() {"); @@ -1048,13 +1065,14 @@ public class JavaEmitter implements GlueEmitter { try { if (cfg.allStatic() || cfg.emitInterface()) { String[] interfaces; + List userSpecifiedInterfaces = null; if (cfg.emitInterface()) { - List userSpecifiedInterfaces = cfg.extendedInterfaces(cfg.className()); - interfaces = new String[userSpecifiedInterfaces.size()]; - userSpecifiedInterfaces.toArray(interfaces); + userSpecifiedInterfaces = cfg.extendedInterfaces(cfg.className()); } else { - interfaces = null; + userSpecifiedInterfaces = cfg.implementedInterfaces(cfg.className()); } + interfaces = new String[userSpecifiedInterfaces.size()]; + userSpecifiedInterfaces.toArray(interfaces); final List/*<String>*/ intfDocs = cfg.javadocForClass(cfg.className()); CodeGenUtils.EmissionCallback docEmitter = @@ -1089,6 +1107,13 @@ public class JavaEmitter implements GlueEmitter { } }; + String[] interfaces; + List userSpecifiedInterfaces = null; + userSpecifiedInterfaces = cfg.implementedInterfaces(cfg.implClassName()); + interfaces = new String[1 + userSpecifiedInterfaces.size()]; + userSpecifiedInterfaces.toArray(interfaces); + interfaces[userSpecifiedInterfaces.size()] = cfg.className(); + CodeGenUtils.emitJavaHeaders( javaImplWriter, cfg.implPackageName(), @@ -1096,7 +1121,7 @@ public class JavaEmitter implements GlueEmitter { true, (String[]) cfg.imports().toArray(new String[] {}), new String[] { "public" }, - new String[] { cfg.className() }, + interfaces, null, docEmitter); } |