From: megacz Date: Fri, 30 Jan 2004 06:49:46 +0000 (+0000) Subject: 2002/08/07 04:43:31 X-Git-Tag: RC3~1583 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=fbb46029a34ee12fbd5f8c834ef4c19914340fc7 2002/08/07 04:43:31 darcs-hash:20040130064946-2ba56-601df5f619a002471236c9ffaaf08521efb3f39f.gz --- diff --git a/CHANGES b/CHANGES index 742608c..1fe0a9f 100644 --- a/CHANGES +++ b/CHANGES @@ -343,3 +343,5 @@ 06-Jul megacz POSIX.java: font mapper now prefers ISO_8559-1 fonts +06-Jul megacz Box.java: use new HTTP interface, getIds() only returns children + diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index c60552c..f89e998 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -438,9 +438,10 @@ public final class Box extends JSObject { if (str.endsWith(".jpeg") || str.endsWith(".jpg")) str = "http://xmlrpc.xwt.org/jpeg2png/" + str.substring(str.indexOf("//") + 2); - final HTTP http = new HTTP(str); - final int contentLength = http.getContentLength(); - InputStream is = new FilterInputStream(http.getInputStream()) { + HTTP http = new HTTP(str); + final HTTP.HTTPInputStream in = http.GET(); + final int contentLength = in.getContentLength(); + InputStream is = new FilterInputStream(in) { int bytesDownloaded = 0; boolean clear = true; public int read() throws IOException { @@ -467,10 +468,9 @@ public final class Box extends JSObject { return ret; } }; - - if (str.endsWith(".gif")) ret = GIF.decode(is, str); - else ret = PNG.decode(is, str); - return ret; + + if (str.endsWith(".gif")) return GIF.decode(is, str); + else return PNG.decode(is, str); } catch (IOException e) { if (Log.on) Log.log(Box.class, "error while trying to load an image from " + str); @@ -1201,6 +1201,12 @@ public final class Box extends JSObject { return super.has(name, start); } + public Object[] getIds() { + Object[] ret = new Object[numChildren()]; + for(int i=0; i