JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / swingjs / j2s / jssun / awt / image / URLImageSource.js
1 Clazz.declarePackage ("jssun.awt.image");\r
2 Clazz.load (["jssun.awt.image.InputStreamImageSource"], "jssun.awt.image.URLImageSource", ["java.net.URL"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.url = null;\r
5 this.conn = null;\r
6 this.actualHost = null;\r
7 this.actualPort = 0;\r
8 Clazz.instantialize (this, arguments);\r
9 }, jssun.awt.image, "URLImageSource", jssun.awt.image.InputStreamImageSource);\r
10 Clazz.makeConstructor (c$, \r
11 function (u) {\r
12 Clazz.superConstructor (this, jssun.awt.image.URLImageSource, []);\r
13 this.url = u;\r
14 }, "java.net.URL");\r
15 Clazz.makeConstructor (c$, \r
16 function (href) {\r
17 this.construct ( new java.net.URL (null, href));\r
18 }, "~S");\r
19 Clazz.makeConstructor (c$, \r
20 function (u, uc) {\r
21 this.construct (u);\r
22 this.conn = uc;\r
23 }, "java.net.URL,java.net.URLConnection");\r
24 Clazz.makeConstructor (c$, \r
25 function (uc) {\r
26 this.construct (uc.getURL (), uc);\r
27 }, "java.net.URLConnection");\r
28 Clazz.overrideMethod (c$, "checkSecurity", \r
29 function (context, quiet) {\r
30 if (this.actualHost != null) {\r
31 try {\r
32 var security = System.getSecurityManager ();\r
33 if (security != null) {\r
34 security.checkConnect (this.actualHost, this.actualPort, context);\r
35 }} catch (e) {\r
36 if (Clazz.exceptionOf (e, SecurityException)) {\r
37 if (!quiet) {\r
38 throw e;\r
39 }return false;\r
40 } else {\r
41 throw e;\r
42 }\r
43 }\r
44 }return true;\r
45 }, "~O,~B");\r
46 Clazz.defineMethod (c$, "getDecoder", \r
47 function () {\r
48 return null;\r
49 });\r
50 });\r