From 4c5d6c1b5570fe1ba2cfbbed46259f0a21534ff5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 17 Mar 2012 21:21:26 +0100 Subject: Adapt to GlueGen IO resource changes URL -> URLConnection for effeciency; API doc enhancements; Minor edits - API doc added/enhanced: - ShaderCode - ShaderUtil - NewtBaseActivity: Clarify method / var names --- src/jogl/classes/jogamp/graph/font/FontConstructor.java | 4 ++-- src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java | 8 ++++---- .../jogamp/graph/font/typecast/TypecastFontConstructor.java | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/jogamp') diff --git a/src/jogl/classes/jogamp/graph/font/FontConstructor.java b/src/jogl/classes/jogamp/graph/font/FontConstructor.java index 721b2072f..b452ae548 100644 --- a/src/jogl/classes/jogamp/graph/font/FontConstructor.java +++ b/src/jogl/classes/jogamp/graph/font/FontConstructor.java @@ -29,11 +29,11 @@ package jogamp.graph.font; import java.io.File; import java.io.IOException; -import java.net.URL; +import java.net.URLConnection; import com.jogamp.graph.font.Font; public interface FontConstructor { Font create(File file) throws IOException ; - Font create(URL url) throws IOException ; + Font create(URLConnection url) throws IOException ; } diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java index e2c79a5a8..0772cc47f 100644 --- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java +++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java @@ -36,7 +36,7 @@ import com.jogamp.common.util.IOUtil; import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontSet; import com.jogamp.graph.font.FontFactory; -import java.net.URL; +import java.net.URLConnection; public class UbuntuFontLoader implements FontSet { @@ -121,11 +121,11 @@ public class UbuntuFontLoader implements FontSet { Font abspath(String fname, int family, int style) throws IOException { final String err = "Problem loading font "+fname+", stream "+relPath+fname; try { - URL url = IOUtil.getResource(UbuntuFontLoader.class, relPath+fname); - if(null == url) { + URLConnection conn = IOUtil.getResource(UbuntuFontLoader.class, relPath+fname); + if(null == conn) { throw new GLException(err); } - final Font f= FontFactory.get ( url ) ; + final Font f= FontFactory.get ( conn ) ; if(null != f) { fontMap.put( ( family << 8 ) | style, f ); return f; diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java index d5fd34cf7..e8b62bdd2 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java @@ -29,7 +29,7 @@ package jogamp.graph.font.typecast; import java.io.File; import java.io.IOException; -import java.net.URL; +import java.net.URLConnection; import java.security.AccessController; import java.security.PrivilegedAction; @@ -64,7 +64,7 @@ public class TypecastFontConstructor implements FontConstructor { throw new InternalError("Unexpected Object: "+o); } - public Font create(final URL furl) throws IOException { + public Font create(final URLConnection fconn) throws IOException { return AccessController.doPrivileged(new PrivilegedAction() { public Font run() { File tf = null; @@ -72,10 +72,10 @@ public class TypecastFontConstructor implements FontConstructor { Font f = null; try { tf = IOUtil.createTempFile( "joglfont", ".ttf", null); - len = IOUtil.copyURL2File(furl, tf); + len = IOUtil.copyURLConn2File(fconn, tf); if(len==0) { tf.delete(); - throw new GLException("Font of stream "+furl+" was zero bytes"); + throw new GLException("Font of stream "+fconn.getURL()+" was zero bytes"); } f = create(tf); tf.delete(); -- cgit v1.2.3