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